您的位置:首页 > 其它

计算节点宕机后,vm的迁移方法

2017-09-13 16:09 239 查看
当计算节点异常断电或者发生故障后,导致计算节点无法正常工作,这时该计算节点上面的vm如何迁移到别的可用计算节点上呢?

由于宕机的计算节点上面的nova-compute服务已经down了,所以shelve和migrate操作无法运行,会报错。

nova中提供了Evacuate命令,该命令可以将vm从宕机或者故障的计算节点上面迁移到可用的计算节点上,并在新的计算节点上rebuild该vm。

该命令只能在命令行操作,并且前提是宕机的节点和可用的节点间有共享存储。

[root@01 ~]# nova help evacuate

usage: nova evacuate [--password <password>] [--force] <server> [<host>]

Evacuate server from failed host.

Positional arguments:

  <server>               Name or ID of server.

  <host>                 Name or ID of the target host. If no host is

                         specified, the scheduler will choose one.

Optional arguments:

  --password <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')

[root@01 ~]# openstack server list

+----------------------+----------------------+---------+----------------------+------------------------+

| ID                   | Name                 | Status  | Networks             | Image Name             |

+----------------------+----------------------+---------+----------------------+------------------------+

| 07ff8391-47d4-4304-8 | demo                 | SHUTOFF | private63=10.0.0.6 |     |

| b76-6db5bd65a8c0     |                      |         |                    |       

[root@01 ~]# nova evacuate demo

到界面上面可以看到该vm已经迁移到可用的计算节点上,并正常运转了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: