博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
External (and Live) snapshots with libvirt
阅读量:5142 次
发布时间:2019-06-13

本文共 2702 字,大约阅读时间需要 9 分钟。

list all the block devices associated with the guest

$ virsh domblklist testvm --detailsType       Device     Target     Source------------------------------------------------file       disk       vda        /export/vmimgs/testvm.qcow2

let’s create a snapshot(disk-only) of the guest

$ virsh snapshot-create-as testvm snap1-testvm "snap1 description" \  --diskspec vda,file=/export/vmimgs/snap1-testvm.qcow2 \  --disk-only --atomic

– ‘–atomic’ just ensures either the snapshot is run completely or fails w/o making any changes

$ qemu-img info /export/vmimgs/snap1-testvm.qcow2 image: /export/vmimgs/snap1-testvm.qcow2file format: qcow2virtual size: 20G (21474836480 bytes)disk size: 2.5Mcluster_size: 65536backing file: /export/vmimgs/testvm.qcow2$

created 2 more snapshots

$ virsh snapshot-list testvm --treesnap1-testvm  |  +- snap2-testvm      |      +- snap3-testvm

image file chain[ base<-snap1<-snap2<-snap3 ]:

#--------------------------------------------#$ qemu-img info /export/vmimgs/snap3-testvm.qcow2image: /export/vmimgs/snap3-testvm.qcow2file format: qcow2virtual size: 20G (21474836480 bytes)disk size: 129Mcluster_size: 65536backing file: /export/vmimgs/snap2-testvm.qcow2#--------------------------------------------#$ qemu-img info /export/vmimgs/snap2-testvm.qcow2image: /export/vmimgs/snap2-testvm.qcow2file format: qcow2virtual size: 20G (21474836480 bytes)disk size: 3.6Mcluster_size: 65536backing file: /export/vmimgs/snap1-testvm.qcow2#--------------------------------------------#$ qemu-img info /export/vmimgs/snap1-testvm.qcow2image: /export/vmimgs/snap1-testvm.qcow2file format: qcow2virtual size: 20G (21474836480 bytes)disk size: 2.5Mcluster_size: 65536backing file: /export/vmimgs/testvm.qcow2$#--------------------------------------------#

Now, if we do not need snap2 any more, and want to pull all the data from snap1 into snap3, making snap1 as snap3’s backing file, we can do a virsh blockpulloperation as below:

$ virsh blockpull --domain testvm \  --path /export/vmimgs/snap3-testvm.qcow2 \  --base /export/vmimgs/snap1-testvm.qcow2 \  --wait --verboseBlock Pull: [100 %]Pull complete

可以看到snap3的backup为snap1

$ qemu-img info /export/vmimgs/snap3-testvm.qcow2image: /export/vmimgs/snap3-testvm.qcow2file format: qcow2virtual size: 20G (21474836480 bytes)disk size: 145Mcluster_size: 65536backing file: /export/vmimgs/snap1-testvm.qcow2

snapshot-list 仍显示snap2

$ virsh snapshot-list testvm --treesnap1-testvm  |  +- snap2-testvm      |      +- snap3-testvm

所以仍可以恢复为

base <- snap123

External disk-snapshots(live) using RAW as original image: 

源disk image 不变为raw,而snapshot为qcow2

internal snapshots会导致源disk image变成qcow2

 

转载于:https://www.cnblogs.com/allcloud/p/5074407.html

你可能感兴趣的文章
Linux环境下Redis安装和常见问题的解决
查看>>
HashPump用法
查看>>
cuda基础
查看>>
Vue安装准备工作
查看>>
oracle 创建暂时表
查看>>
201421410014蒋佳奇
查看>>
Xcode5和ObjC新特性
查看>>
LibSVM for Python 使用
查看>>
Centos 7.0 安装Mono 3.4 和 Jexus 5.6
查看>>
CSS属性值currentColor
查看>>
java可重入锁reentrantlock
查看>>
浅谈卷积神经网络及matlab实现
查看>>
解决ajax请求cors跨域问题
查看>>
《收获,不止Oracle》pdf
查看>>
LinkedList<E>源码分析
查看>>
Real-Time Rendering 笔记
查看>>
如何理解HTML结构的语义化
查看>>
Activity之间的跳转:
查看>>
实验四2
查看>>
Android现学现用第十一天
查看>>