四:同步Nova数据库并启动其服务
[email protected]:~(keystone)# su -s /bin/bash placement -c "placement-manage db sync"
[email protected]:~(keystone)# su -s /bin/bash nova -c "nova-manage api_db sync"
[email protected]:~(keystone)# su -s /bin/bash nova -c "nova-manage cell_v2 map_cell0"
[email protected]:~(keystone)# su -s /bin/bash nova -c "nova-manage db sync"
[email protected]:~(keystone)# su -s /bin/bash nova -c "nova-manage cell_v2 create_cell --name cell1"
[email protected]:~(keystone)# systemctl restart nova-api nova-conductor nova-scheduler nova-novncproxy
[email protected]:~(keystone)# systemctl enable nova-api nova-conductor nova-scheduler nova-novncproxy
[email protected]:~(keystone)# systemctl restart apache2 nginx
[email protected]:~(keystone)# openstack compute service list
+-----------------+----------------+------------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+-----------------+----------------+------------------+----------+---------+-------+----------------------------+
| b491bb4d-...... | nova-conductor | srv1.1000y.cloud | internal | enabled | up | 2022-10-24T09:16:32.000000 |
| ea5192b7-...... | nova-scheduler | srv1.1000y.cloud | internal | enabled | up | 2022-10-24T09:16:29.000000 |
+-----------------+----------------+------------------+----------+---------+-------+----------------------------+
五:实现Nova-compute
1) 安装Nova-Compute
[email protected]:~(keystone)# apt install qemu-kvm libvirt-daemon-system libvirt-daemon virtinst bridge-utils libosinfo-bin nova-compute nova-compute-kvm -y
2) 配置VNC(便于后续直接通过浏览器控制实例)
[email protected]:~(keystone)# vim /etc/nova/nova.conf
......
......
......
......
......
......
# 找到 [VNC] 区段,添加如下内容
[vnc]
enabled = True
server_listen = srv1.1000y.cloud
server_proxyclient_address = srv1.1000y.cloud
novncproxy_host = 127.0.0.1
novncproxy_port = 6080
novncproxy_base_url = https://srv1.1000y.cloud:6080/vnc_auto.html
......
......
......
......
......
......
[email protected]:~(keystone)# systemctl restart nova-compute
[email protected]:~(keystone)# su -s /bin/bash nova -c "nova-manage cell_v2 discover_hosts"
[email protected]:~(keystone)# openstack compute service list
+-----------------+----------------+------------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+-----------------+----------------+------------------+----------+---------+-------+----------------------------+
| b491bb4d-...... | nova-conductor | srv1.1000y.cloud | internal | enabled | up | 2022-10-24T09:21:22.000000 |
| ea5192b7-...... | nova-scheduler | srv1.1000y.cloud | internal | enabled | up | 2022-10-24T09:21:19.000000 |
| 943af590-...... | nova-compute | srv1.1000y.cloud | nova | enabled | up | 2022-10-24T09:21:23.000000 |
+-----------------+----------------+------------------+----------+---------+-------+----------------------------+
六:扩展NovaCompute节点
1) 准备第2台节点: 8G 4core
2) 在扩展的计算节点上安装KVM并启动
[email protected]:~# apt install qemu-kvm libvirt-daemon-system libvirt-daemon virtinst
bridge-utils libosinfo-bin -y
[email protected]:~# lsmod | grep kvm
kvm_intel 372736 0
kvm 1028096 1 kvm_intel
3) 安装Nova-Compute
[email protected]:~# apt install software-properties-common -y
[email protected]:~# add-apt-repository cloud-archive:zed
Repository: 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu jammy-updates/zed main'
Description:
Ubuntu Cloud Archive for OpenStack Zed
More info: https://wiki.ubuntu.com/OpenStack/CloudArchive
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel. # 回车
......
......
......
......
......
......
Reading package lists... Done
[email protected]:~# apt update && apt upgrade -y
[email protected]:~# apt install nova-compute nova-compute-kvm qemu-system-data -y
4) 配置Nova Compute
[email protected]:~# mv /etc/nova/nova.conf /etc/nova/nova.conf.bak
[email protected]:~# vim /etc/nova/nova.conf
[DEFAULT]
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
transport_url = rabbit://openstack:[email protected]
[api]
auth_strategy = keystone
[vnc]
enabled = True
server_listen = srv2.1000y.cloud
server_proxyclient_address = srv2.1000y.cloud
novncproxy_base_url = https://srv1.1000y.cloud:6080/vnc_auto.html
[glance]
api_servers = https://srv1.1000y.cloud:9292
# 自定义证书需要值为 true
insecure = true
[oslo_concurrency]
lock_path = $state_path/tmp
[keystone_authtoken]
www_authenticate_uri = https://srv1.1000y.cloud:5000
auth_url = https://srv1.1000y.cloud:5000
memcached_servers = srv1.1000y.cloud:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = servicepassword
# 自定义证书需要值为 true
insecure = true
[placement]
auth_url = https://srv1.1000y.cloud:5000
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = placement
password = servicepassword
# 自定义证书需要值为 true
insecure = true
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
[email protected]:~# chmod 640 /etc/nova/nova.conf
[email protected]:~# chgrp nova /etc/nova/nova.conf
5) 启动Nova Compute
[email protected]:~# systemctl restart nova-compute
6) 确认
# 于srv1节点上添加扩展计算节点
[email protected]:~(keystone)# su -s /bin/bash nova -c "nova-manage cell_v2 discover_hosts"
[email protected]:~(keystone)# openstack compute service list
+--------------------------------------+----------------+------------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+--------------------------------------+----------------+------------------+----------+---------+-------+----------------------------+
| b491bb4d-85e7-4e6e-a9b6-5aa0955ec2cb | nova-conductor | srv1.1000y.cloud | internal | enabled | up | 2022-10-24T09:38:32.000000 |
| ea5192b7-901f-4d94-bf91-db82e5b86ea1 | nova-scheduler | srv1.1000y.cloud | internal | enabled | up | 2022-10-24T09:38:29.000000 |
| 943af590-28ed-4db7-9bba-ce51971e8be6 | nova-compute | srv1.1000y.cloud | nova | enabled | up | 2022-10-24T09:38:34.000000 |
| 98d5d4d9-d0ec-4cbd-b7f1-d5b724d94a77 | nova-compute | srv2.1000y.cloud | nova | enabled | up | 2022-10-24T09:38:36.000000 |
+--------------------------------------+----------------+------------------+----------+---------+-------+----------------------------+