Controller节点:1、创建 nova_api, nova,和 nova_cell0 的数据库,授予权限:$ mysql -u root -pMariaDB [(none)]>CREATE DATABASE nova_api;MariaDB [(none)]> CREATE DATABASE nova;MariaDB [(none)]> CREATE DATABASE nova_cell0;MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO ’nova’@’localhost’ IDENTIFIED BY ‘123456’;MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO ’nova’@’%’ IDENTIFIED BY ‘123456’;MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO ’nova’@’localhost’ IDENTIFIED BY ‘123456’;MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO ’nova’@’%’ IDENTIFIED BY ‘123456’;MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO ’nova’@’localhost’ IDENTIFIED BY ‘123456’;MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO ’nova’@’%’ IDENTIFIED BY ‘123456’;MariaDB [(none)]> exit;2、创建nova用户:$ . admin-openrc$ openstack user create –domain default –password-prompt novaUser Password: 123456Repeat User Password: 123456+———————+———————————-+| Field | Value |+———————+———————————-+| domain_id | default || enabled | True || id | 81f1d5dfad5a42bb806d197ceb9881ce || name | nova || options | {} || password_expires_at | None |+———————+———————————-+$ openstack role add –project service –user nova admin3、创建nova服务实体:$ openstack service create –name nova –description “OpenStack Compute” compute+————-+———————————-+| Field | Value |+————-+———————————-+| description | OpenStack Compute || enabled | True || id | 3e011d345e4442fe8a232ab5ab1f8323 || name | nova || type | compute |+————-+———————————-+4、创建Compute API服务端点:$ openstack endpoint create –region RegionOne compute public http://controller:8774/v2.1+————–+———————————-+| Field | Value |+————–+———————————-+| enabled | True || id | 343b6a8fc9564623aca0097b2383650d || interface | public || region | RegionOne || region_id | RegionOne || service_id | 3e011d345e4442fe8a232ab5ab1f8323 || service_name | nova || service_type | compute || url | http://controller:8774/v2.1 |+————–+———————————-+$ openstack endpoint create –region RegionOne compute internal http://controller:8774/v2.1+————–+———————————-+| Field | Value |+————–+———————————-+| enabled | True || id | 3458cf55ac8b44d58c949fe88bf9afe3 || interface | internal || region | RegionOne || region_id | RegionOne || service_id | 3e011d345e4442fe8a232ab5ab1f8323 || service_name | nova || service_type | compute || url | http://controller:8774/v2.1 |+————–+———————————-+$ openstack endpoint create –region RegionOne compute admin http://controller:8774/v2.1+————–+———————————-+| Field | Value |+————–+———————————-+| enabled | True || id | 9f9115389c2a49a2874761b92c849bb0 || interface | admin || region | RegionOne || region_id | RegionOne || service_id | 3e011d345e4442fe8a232ab5ab1f8323 || service_name | nova || service_type | compute || url | http://controller:8774/v2.1 |+————–+———————————-+5、创建Placement服务相关:$ openstack user create –domain default –password-prompt placementUser Password: 123456Repeat User Password: 123456+———————+———————————-+| Field | Value |+———————+———————————-+| domain_id | default || enabled | True || id | 74870bc86a7c4108869c620099bffc30 || name | placement || options | {} || password_expires_at | None |+———————+———————————-+$ openstack role add –project service –user placement admin$ openstack service create –name placement –description “Placement API” placement+————-+———————————-+| Field | Value |+————-+———————————-+| description | Placement API || enabled | True || id | bbd270a97c3a499fb73765120094e9da || name | placement || type | placement |+————-+———————————-+$ openstack endpoint create –region RegionOne placement public http://controller:8778+————–+———————————-+| Field | Value |+————–+———————————-+| enabled | True || id | d79b3b62302a4055924762ac676fc9b4 || interface | public || region | RegionOne || region_id | RegionOne || service_id | bbd270a97c3a499fb73765120094e9da || service_name | placement || service_type | placement || url | http://controller:8778 |+————–+———————————-+$ openstack endpoint create –region RegionOne placement internal http://controller:8778+————–+———————————-+| Field | Value |+————–+———————————-+| enabled | True || id | 5424919fbee34a7a92946c607706b38a || interface | internal || region | RegionOne || region_id | RegionOne || service_id | bbd270a97c3a499fb73765120094e9da || service_name | placement || service_type | placement || url | http://controller:8778 |+————–+———————————-+$ openstack endpoint create –region RegionOne placement admin http://controller:8778+————–+———————————-+| Field | Value |+————–+———————————-+| enabled | True || id | d9d5626cdb5442ac91dff8c1588f4726 || interface | admin || region | RegionOne || region_id | RegionOne || service_id | bbd270a97c3a499fb73765120094e9da || service_name | placement || service_type | placement || url | http://controller:8778 |+————–+———————————-+6、安装和配置:# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api# vi /etc/nova/nova.conf[DEFAULT]my_ip=192.100.10.160use_neutron=truefirewall_driver=nova.virt.firewall.NoopFirewallDriverenabled_apis=osapi_compute,metadatatransport_url=rabbit://openstack:123456@controller[api]auth_strategy=keystone[api_database]connection = mysql+pymysql://nova:123456@controller/nova_api[database]connection = mysql+pymysql://nova:123456@controller/nova[glance]api_servers = http://controller:9292[keystone_authtoken]auth_url = http://controller:5000/v3memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = 123456[libvirt]#virt_type=kvm[neutron]url = http://controller:9696auth_url = http://controller:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = neutronpassword = 123456service_metadata_proxy = truemetadata_proxy_shared_secret = 123456[oslo_concurrency]lock_path=/var/lib/nova/tmp[placement]os_region_name = RegionOneproject_domain_name = Defaultproject_name = serviceauth_type = passworduser_domain_name = Defaultauth_url = http://controller:5000/v3username = placementpassword = 123456[vnc]enabled=trueserver_listen=$my_ipserver_proxyclient_address=$my_ip#novncproxy_base_url=http://127.0.0.1:6080/vnc_auto.html# vi /etc/httpd/conf.d/00-nova-placement-api.conf 在最下方加入<Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion></Directory>7、完成安装:# systemctl restart httpd# su -s /bin/sh -c “nova-manage api_db sync” nova# su -s /bin/sh -c “nova-manage cell_v2 map_cell0” nova# su -s /bin/sh -c “nova-manage cell_v2 create_cell –name=cell1 –verbose” nova# su -s /bin/sh -c “nova-manage db sync” nova# nova-manage cell_v2 list_cells+——-+————————————–+————————————+————————————————-+| 名称 | UUID | Transport URL | 数据库连接 |+——-+————————————–+————————————+————————————————-+| cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysql+pymysql://nova:@controller/nova_cell0 || cell1 | c795b2eb-4814-4fe7-b9ff-090a1b1b2be5 | rabbit://openstack:@controller | mysql+pymysql://nova:****@controller/nova |+——-+————————————–+————————————+————————————————-+# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.serviceCompute节点:1、安装和配置:# yum install openstack-nova-compute# vi /etc/nova/nova.conf[DEFAULT]my_ip = 192.100.10.161enabled_apis = osapi_compute,metadatause_neutron = Truefirewall_driver = nova.virt.firewall.NoopFirewallDrivertransport_url = rabbit://openstack:123456@controller[api]auth_strategy = keystone[vnc]enabled = Trueserver_listen = 0.0.0.0server_proxyclient_address = $my_ipnovncproxy_base_url = http://controller:6080/vnc_auto.html[glance]api_servers = http://controller:9292[oslo_concurrency]lock_path = /var/lib/nova/tmp[placement]os_region_name = RegionOneproject_domain_name = Defaultproject_name = serviceauth_type = passworduser_domain_name = Defaultauth_url = http://controller:5000/v3username = placementpassword = 123456[keystone_authtoken]auth_url = http://controller:5000/v3memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = 1234562、完成安装:# systemctl enable libvirtd.service openstack-nova-compute.service# systemctl start libvirtd.service openstack-nova-compute.serviceController节点:1、将计算节点添加到cell数据库:$ . admin-openrc$ openstack compute service list –service nova-compute+—-+————–+———————–+——+———+——-+—————————-+| ID | Binary | Host | Zone | Status | State | Updated At |+—-+————–+———————–+——+———+——-+—————————-+| 9 | nova-compute | localhost.localdomain | nova | enabled | up | 2018-09-13T02:59:06.000000 |+—-+————–+———————–+——+———+——-+—————————-+2、发现计算主机:# su -s /bin/sh -c “nova-manage cell_v2 discover_hosts –verbose” nova/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) [‘use_tpool’] not supported exception.NotSupportedWarningFound 2 cell mappings.Skipping cell0 since it does not contain hosts.Getting computes from cell ‘cell1’: c795b2eb-4814-4fe7-b9ff-090a1b1b2be5Checking host mapping for compute host ’localhost.localdomain’: 58be78ad-5220-4869-ab31-33c9674ecfd1Creating host mapping for compute host ’localhost.localdomain’: 58be78ad-5220-4869-ab31-33c9674ecfd1Found 1 unmapped computes in cell: c795b2eb-4814-4fe7-b9ff-090a1b1b2be5注意:添加新计算节点时,必须在控制器节点上运行nova-manage cell_v2 discover_hosts以注册这些新计算节点。或者,您可以在 /etc/nova/nova.conf 中设置适当的间隔:[scheduler]discover_hosts_in_cells_interval = 3003、验证:$ . admin-openrc$ openstack compute service list+—-+——————+———————–+———-+———+——-+—————————-+| ID | Binary | Host | Zone | Status | State | Updated At |+—-+——————+———————–+———-+———+——-+—————————-+| 1 | nova-conductor | controller | internal | enabled | up | 2018-09-13T03:00:28.000000 || 3 | nova-consoleauth | controller | internal | enabled | up | 2018-09-13T03:00:29.000000 || 4 | nova-scheduler | controller | internal | enabled | up | 2018-09-13T03:00:29.000000 || 9 | nova-compute | localhost.localdomain | nova | enabled | up | 2018-09-13T03:00:26.000000 |+—-+——————+———————–+———-+———+——-+—————————-+$ openstack catalog list+———–+———–+—————————————–+| Name | Type | Endpoints |+———–+———–+—————————————–+| keystone | identity | RegionOne || | | public: http://controller:5000/v3/ || | | RegionOne || | | internal: http://controller:5000/v3/ || | | RegionOne || | | admin: http://controller:5000/v3/ || | | || nova | compute | RegionOne || | | public: http://controller:8774/v2.1 || | | RegionOne || | | internal: http://controller:8774/v2.1 || | | RegionOne || | | admin: http://controller:8774/v2.1 || | | || glance | image | RegionOne || | | internal: http://controller:9292 || | | RegionOne || | | admin: http://controller:9292 || | | RegionOne || | | public: http://controller:9292 || | | || placement | placement | RegionOne || | | internal: http://controller:8778 || | | RegionOne || | | public: http://controller:8778 || | | RegionOne || | | admin: http://controller:8778 || | | |+———–+———–+—————————————–+$ openstack image list+————————————–+——–+——–+| ID | Name | Status |+————————————–+——–+——–+| ad7da2d4-cb83-4a41-836f-e58e47e899f5 | cirros | active |+————————————–+——–+——–+# nova-status upgrade check/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) [‘use_tpool’] not supported exception.NotSupportedWarningOption “os_region_name” from group “placement” is deprecated. Use option “region-name” from group “placement”.+——————————-+| 升级检查结果 |+——————————-+| 检查: Cells v2 || 结果: 成功 || 详情: None |+——————————-+| 检查: Placement API || 结果: 成功 || 详情: None |+——————————-+| 检查: Resource Providers || 结果: 成功 || 详情: None |+——————————-+| 检查: Ironic Flavor Migration || 结果: 成功 || 详情: None |+——————————-+| 检查: API Service Version || 结果: 成功 || 详情: None |+——————————-+