wslhs 发表于 2012-9-18 09:03:56

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

创建前的大小
# 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 Sep6 11:14 smokeping_falcon_test.qcow2
以下是创建后的文件
# 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 Sep6 11:14 smokeping_falcon_test.qcow2

查看镜像方法1
# 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
# 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

利用这个镜像,可以迅速还原服务器状态,使用空间也不大。

实测中,若虚拟机为启动状态制作快照,恢复后会无法载入系统,关闭服务器,再次启动,服务器直接崩溃。

沈阳格力专卖店 发表于 2013-3-14 04:34:03

我是来刷分的,嘿嘿

chriszg 发表于 2013-5-16 02:45:49

学海无涯,回头是岸!

gmdzxx 发表于 2013-5-16 18:49:03

穿别人的鞋,走自己的路,让他们找去吧。

远行的心 发表于 2013-5-17 14:42:06

老天,你让夏天和冬天同房了吧?生出这鬼天气!

njsuntop 发表于 2013-5-18 11:41:57

月经不仅仅是女人的痛苦,也是男人的痛苦。

生活如麻 发表于 2013-5-19 03:27:45

很多女明星不红的原因是因为没有张开腿*^_^*
页: [1]
查看完整版本: kvm快照应用