解决Openstack windows创建虚拟机只显示两2个CPU
先创建一个虚拟机模板,然后再使用下面的命令;然后再dashboard中更新元数据。再用这个模板去创建新的虚拟机就可以了。
设置vm的cpu toplogy。 max limit类型的设置也可以通过image 属性来设置.
$ nova flavor-key FLAVOR-NAME set hw:cpu_sockets=FLAVOR-SOCKETS
$ nova flavor-key FLAVOR-NAME set hw:cpu_cores=FLAVOR-CORES
$ nova flavor-key FLAVOR-NAME set hw:cpu_threads=FLAVOR-THREADS
$ nova flavor-key FLAVOR-NAME set hw:cpu_max_sockets=FLAVOR-SOCKETS
$ nova flavor-key FLAVOR-NAME set hw:cpu_max_cores=FLAVOR-CORES
$ nova flavor-key FLAVOR-NAME set hw:cpu_max_threads=FLAVOR-THREADS
Where:
FLAVOR-SOCKETS—(Integer) The number of sockets for the guest VM. By this is set to the number of vCPUs requested.
FLAVOR-CORES—(Integer) The number of cores per socket for the guest VM. By this is set to 1.
FLAVOR-THREADS—(Integer) The number of threads per core for the guest VM. By this is set to 1.
![](https://img2020.cnblogs.com/blog/1606824/202106/1606824-20210601161826169-1552305221.png)
或者是使用在线扩容的方式