有时虚拟机创建后发现虚拟机规格太小,满足不了业务需求。于是需要在线拉伸虚拟机的规格。

修改controller和各个computer节点的nova.cnf文件,打开下面两个参数
[root@control ~]# vim /etc/nova/nova.conf
[root@node ~]# vim /etc/nova/nova.conf

allow_resize_to_same_host=True
scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter

重启服务
[root@control ~]# systemctl restart openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service

[root@node ~]# systemctl restart libvirtd.service openstack-nova-compute.service