-
Notifications
You must be signed in to change notification settings - Fork 56
aaaaaaaallala
Demo user edited this page Oct 25, 2015
·
2 revisions
#UHost快照恢复-Case
###场景:
用户制作了快照,对数据盘进行了操作,需要恢复制作快照时的数据。
###步骤
####Step 1:
查找虚拟机所在宿主机,并登陆。执行
virsh dumpxml b0aabdf9-3f5f-4616-a0fd-d259fda4b81f | grep disk
查到虚拟机数据盘路径(/opt/data/disk/9d986fd2-ed5d-44e8-a57a-de078b7d5084.disk)。
<disk type='file' device='disk'>
<source file='/opt/data/disk/9d986fd2-ed5d-44e8-a57a-de078b7d5084.disk'/>
</disk>
查看快照列表。
qemu-img info /opt/data/disk/9d986fd2-ed5d-44e8-a57a-de078b7d5084.disk
image: /opt/data/disk/9d986fd2-ed5d-44e8-a57a-de078b7d5084.disk
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 941M
cluster_size: 65536
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 20150214154806 0 2015-02-14 15:48:15 00:00:00.000
2 20150214154840 0 2015-02-14 15:48:48 00:00:00.000
####Step 2:
执行一下命令恢复快照。
qemu-img snapshot -a 20150301092325 /opt/data/disk/9d986fd2-ed5d-44e8-a57a-de078b7d5084.disk