当前位置: 代码迷 >> 综合 >> 如何拯救“rescue”一个虚机!
  详细解决方案

如何拯救“rescue”一个虚机!

热度:32   发布时间:2023-12-22 01:42:42.0

总的来说就是:To "resurrect" a instance on an other host you have to set it to state  "shutdown" in the database, change host value in database, define the instance in new hypervisor and start it. 


第一步:在数据库中,将虚机的状态设置为“shutdown”

Try to have a look at a database-entries of an instance which you stopped with "nova stop {instance-name}" and adjust necessary columns in the entry of the instance to be resurrected. Look for table instances in  nova db. Then set the instance to be resurrected to the same state as the stopped instance.


第二步:修改虚机的instance表中的host属性

-Next change the host value in database of this instance to an available host. 


第三步:(如果不使用共享存储)将虚机的相关文件copy到新的主机上

Copy over the instance-files to the new host if you are not using shared storage or whatever...


第四步:在新的host上执行virsh define命令

Take action to define your instance in hypervisor. How to do this depends on what type of hypervisor you are using. 


第五步:在新的主机上执行 nova start ****

-Now you should be able to start your instance on the new host via "nova start {instance-name}". 


参考链接:http://www.gossamer-threads.com/lists/openstack/dev/20950