OpenStack Xena CentOS 8 Stream
我的任务是将 vCPU 从 16 个增加到 32 个。我尝试过量使用,但不起作用。
我有一个控制器和一个计算。计算输出:
[root@controller ~(keystone)]# openstack hypervisor stats show
+----------------------+-------+
| field | value |
+----------------------+-------+
| count | 1 |
| current_workload | 0 |
| disk_available_least | 62 |
| free_disk_gb | 69 |
| free_ram_mb | 31326 |
| local_gb | 69 |
| local_gb_used | 0 |
| memory_mb | 31838 |
| memory_mb_used | 512 |
| running_vms | 0 |
| vcpus | 16 |
| vcpus_used | 0 |
+----------------------+-------+
默认情况下,在 /etc/nova/nova.conf 中计算:
# Virtual CPU to physical CPU allocation ratio. For more information, refer to
# the documentation. (floating point value)
# Minimum value: 0.0
#cpu_allocation_ratio=<None>
我这样做了:cpu_allocation_ratio=2.0
,然后systemctl restart openstack-nova-compute
。之后我openstack hypervisor stats show
再次执行此操作,发现仍有 16 个 vCPU 可用。
/etc/nova/nova.conf 还有一个选项:
#
# Initial virtual CPU to physical CPU allocation ratio. For more information,
# refer to the documentation. (floating point value)
# Minimum value: 0.0
#initial_cpu_allocation_ratio=16.0
我尝试设置initial_cpu_allocation_ratio=32.0
,但也没有帮助。
此外,我发现只有关于过度承诺的此类文档https://docs.openstack.org/arch-design/design-compute/design-compute-overcommit.html,但没有说明如何正确配置。
答案1
检查分配比例:
openstack resource provider inventory list 4f35070b-df79-41d1-88e0-831e5f210497
+----------------+------------------+----------+----------+----------+-----------+--------+--------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total | used |
+----------------+------------------+----------+----------+----------+-----------+--------+--------+
| VCPU | 2.08 | 1 | 112 | 0 | 1 | 112 | 222 |
| MEMORY_MB | 1.18 | 1 | 515164 | 8192 | 1 | 515164 | 395264 |
| DISK_GB | 0.98 | 1 | 7150 | 0 | 1 | 7150 | 2985 |
+----------------+------------------+----------+----------+----------+-----------+--------+--------+
如果需要获取计算值:
openstack allocation candidate list --resource MEMORY_MB=1 -f json -c "inventory used/capacity" -c "resource provider"
[
{
"resource provider": "4f35070b-df79-41d1-88e0-831e5f210497",
"inventory used/capacity": "VCPU=222/232,MEMORY_MB=395264/598226,DISK_GB=2985/7007"
}
]