由于官方文档没有对该部分进行相应的解释,故创建过程会出现相应的问题,具体的安装步骤如下:
1)控制结点
mysql -u root -p
CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;
GRANT ALL PRIVILEGES ON nova_api.* TO'nova'@'localhost' \
IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_api.* TO'nova'@'%' \
IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova.* TO'nova'@'localhost' \
IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova.* TO'nova'@'%' \
IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_cell0.* TO'nova'@'localhost' \
IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_cell0.* TO'nova'@'%' \
IDENTIFIED BY 'nova';
备注: 如果需要的情况下,需要创建placement对应的数据库,并赋予相应的权限
创建相应的服务以及API
控制结点:
创建Nova相关的(参照官方文档)
openstack user create --domain default--password-prompt nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --regionRegionOne compute public http://controller:8774/v2.1
openstack endpoint create --regionRegionOne compute internal http://controller:8774/v2.1
openstack endpoint create --regionRegionOne compute admin http://controller:8774/v2.1
创建placement相关的
openstack user create --domain default--password-prompt placement
openstack role add --project service --user placement admin
openstack service create --name placement--description "Placement API" placement
openstack endpoint create --region RegionOne placement public http://controller:8778
openstack endpoint create --region RegionOne placement admin http://controller:8778
openstack endpoint create --region RegionOne placement internal http://controller:8778
控制结点修改nova配置文件(etc/nova/nova.conf)
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url =rabbit://openstack:openstack@controller
#本机IP地址
my_ip = 192.168.215.100
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
connection =mysql+pymysql://nova:nova@controller/nova_api
[database]
connection =mysql+pymysql://nova:nova@controller/nova
[api]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[vnc]
enabled = true
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = placement
修改Placement API的访问权限
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>
同步数据库:
控制结点
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
查看cell_v2所生成的UUID
nova-manage cell_v2 list_cells
启动相应的服务
systemctl enable openstack-nova-api.service\
openstack-nova-consoleauth.serviceopenstack-nova-scheduler.service \
openstack-nova-conductor.serviceopenstack-nova-novncproxy.service
systemctl restartopenstack-nova-api.service \
openstack-nova-consoleauth.serviceopenstack-nova-scheduler.service \
openstack-nova-conductor.serviceopenstack-nova-novncproxy.service
配置相应的计算结点
编辑nova 配置文件
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url =rabbit://openstack:openstack@controller
use_neutron = True
firewall_driver =nova.virt.firewall.NoopFirewallDriver
#本机IP地址
my_ip = 192.168.215.101
[api]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_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 = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = placement
[libvirt]
virt_type = qemu
启动计算结点上相应的服务
systemctl enable libvirtd.serviceopenstack-nova-compute.service
systemctl restart libvirtd.serviceopenstack-nova-compute.service