Nova计算节点
该服务支持多个虚拟机管理程序来部署实例或虚拟机 (VM)。为简单起见,此配置在支持虚拟机硬件加速的计算节点上使用具有基于内核的 VM (KVM) 扩展的快速模拟器 (QEMU) 虚拟机管理程序。
安装配置组件
安装软件
# apt install nova-compute
编辑文件并完成以下操作:/etc/nova/nova.conf
[DEFAULT]
# ...
transport_url = rabbit://openstack:rabbit123@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 = nova123
[DEFAULT]
# ...
my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
# 替换为计算节点上管理网络接口的 IP 地址
[vnc]
# ...
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
# 服务器组件侦听所有 IP 地址,代理组件仅侦听计算节点的管理接口 IP 地址。基本 URL 指示可以使用 Web 浏览器访问此计算节点上实例的远程控制台的位置。
[glance]
# ...
api_servers = http://controller:9292
[oslo_concurrency]
# ...
lock_path = /var/lib/nova/tmp
# 配置展示位置 API:[placement]
[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 = placement123
完成安装
确定计算节点是否支持虚拟机的硬件加速:
# egrep -c '(vmx|svm)' /proc/cpuinfo
192
编辑文件中的部分,如下所示:[libvirt]``/etc/nova/nova-compute.conf
[libvirt]
# ...
virt_type = kvm
重新启动计算服务:
# service nova-compute restart && systemctl enable nova-compute
将计算节点添加到单元数据库
在控制器节点上运行以下命令。
获取管理员凭据以启用仅限管理员的 CLI 命令,然后确认数据库中存在计算主机:
# . admin-openrc
# openstack compute service list --service nova-compute
+--------------------------------------+--------------+----------+------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+--------------------------------------+--------------+----------+------+---------+-------+----------------------------+
| 77ae7624-aa05-4f46-96a8-a28b46d40ae4 | nova-compute | node-001 | nova | enabled | up | 2022-04-24T03:47:22.000000 |
+--------------------------------------+--------------+----------+------+---------+-------+----------------------------+
发现计算主机:
# 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': 83767777-d3ea-4231-ab6d-d0c4f42ab059
Checking host mapping for compute host 'node-001': 8100723b-ab35-4e7d-88fa-e8809425f273
Creating host mapping for compute host 'node-001': 9100723b-ab35-4e7d-88fa-e8809425f273
Found 1 unmapped computes in cell: 93767777-d3ea-4231-ab6d-d0c4f42ab059
添加新的计算节点时,必须在控制器节点上运行以注册这些新的计算节点。或者,您可以在 中设置适当的间隔:nova-manage cell_v2 discover_hosts``/etc/nova/nova.conf
[scheduler]
discover_hosts_in_cells_interval = 300
验证操作
# . admin-openrc
列出服务组件以验证每个进程是否成功启动和注册:
# openstack compute service list
+--------------------------------------+----------------+----------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+--------------------------------------+----------------+----------+----------+---------+-------+----------------------------+
| 10bae54a-bd1e-456e-a016-88bc05539ccb | nova-scheduler | nova-001 | internal | enabled | up | 2022-04-24T03:49:33.000000 |
| 1hb924b34-895a-4057-a9ca-196f47e7128f | nova-conductor | nova-001 | internal | enabled | up | 2022-04-24T03:49:30.000000 |
| I7ae7624-aa05-4f46-96a8-a28b46d40ae4 | nova-compute | nova-001 | nova | enabled | up | 2022-04-24T03:49:34.000000 |
+--------------------------------------+----------------+----------+----------+---------+-------+----------------------------+