Fedora 18 KVM 在线快照功能体验

Fedora 18发布了,虚拟化方面最激动人心的一个功能就是在线快照。以前KVM要做快照,虚拟机会自动暂停,现在终于克服这个问题了。实验环境:硬件 Intel(R) Xeon(R) CPU E5540 @ 2.53GHz 6G内存 80G sata硬盘软件 fedora 18 kernel 3.7.2-204.fc18.x86_64目前virt-manager 还不支持做快照,只能通过virsh的命令行操作。在线快照只支持磁盘是raw和qcow2格式的虚拟机。测试的时候,创建两个虚拟机,w和test1,w磁盘是raw格式的,test1磁盘是qcow2格式的,通过如下命令创建快照,并一直ping虚拟机,可以看到,,快照在一瞬间生成,并且虚拟机没有丢包。virsh snapshot-create-as w snapshot1 “snapshot1 description” –disk-only –atomicvirsh snapshot-create-as test1 snapshot1 “snapshot1 description” –disk-only –atomic创建的快照和虚拟机磁盘镜像文件在一起,并且快照都是qcow2格式的。[root@localhost datapool]# lstest01.qcow2 test01.snapshot1[root@localhost datapool]# qemu-img info test01.snapshot1image: test01.snapshot1file format: qcow2virtual size: 60G (64424509440 bytes)disk size: 516Kcluster_size: 65536backing file: /datapool/test01.qcow2[root@localhost images]# qemu-img info w.snapshot1image: w.snapshot1file format: qcow2virtual size: 8.0G (8589934592 bytes)disk size: 6.6Mcluster_size: 65536backing file: /var/lib/libvirt/images/w.imgSnapshot list:ID TAG VM SIZE DATE VM CLOCK1 snapshot2 6.3M 2013-01-22 14:29:06 00:59:59.854[root@localhost images]# qemu-img info w.imgimage: w.imgfile format: rawvirtual size: 8.0G (8589934592 bytes)disk size: 0[root@localhost images]#常用命令:列出虚拟机快照virsh # snapshot-list w名称 Creation Time 状态————————————————————snapshot1 2013-01-22 13:29:32 +0800 disk-snapshotsnapshot2 2013-01-22 14:29:06 +0800 running倒退虚拟机到上一个快照virsh snapshot-revert w snapshot2将虚拟机的镜像变化,合并到快照virsh blockpull –domain w –path /var/lib/libvirt/images/w.snapshot1删除快照virsh snapshot-delete w snapshot2

找一个让心里安静和干净的地方,

Fedora 18 KVM 在线快照功能体验

相关文章:

你感兴趣的文章:

标签云: