部署nova-computer
1. 部署说明
部署地点: 计算节点(ip:192.168.0.184)。
2. 安装nova-computer
yum install -y openstack-nova-compute
3. 配置nova-computer
cp /etc/nova/nova.conf /etc/nova/nova.conf.bac
请根据实际情况自行修改my_ip的值。
crudini --set /etc/nova/nova.conf DEFAULT my_ip 192.168.0.184
crudini --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
请根据实际情况自行修改rabbitmq对应服务的ip。
crudini --set /etc/nova/nova.conf DEFAULT transport_url rabbit://guest:loongson@192.168.0.142:5672
crudini --set /etc/nova/nova.conf DEFAULT compute_driver libvirt.LibvirtDriver
crudini --set /etc/nova/nova.conf DEFAULT instances_path /var/lib/nova/instances
crudini --set /etc/nova/nova.conf DEFAULT host computer
crudini --set /etc/nova/nova.conf api auth_strategy keystone
crudini --set /etc/nova/nova.conf keystone_authtoken www_authenticate_uri http://controller:5000
crudini --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:5000
crudini --set /etc/nova/nova.conf keystone_authtoken memcached_servers controller:11211
crudini --set /etc/nova/nova.conf keystone_authtoken auth_type password
crudini --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
crudini --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
crudini --set /etc/nova/nova.conf keystone_authtoken project_name service
crudini --set /etc/nova/nova.conf keystone_authtoken username nova
crudini --set /etc/nova/nova.conf keystone_authtoken password loongson
crudini --set /etc/nova/nova.conf vnc enabled true
crudini --set /etc/nova/nova.conf vnc server_listen 0.0.0.0
crudini --set /etc/nova/nova.conf vnc server_proxyclient_address 192.168.0.184
crudini --set /etc/nova/nova.conf vnc novncproxy_base_url http://controller:6080/vnc_auto.html
crudini --set /etc/nova/nova.conf glance api_servers http://controller:9292
crudini --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
crudini --set /etc/nova/nova.conf placement region_name RegionOne
crudini --set /etc/nova/nova.conf placement project_domain_name default
crudini --set /etc/nova/nova.conf placement project_name service
crudini --set /etc/nova/nova.conf placement auth_type password
crudini --set /etc/nova/nova.conf placement user_domain_name default
crudini --set /etc/nova/nova.conf placement auth_url http://controller:5000/v3
crudini --set /etc/nova/nova.conf placement username placement
crudini --set /etc/nova/nova.conf placement password loongson
crudini --set /etc/nova/nova.conf libvirt virt_type kvm
crudini --set /etc/nova/nova.conf libvirt use_virtio_for_bridges true
如果需要通过iso起虚拟机,需要设置images_type = raw,默认是qcow2。
#crudini --set /etc/nova/nova.conf libvirt images_type raw
crudini --set /etc/nova/nova.conf neutron url http://controller:9696
crudini --set /etc/nova/nova.conf neutron auth_url http://controller:5000
crudini --set /etc/nova/nova.conf neutron auth_type password
crudini --set /etc/nova/nova.conf neutron project_domain_name default
crudini --set /etc/nova/nova.conf neutron user_domain_name default
crudini --set /etc/nova/nova.conf neutron region_name RegionOne
crudini --set /etc/nova/nova.conf neutron project_name service
crudini --set /etc/nova/nova.conf neutron username neutron
crudini --set /etc/nova/nova.conf neutron password loongson
查看并核实已经修改的配置是否存在问题。
egrep -v "^#|^$" /etc/nova/nova.conf
输出信息:
#tee /etc/nova/nova.conf <<-'EOF'
#[DEFAULT]
#my_ip = 192.168.0.184
#enabled_apis = osapi_compute,metadata
#transport_url = rabbit://guest:loongson@192.168.0.142:5672
#
#[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 = loongson
#
#[vnc]
#enabled = true
#server_listen = 0.0.0.0
#server_proxyclient_address = 192.168.0.184
#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 = loongson
#
#
#[libvirt]
#virt_type = kvm
#use_virtio_for_bridges = true
#
#[neutron]
#url = http://controller:9696
#auth_url = http://controller:5000
#auth_type = password
#project_domain_name = default
#user_domain_name = default
#region_name = RegionOne
#project_name = service
#username = neutron
#password = loongson
#EOF
4. 安装dmidecode
yum install -y dmidecode
5. 安装虚拟化相关组件
yum install virt-manager libvirt -y
6. 启动计算服务并配置为开机自启
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service
7. 将计算节点添加到cell数据库中(在控制节点中执行)
以下两个命令在控制节点执行。
openstack compute service list --service nova-compute
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova