1、安装配置组件

yum install openstack-nova-compute -y

修改配置文件/etc/nova/nova.conf:

[DEFAULT]
# ...
enabled_apis = osapi_compute,metadata
my_ip = *** #改为自己的计算节点IP
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
transport_url = rabbit://openstack:RABBIT_PASS@controller

[api]
# ...
auth_strategy = keystone

[keystone_authtoken]
# ...
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = NOVA_PASS

[vnc]
# ...
enabled = true
server_listen = 0.0.0.0
server_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]
# ...
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = PLACEMENT_PASS

2、检测计算节点是否支持虚拟机硬件加速

egrep -c '(vmx|svm)' /proc/cpuinfo

如果此命令返回值不是0,则计算节点支持硬件加速,不需要加入下面的配置。 如果此命令返回值是0,则计算节点不支持硬件加速,并且必须配置libvirt为使用QEMU而不是KVM,需要编辑/etc/nova/nova.conf 文件中的[libvirt]部分: [libvirt] virt_type = qemu****

3、启动服务

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

4、验证
确定compute主机在单元数据库中

openstack compute service list --service nova-compute

OpenStack Train版操作笔记(6) --- nova计算服务安装及验证(计算节点上)

发现compute主机

su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

OpenStack Train版操作笔记(6) --- nova计算服务安装及验证(计算节点上)_第1张图片

添加新的计算节点时,必须在controller上执行nova-manage cell_v2 discover_hosts注册新的计算节点,也可以在/etc/nova/nova.conf配置适当的发现时间间隔:

[scheduler] 
discover_hosts_in_cells_interval = 300

systemctl restart openstack-nova-api.service #重启服务