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.

A rescue is normally performed when something goes wrong with the
primary images and data needs to be corrected/recovered. Rescuing
should not edit or over-ride the original image, only allow for
data recovery.

不能rescue 一个 volume-backed instance

compute manager中def rescue_instance 不用再check password了

rescue_image_ref哪儿来?

Rescue 是个很有意思的功能。它的一个使用场景是,虚机的启动盘的一个文件被误删除了导致无法再次启动了,或者 admin 的密码忘记了。Rescue 功能提供一个解决这类问题的手段。

执行 nova rescue 命令后的主要过程是:

(1)保存目前domain 的 xml 配置到 unrescue.xml 文件

(2)根据 image 重新生成启动盘 disk.swap (大小不受 falvor.root_disk_size 控制,尽可能小的一个文件)

root@compute2:/var/lib/nova/instances/8352e969-0a25-4abf-978f-d9d0ec4de0cd# qemu-img info disk.rescue
image: disk.rescue
file format: qcow2
virtual size: 39M (41126400 bytes) #不是 falovr 里面定义的 1G 大小
disk size: 1.6M
cluster_size: 65536
backing file: /var/lib/nova/instances/_base/fbad3d96a1727069346073e51d5bbb1824e76e34
Format specific information:
compat: 1.1
lazy refcounts: false
        rescue_images = {
'image_id': (rescue_image_id or
CONF.libvirt.rescue_image_id or instance.image_ref),
'kernel_id': (CONF.libvirt.rescue_kernel_id or
instance.kernel_id),
'ramdisk_id': (CONF.libvirt.rescue_ramdisk_id or
instance.ramdisk_id),
}

(3)构造一个新的 domain 的 xml 配置,使用 disk.rescue 做启动盘,将原来的 disk 挂载到该 domain,其他的盘和volume不会被挂载。

   <disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="none"/>
<source file="/var/lib/nova/instances/8352e969-0a25-4abf-978f-d9d0ec4de0cd/disk.rescue"/> #新构造的启动盘
<target bus="virtio" dev="vda"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="none"/>
<source file="/var/lib/nova/instances/8352e969-0a25-4abf-978f-d9d0ec4de0cd/disk"/> #原来的启动盘
<target bus="virtio" dev="vdb"/>
</disk>

(4)将原来的 domain destroy 掉 (virt_dom.destroy)

(5)定义新的 domain (conn.defineXML(xml))

(6)启动新的 domain (domain.createWithFlags)

至此,nova rescue 的过程完成。用户可以 ssh 到新的虚机,修改 “Vdb“分区中的受损害的文件。然后执行 ”nova unrescue“命令。其主要过程是:

(1)读取之前保存的 unrescue.xml 文件

(2)将 rescued domain destroy 掉

(3)定义和启动新的domain(同上面5和6)

(4)删除 unrescue.xml 文件

注意,这时候文件夹中的 libvirt.xml 文件和新运行的 domain 的 xml 不一致,因为代码中没有将新的 domain 的xml 写到该文件。

http://www.cnblogs.com/sammyliu/p/4571209.html

nova Rescue 和 Unrescue的更多相关文章

  1. ironic rescue standard rescue and unrescue process

    翻译官网救援/取消救援标准流程 1.用户在节点上调用Nova rescue 2.Nova ComputeManager调用virt驱动程序的rescue()方法,传入rescue_password作为 ...

  2. O035、Nova Suspend / Rescue 操作详解

    参考https://www.cnblogs.com/CloudMan6/p/5503501.html   Suspend / Resume   有时候需要长时间暂停 instance , 可以通过 S ...

  3. ironic baremetal node rescue/unrescue mode

    环境ironic-api ironic-conductor,ironicclient均升级为Queens版本 官网说明API版本为1.38才支持rescue/unrescue,所以修改下openrc文 ...

  4. Nova 操作汇总(限 libvirt 虚机) [Nova Operations Summary]

    本文梳理一下 Nova 主要操作的流程. 0. Nova REST-CLI-Horizon 操作对照表 Nova 基本的 CRUD 操作和 extensions: # 类别 Nova V2 REST ...

  5. openstack虚拟机rescue模式

    nova rescue vm_instance es.ops 20190426 linux虚拟机在出现类似kernel panic后,根据panic信息以及故障前的操作,定位问题的发生点,进行修复 n ...

  6. openstack常用命令-nova篇

    1.查看openstack版本 nova-manage version 2.查看节点 nova host-list 3.查看计算节点 nova hypervisor-list 4.查看计算节点上有哪些 ...

  7. Nova Suspend/Rescue 操作详解 - 每天5分钟玩转 OpenStack(35)

    本节我们讨论 Suspend/Resume 和 Rescue/Unrescue 这两组操作. Suspend/Resume 有时需要长时间暂停 instance,可以通过 Suspend 操作将 in ...

  8. Node rescue/unrescue相关代码流程图

  9. 1 张图秒懂 Nova 16 种操作 - 每天5分钟玩转 OpenStack(44)

    前面我们讨论了 Instance 的若干操作,有的操作功能比较类似,也有各自的适用场景,现在是时候系统地总结一下了. 如上图所示,我们把对 Instance 的管理按运维工作的场景分为两类:常规操作和 ...

随机推荐

  1. EasyNVR无插件直播流媒体服务器云端集中管控的EasyNVS云管理平台安装使用文档

    EasyNVS - EasyNVR云端集中管理服务 EasyNVS云管理平台是一套专门用于集中化管理EasyNVR 的解决方案. EasyNVR 采用主动注册的方式接入到 EasyNVS, 再由 Ea ...

  2. mysql中对应oracle中的to_char()和to_number()函数

    TO_CHAR(): CAST(123   AS   CHAR(3)) TO_NUMBER(): cast( '123 '   as   SIGNED   INTEGER)

  3. border inset outset ,border-radius

    1. 例子: div{ width:256px; height:256px; border: 10px inset #f00; margin:0 auto; border-radius:255px; ...

  4. 小程序 less wxss 混合 Mixins picker样式优化 箭头样式的实现原理

    lessc src/style/picker-arrow_.less src/style/picker-arrow_.wxss 快速入门 | Less.js 中文文档 https://less.boo ...

  5. String、StringBuffer、StringBuiler区别

    1.String与StringBuiler的相同点都是线程不安全的.StringBuffer是线程安全的. 2.String长度不可变,StringBuiler长度可变.当String 使用(+)连接 ...

  6. RabbitMQ_消息队列基本使用_1

    什么叫消息队列 消息(Message)是指在应用间传送的数据.消息可以非常简单,比如只包含文本字符串,也可以更复杂,可能包含嵌入对象. 消息队列(Message Queue)是一种应用间的通信方式,消 ...

  7. 基于TCP_socket套接字实现远程执行命令

    基于tcp的套接字实现远程执行命令的操作 ——客户端敲命令,服务端执行 #服务端 import socket import subprocess phone=socket.socket(socket. ...

  8. 内置函数:sorted 用法

    内置函数——sorted  对list.dict进行排序,Python提供了两个方法 对给定的List L进行排序,方法1: 用List的成员函数sort进行排序,在本地进行排序,不返回副本方法2: ...

  9. http请求设置setConnectTimeout()方法超时无响应

    相信非常多小伙伴在写 HttpURLConnection中都设置了setConnectTimeout()方法.目的就是在网络不好的情况下超时返回 然而我们设置的setConnectTimeout()并 ...

  10. 开机提示memory size decreased怎么办?

    ytkah的办公电脑实在是hold不住,win7用2G的内存,基本是在等待中度过的,没有新的只能考虑加格内存了,采购嘛,需走一大堆流程,跟领导请示从其他硬件需求不是很高的电脑那边拔一根内存条吧,小C的 ...