前提:
1. 后端存储采用网络存储
具体操作:
1. 确保实例的状态处于【关机】
# 使用nova库
use nova;
# 查询实例信息
select host,node,uuid,power_state,vm_state,task_state from instances where uuid='291b14f8-2b24-42bb-a89e-137a8452f4d0';
# 更新实例状态信息
update instances set task_state=NULL where uuid='291b14f8-2b24-42bb-a89e-137a8452f4d0';
update instances set power_state=4,vm_state='stopped' where uuid='291b14f8-2b24-42bb-a89e-137a8452f4d0';
2. 改变虚拟机指向的物理机【启动到新的物理机】
# 使用nova库
use nova;
# 查询实例信息
select host,node,uuid from instances where uuid='291b14f8-2b24-42bb-a89e-137a8452f4d0';
# 更新实例信息
update instances set host='6-compute-ceph',node='6-compute-ceph' where uuid='291b14f8-2b24-42bb-a89e-137a8452f4d0';
3. 重启新物理机的nova服务
systemctl restart openstack-nova-compute.service
4. 启动虚拟机即可