nova作为计算组件,在控制节点和计算节点都需要安装
1、创建用户:nova,并授权用户权限
[root@controller ~]# source admin-openrc.sh [root@controller ~]# openstack user create --domain default --password=nova nova +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | default | | enabled | True | | id | 45524200648c4f11a87d06dcfb4383ed | | name | nova | +-----------+----------------------------------+ [root@controller ~]# openstack role add --project service --user nova admin
2、在keystone上面注册nova
[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Compute | | enabled | True | | id | 35c1b3343be94bbeafc4bf0e998ec8f5 | | name | nova | | type | compute | +-------------+----------------------------------+ [root@controller ~]# openstack endpoint create --region RegionOne compute public http://172.16.80.130:8774/v2/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 7f317abd7f264109b318e567d068065f | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 35c1b3343be94bbeafc4bf0e998ec8f5 | | service_name | nova | | service_type | compute | | url | http://172.16.80.130:8774/v2/%(tenant_id)s | +--------------+--------------------------------------------+ [root@controller ~]# openstack endpoint create --region RegionOne compute admin http://172.16.80.130:8774/v2/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 8fb6e2da3c9c4bd0b3e2f787d40df4e0 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 35c1b3343be94bbeafc4bf0e998ec8f5 | | service_name | nova | | service_type | compute | | url | http://172.16.80.130:8774/v2/%(tenant_id)s | +--------------+--------------------------------------------+ [root@controller ~]# openstack endpoint create --region RegionOne compute internal http://172.16.80.130:8774/v2/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 3a4a8569cec949b5b50367d3deb67861 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 35c1b3343be94bbeafc4bf0e998ec8f5 | | service_name | nova | | service_type | compute | | url | http://172.16.80.130:8774/v2/%(tenant_id)s | +--------------+--------------------------------------------+
3、安装配置nova
[root@controller ~]# yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient -y [root@controller nova]# grep -n "^[a-Z]" /etc/nova/nova.conf 198:my_ip=172.16.80.130 344:enabled_apis=osapi_compute,metadata 506:auth_strategy=keystone 838:network_api_class=nova.network.neutronv2.api.API 930:linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver 1064:security_group_api=neutron 1240:firewall_driver=nova.virt.firewall.NoopFirewallDriver 1283:verbose=true 1422:rpc_backend=rabbit 1721:connection=mysql://nova:[email protected]/nova 1944:host=$my_ip 2122:uth_uri = http://172.16.80.130:5000 2123:auth_url = http://172.16.80.130:35357 2124:auth_plugin = password 2125:project_domain_id = default 2126:user_domain_id = default 2127:project_name = service 2128:username = nova 2129:password = nova 2738:lock_path=/var/lib/nova/tmp 2881:rabbit_host=172.16.80.130 2882:rabbit_port=5672 2883:rabbit_userid=openstack 2884:rabbit_password=openstack 3309:vncserver_listen= $my_ip 3310:vncserver_proxyclient_address= $my_ip
4、同步数据库,检查结果
[root@controller nova]# su -s /bin/sh -c "nova-manage db sync" nova [root@controller nova]# mysql -e "use nova;show tables" +--------------------------------------------+ | Tables_in_nova | +--------------------------------------------+ | agent_builds | | aggregate_hosts | | aggregate_metadata | | aggregates | | block_device_mapping | | bw_usage_cache | | cells | | certificates | | compute_nodes | | console_pools | | consoles | | dns_domains | | fixed_ips | | floating_ips | | instance_actions | | instance_actions_events | | instance_extra | | instance_faults | | instance_group_member | | instance_group_policy | | instance_groups | | instance_id_mappings | | instance_info_caches | | instance_metadata | | instance_system_metadata | | instance_type_extra_specs | | instance_type_projects | | instance_types | | instances | | key_pairs | | migrate_version | | migrations | | networks | | pci_devices | | project_user_quotas | | provider_fw_rules | | quota_classes | | quota_usages | | quotas | | reservations | | s3_p_w_picpaths | | security_group_default_rules | | security_group_instance_association | | security_group_rules | | security_groups | | services | | shadow_agent_builds | | shadow_aggregate_hosts | | shadow_aggregate_metadata | | shadow_aggregates | | shadow_block_device_mapping | | shadow_bw_usage_cache | | shadow_cells | | shadow_certificates | | shadow_compute_nodes | | shadow_console_pools | | shadow_consoles | | shadow_dns_domains | | shadow_fixed_ips | | shadow_floating_ips | | shadow_instance_actions | | shadow_instance_actions_events | | shadow_instance_extra | | shadow_instance_faults | | shadow_instance_group_member | | shadow_instance_group_policy | | shadow_instance_groups | | shadow_instance_id_mappings | | shadow_instance_info_caches | | shadow_instance_metadata | | shadow_instance_system_metadata | | shadow_instance_type_extra_specs | | shadow_instance_type_projects | | shadow_instance_types | | shadow_instances | | shadow_key_pairs | | shadow_migrate_version | | shadow_migrations | | shadow_networks | | shadow_pci_devices | | shadow_project_user_quotas | | shadow_provider_fw_rules | | shadow_quota_classes | | shadow_quota_usages | | shadow_quotas | | shadow_reservations | | shadow_s3_p_w_picpaths | | shadow_security_group_default_rules | | shadow_security_group_instance_association | | shadow_security_group_rules | | shadow_security_groups | | shadow_services | | shadow_snapshot_id_mappings | | shadow_snapshots | | shadow_task_log | | shadow_virtual_interfaces | | shadow_volume_id_mappings | | shadow_volume_usage_cache | | snapshot_id_mappings | | snapshots | | tags | | task_log | | virtual_interfaces | | volume_id_mappings | | volume_usage_cache | +--------------------------------------------+
5、启动nova
[root@controller nova]# systemctl enable openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service to /usr/lib/systemd/system/openstack-nova-api.service. Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-cert.service to /usr/lib/systemd/system/openstack-nova-cert.service. Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-consoleauth.service to /usr/lib/systemd/system/openstack-nova-consoleauth.service. Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service. Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service. Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service to /usr/lib/systemd/system/openstack-nova-novncproxy.service. [root@controller nova]# systemctl start openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
6、在计算节点上面操作
[root@computer1 ~]# vim /etc/chrony.conf server 172.16.80.130 iburst [root@computer1 ~]# systemctl enable chronyd.service [root@computer1 ~]# systemctl start chronyd.service [root@computer1 ~]# timedatectl set-timezone Asia/Shanghai [root@computer1 ~]# timedatectl status Local time: Wed 2016-11-02 19:36:16 CST Universal time: Wed 2016-11-02 11:36:16 UTC RTC time: Wed 2016-11-02 11:36:16 Timezone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: n/a
7、安装nova组件并配置
[root@computer1 ~]# yum install https://rdoproject.org/repos/openstack-liberty/rdo-release-liberty.rpm -y [root@computer1 ~]# yum install centos-release-openstack-liberty -y [root@computer1 ~]# yum install openstack-nova-compute sysfsutils -y [root@computer1 nova]# grep -n '^[a-Z]' /etc/nova/nova.conf 198:my_ip=172.16.80.131 344:enabled_apis=osapi_compute,metadata 506:auth_strategy=keystone 838:network_api_class=nova.network.neutronv2.api.API 930:linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver 1064:security_group_api=neutron 1240:firewall_driver=nova.virt.firewall.NoopFirewallDriver 1283:verbose=true 1422:rpc_backend=rabbit 1721:connection=mysql://nova:[email protected]/nova 1944:host=172.16.80.130 2122:uth_uri = http://172.16.80.130:5000 2123:auth_url = http://172.16.80.130:35357 2124:auth_plugin = password 2125:project_domain_id = default 2126:user_domain_id = default 2127:project_name = service 2128:username = nova 2129:password = nova 2309:virt_type=kvm 2738:lock_path=/var/lib/nova/tmp 2881:rabbit_host=172.16.80.130 2882:rabbit_port=5672 2883:rabbit_userid=openstack 2884:rabbit_password=openstack 3309:novncproxy_base_url=http://172.16.80.130:6080/vnc_auto.html 3311:vncserver_listen= 0.0.0.0 3312:vncserver_proxyclient_address= $my_ip 3313:vnc_enabled=true
8、启动
[root@computer1 nova]# systemctl enable libvirtd openstack-nova-compute Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service. [root@computer1 nova]# systemctl start libvirtd openstack-nova-compute
9、在控制节点上面进行验证
[root@controller ~]# source admin-openrc.sh [root@controller ~]# nova p_w_picpath-list +--------------------------------------+--------+--------+--------+ | ID | Name | Status | Server | +--------------------------------------+--------+--------+--------+ | 6772deca-7b31-4f97-affa-668518b22972 | cirros | ACTIVE | | +--------------------------------------+--------+--------+--------+ [root@controller ~]# [root@controller ~]# nova endpoints WARNING: nova has no endpoint in ! Available endpoints for this service: +-----------+---------------------------------------------------------------+ | nova | Value | +-----------+---------------------------------------------------------------+ | id | 3a4a8569cec949b5b50367d3deb67861 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:8774/v2/8a3b7f9f1b2c4f7eaf7780d268e672d1 | +-----------+---------------------------------------------------------------+ +-----------+---------------------------------------------------------------+ | nova | Value | +-----------+---------------------------------------------------------------+ | id | 7f317abd7f264109b318e567d068065f | | interface | public | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:8774/v2/8a3b7f9f1b2c4f7eaf7780d268e672d1 | +-----------+---------------------------------------------------------------+ +-----------+---------------------------------------------------------------+ | nova | Value | +-----------+---------------------------------------------------------------+ | id | 8fb6e2da3c9c4bd0b3e2f787d40df4e0 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:8774/v2/8a3b7f9f1b2c4f7eaf7780d268e672d1 | +-----------+---------------------------------------------------------------+ WARNING: glance has no endpoint in ! Available endpoints for this service: +-----------+----------------------------------+ | glance | Value | +-----------+----------------------------------+ | id | 03cbb947b93e43ea936ee6c54db63275 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:9292 | +-----------+----------------------------------+ +-----------+----------------------------------+ | glance | Value | +-----------+----------------------------------+ | id | 6a716435ec7b4d7b8593f02a4bd89a57 | | interface | public | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:9292 | +-----------+----------------------------------+ +-----------+----------------------------------+ | glance | Value | +-----------+----------------------------------+ | id | fcf98c96b25d4da5a1bf68ffafeaf832 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:9292 | +-----------+----------------------------------+ WARNING: keystone has no endpoint in ! Available endpoints for this service: +-----------+----------------------------------+ | keystone | Value | +-----------+----------------------------------+ | id | 09a1cd321fd64049980096e7a940f6f8 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:5000/v2.0 | +-----------+----------------------------------+ +-----------+----------------------------------+ | keystone | Value | +-----------+----------------------------------+ | id | 0c199cc25852452d8b4a428edd4af515 | | interface | public | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:5000/v2.0 | +-----------+----------------------------------+ +-----------+----------------------------------+ | keystone | Value | +-----------+----------------------------------+ | id | 1b875e33729a4ea4aa9f1e3f5d28bfd1 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | url | http://172.16.80.130:35357/v2.0 | +-----------+----------------------------------+ [root@controller ~]# [root@controller ~]# nova service-list +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+ | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+ | 1 | nova-conductor | controller | internal | enabled | up | 2016-11-02T12:27:09.000000 | - | | 2 | nova-consoleauth | controller | internal | enabled | up | 2016-11-02T12:27:09.000000 | - | | 3 | nova-scheduler | controller | internal | enabled | up | 2016-11-02T12:27:08.000000 | - | | 4 | nova-cert | controller | internal | enabled | up | 2016-11-02T12:27:09.000000 | - | | 5 | nova-compute | computer1 | nova | enabled | up | 2016-11-02T12:27:12.000000 | - | +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+