kvm快照应用

 

kvm快照应用
 
kvm也具有快速恢复的方法,前提是必须处于关机状态才可以执行,否则会出现各种莫名其妙的问题
 
 
创建镜像:
qemu-img snapshot -c initial smokeping_falcon_test0917.qcow2 
恢复镜像:
qemu-img snapshot -a initial smokeping_falcon_test0917.qcow2
删除镜像
qemu-img snapshot -d initial smokeping_falcon_test0917.qcow2
状态查看
qemu-img snapshot -l smokeping_falcon_test0917.qcow2 
 
创建前的大小
[root@smokeping]# ll
total 7578488
-rw-r--r-- 1 root root 171825168384 Sep 17 17:01 smokeping_falcon_test0917.xml
-rw-r--r-- 1 root root 171825168384 Sep 17 16:01 smokeping_falcon_test_187.qcow2
-rw-r--r-- 1 root root 171825168384 Sep  6 11:14 smokeping_falcon_test.qcow2
以下是创建后的文件
[root@smokeping]# ll
total 7603284
-rw-r--r-- 1 qemu qemu 171850530816 Sep 17 17:22 smokeping_falcon_test0917.qcow2
-rw-r--r-- 1 root root 171825168384 Sep 17 16:01 smokeping_falcon_test_187.qcow2
-rw-r--r-- 1 root root 171825168384 Sep  6 11:14 smokeping_falcon_test.qcow2
 
查看镜像方法1
[root@smokeping]# qemu-img info smokeping_falcon_test0917.qcow2 
image: smokeping_falcon_test0917.qcow2
file format: qcow2
virtual size: 160G (171798691840 bytes)
disk size: 2.2G
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         initial                   0 2012-09-17 17:08:49   00:00:00.000
查看镜像方法2
[root@smokeping]# qemu-img snapshot -l smokeping_falcon_test0917.qcow2 
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         initial                   0 2012-09-17 17:08:49   00:00:00.000
 
利用这个镜像,可以迅速还原服务器状态,使用空间也不大。
 
实测中,若虚拟机为启动状态制作快照,恢复后会无法载入系统,关闭服务器,再次启动,服务器直接崩溃。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章