nova控制节点

yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy \
openstack-nova-scheduler openstack-nova-placement-api -y

mysql -uroot -ppassword -e "CREATE DATABASE nova_api;"
mysql -uroot -ppassword -e "CREATE DATABASE nova;"
mysql -uroot -ppassword -e "CREATE DATABASE nova_cell0;"

mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON nova_api. TO 'nova'@'localhost' IDENTIFIED BY 'password'"
mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON nova_api.
TO 'nova'@'%' IDENTIFIED BY 'password'"
mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON nova. TO 'nova'@'localhost' IDENTIFIED BY 'password'"
mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON nova.
TO 'nova'@'%' IDENTIFIED BY 'password'"
mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON nova_cell0. TO 'nova'@'%' IDENTIFIED BY 'password'"
mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON nova_cell0.
TO 'nova'@'localhost' IDENTIFIED BY 'password'"

source admin-openrc
openstack user create --domain default --password password nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
openstack user create --domain default --password password 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 internal http://controller:8778
openstack endpoint create --region RegionOne placement admin http://controller:8778

Edit the /etc/nova/nova.conf file
openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:password@controller/nova_api
openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:password@controller/nova
openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:password@controller

openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:5000/v3
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password password

openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.137.36
openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron True
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver

openstack-config --set /etc/nova/nova.conf vnc enabled true
openstack-config --set /etc/nova/nova.conf vnc server_listen 192.168.137.36
openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address 192.168.137.36
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip

openstack-config --set /etc/nova/nova.conf glance api_servers http://controller:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

openstack-config --set /etc/nova/nova.conf placement os_region_name RegionOne
openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set /etc/nova/nova.conf placement project_name service
openstack-config --set /etc/nova/nova.conf placement auth_type password
openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
openstack-config --set /etc/nova/nova.conf placement auth_url http://controller:5000/v3
openstack-config --set /etc/nova/nova.conf placement username placement
openstack-config --set /etc/nova/nova.conf placement password password

vim /etc/httpd/conf.d/00-nova-placement-api.conf

= 2.4>
Require all granted


Order allow,deny
Allow from all

systemctl restart httpd
systemctl status 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

[root@controller ~]# nova-manage cell_v2 list_cells
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
exception.NotSupportedWarning
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
| Name | UUID | Transport URL | Database Connection |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
| cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysql+pymysql://nova:@controller/nova_cell0 |
| cell1 | 17dd9af1-eee9-4bd5-9bae-1760be449ca0 | rabbit://openstack:
@controller | mysql+pymysql://nova:****@controller/nova |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+

mysql - -uroot ppassword -e "use nova;show tables;"
mysql -uroot -ppassword -e "use nova_cell0;show tables;"
mysql -uroot -ppassword -e "use nova_api;show tables;"

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.service
systemctl status openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

[root@controller ~]# source admin-openrc
[root@controller ~]# openstack service list
+----------------------------------+-----------+-----------+
| ID | Name | Type |
+----------------------------------+-----------+-----------+
| 089500f49e694d3787101692f7d4f882 | neutron | network |
| 129b4d7aa770473a8e872db493f71a53 | placement | placement |
| 356b9ccccebc46539fd029a6d1117dc1 | keystone | identity |
| 5e19c220d82e4ddd8614e3c7bfb84a92 | nova | compute |
| bfdee34873b14a448714e6b1ebf8cc70 | glance | image |
+----------------------------------+-----------+-----------+

[root@controller ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| 2317ef20053d4229abe55ee2d841e329 | RegionOne | nova | compute | True | internal | http://controller:8774/v2.1 |
| 23cd3057872846f4abb4870bc0f4dde6 | RegionOne | placement | placement | True | internal | http://controller:8778 |
| 50410e6dcbd14236bb5b9066173c1e58 | RegionOne | glance | image | True | internal | http://controller:9292 |
| 5596feabb38f4a2fac9e0eeda4fa3992 | RegionOne | placement | placement | True | public | http://controller:8778 |
| 6f1ba696fef5401aa14ef3b137264ee8 | RegionOne | keystone | identity | True | admin | http://controller:5000/v3/ |
| 7aeeba4768594fecb0651dca6e98e118 | RegionOne | glance | image | True | admin | http://controller:9292 |
| 865ef7c6dc0b4e838b97456e2fd2968e | RegionOne | placement | placement | True | admin | http://controller:8778 |
| 960c5c7a5b724b1a94e87d8944766315 | RegionOne | keystone | identity | True | public | http://controller:5000/v3/ |
| 9be08bc7e514474b9ccf9c879390da75 | RegionOne | keystone | identity | True | internal | http://controller:5000/v3/ |
| a568fa06aea54c798a3d09e40ec14819 | RegionOne | nova | compute | True | admin | http://controller:8774/v2.1 |
| ab9cb46bf4214a5aba45a367d9a5d701 | RegionOne | neutron | network | True | internal | http://controller:9696 |
| b87dd3535522471da09ab99123bd9b92 | RegionOne | neutron | network | True | admin | http://controller:9696 |
| c1ec8b16306b4e6b836f96898849e11e | RegionOne | nova | compute | True | public | http://controller:8774/v2.1 |
| c2a16798b4da42ed8a0d75211412add7 | RegionOne | neutron | network | True | public | http://controller:9696 |
| c76ee0b80fc849569e7fb0ae63783bb1 | RegionOne | glance | image | True | public | http://controller:9292 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+

安装nova计算节点
Nova compute

yum install openstack-nova-compute -y
报错:
Error: Package: 1:openstack-nova-compute-17.0.5-1.el7.noarch (centos-openstack-queens)
Requires: qemu-kvm-rhev >= 2.9.0

[root@compute yum.repos.d]# cat CentOS-QEMU-EV.repo
[centos-qemu-ev]
name=CentOS-$releasever - QEMU EV
baseurl=https://mirrors.aliyun.com/centos/7.5.1804/virt/x86_64/kvm-common/
gpgcheck=0
enabled=1

阿里云CentOS7.5镜像qemu-kvm-rhev:qemu-kvm-ev-2.10.0-21.el7_5.4.1.x86_64.rpm

Edit the /etc/nova/nova.conf file
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:password@controller
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:35357
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers controller:11211

[root@compute yum.repos.d]#
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name default
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name default
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf keystone_authtoken password password
[root@compute yum.repos.d]#
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.137.37
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron True
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf vnc enabled True
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf vnc vncserver_listen 0.0.0.0
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address 192.168.137.37
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://controller:6080/vnc_auto.html
[root@compute yum.repos.d]#
[root@compute yum.repos.d]#
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf glance api_servers http://controller:9292
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement os_region_name RegionOne
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement project_name service
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement auth_type password
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement auth_url http://controller:35357/v3
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement username placement
[root@compute yum.repos.d]# openstack-config --set /etc/nova/nova.conf placement password password

[root@compute ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
0
[root@compute ~]# vim /etc/nova/nova.conf
#virt_type=kvm
修改为
virt_type=qemu

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service

2018-08-02 23:29:56.023 103044 ERROR nova MessageDeliveryFailure: Unable to connect to AMQP server on controller:5672 after None tries: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
2018-08-02 23:29:56.023 103044 ERROR nova

在控制节点上发现计算节点
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 6fabdd0a-0131-4780-9119-e3a95ccaa4ed
Checking host mapping for compute host 'compute': 9772c857-23a8-4388-a1ea-e9a18387d523
Creating host mapping for compute host 'compute': 9772c857-23a8-4388-a1ea-e9a18387d523
Found 1 unmapped computes in cell: 6fabdd0a-0131-4780-9119-e3a95ccaa4ed
1

列出身份服务中的API端点以验证与身份服务的连接:
[root@controller ~]# openstack catalog list

验证有几个计算节点在数据库中
[root@controller ~]# openstack compute service list --service nova-compute

安装OpenStack QUEENS版本四:nova_第1张图片

安装OpenStack QUEENS版本四:nova_第2张图片