nova组件-rescue/unrescue

来源:互联网 发布:酒店网络销售平台 编辑:程序博客网 时间:2024/06/05 18:49

rescue中文意思:营救,解救。

有时如果误操作,需要挽救数据,尝试恢复系统。

nova提供这种故障恢复机制,rescue用指定的image作为启动盘引导instance,将instance自身的系统盘作为第二个磁盘挂载到
操作系统上。

nova-api发送message到消息队列,nova-compute接收消息并执行操作。nova用刚刚部署instance时使用的image来rescue instance。

首先根据image创建新的引导盘,并命名为disk.rescue。rescue成功后使用virsh edit *.xml文件查看到原系统盘被挂载到上面。登录instance,使用fdisk -l 查看磁盘分区。

此时instance的状态是rescue,rescue操作让我们有机会修复损坏的操作系统,修复好了,使用unrescue命令从原系统盘重引导instance。

[root@controller log]# nova help rescue
usage: nova rescue [--password <password>] [--image <image>] <server>

Reboots a server into rescue mode, which starts the machine from either the
initial image or a specified image, attaching the current boot disk as
secondary.

Positional arguments:
  <server>               Name or ID of server.

Optional arguments:
  --password <password>  The admin password to be set in the rescue
                         environment.
  --image <image>        The image to rescue with.

0 0