O043、计算节点宕机了怎么办


参考https://www.cnblogs.com/CloudMan6/p/5562131.html   Rebuild 可以恢复损坏的instance 。那如果是宿主机坏了怎么办呢?比如硬件故障或者断电造成整台计算机节点无法工作,该节点上运行的instance如何恢复呢?   用shelve或者Migrate可不可以?很不幸,这两个操作都要求instance 所在的计算节点的 nova-compute服务正常运行。幸运的是,还有 Evacuate   Evacuate 可在 nova-compute 无法工作的情况下将节点上的instance 迁移到其他计算节点上,但有个前提:instance的镜像文件必须放在共享存储上   我们可以通过断电模拟计算节点故障,然后执行Evacuate 操作恢复 instance。目前Evacuate只能通过CLI 执行。   stack@DevStack-Controller:~$ nova help evacuate usage: nova evacuate [--password ] [--force] []   Evacuate server from failed host.   Positional arguments:                  Name or ID of server.                    Name or ID of the target host. If no host is                          specified, the scheduler will choose one.   Optional arguments:   --password   Set the provided admin password on the evacuated                          server. Not applicable if the server is on shared                          storage.   --force                Force to not verify the scheduler if a host is                          provided. (Supported by API versions '2.29' -                          '2.latest')   其实 Evacuate 是通过rebuild 操作实现的,因为Evacuate 是用共享存储上的instance的镜像文件重新创建虚机   1、先是 nova-scheduler 选择新的计算节点 2、nova-compute 在计算节点上执行rebuild操作    

相关