[libvirt] A question about booting from the snapshot image by specifying snapshot id in Libvirt

Hi all, I test libvirt boots QEMU VM from Sheepdog snapshot image by specify snapshot id like following. 1, $ collie vdi list Name Id Size Used Shared Creation time VDI id Copies Tag Alice 1 10 GB 1.3 GB 0.0 MB 2013-02-01 18:59 15d167 2 s testvdi 1 20 MB 20 MB 0.0 MB 2013-02-02 11:45 f348ba 2 name s testvdi 2 20 MB 0.0 MB 20 MB 2013-02-03 17:56 f348bb 2 testvdi 3 20 MB 12 MB 8.0 MB 2013-02-03 17:58 f348bc 2 2, $ cat > sheepdog_vm1.xml <domain type='qemu'> <name>testvm</name> <memory>1048576</memory> <os> <type arch='x86_64'>hvm</type> </os> <devices> <disk type='network'> <source protocol="sheepdog" name="testvdi:1"/> <target dev='hda' bus='ide'/> </disk> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> 3, $ virsh create sheepdog_vm1.xml domain testvm is created ( from sheepdog_vm1.xml) 4, $ virsh destroy testvm domain testvm is deleted 5, $ collie vdi list Name Id Size Used Shared Creation time VDI id Copies Tag Alice 1 10 GB 1.3 GB 0.0 MB 2013-02-01 18:59 15d167 2 s testvdi 1 20 MB 20 MB 0.0 MB 2013-02-02 11:45 f348ba 2 name s testvdi 2 20 MB 0.0 MB 20 MB 2013-02-03 17:56 f348bb 2 s testvdi 3 20 MB 12 MB 8.0 MB 2013-02-03 17:58 f348bc 2 testvdi 4 20 MB 12 MB 8.0 MB 2013-02-04 13:15 f348bd 2 My question is before i boot VM from sheepdog:testvdi:1, my vdi list like Name Id Size Used Shared Creation time VDI id Copies Tag Alice 1 10 GB 1.3 GB 0.0 MB 2013-02-01 18:59 15d167 2 s testvdi 1 20 MB 20 MB 0.0 MB 2013-02-02 11:45 f348ba 2 name s testvdi 2 20 MB 0.0 MB 20 MB 2013-02-03 17:56 f348bb 2 testvdi 3 20 MB 12 MB 8.0 MB 2013-02-03 17:58 f348bc 2 However, after VM is destroied, my vdi list like Name Id Size Used Shared Creation time VDI id Copies Tag Alice 1 10 GB 1.3 GB 0.0 MB 2013-02-01 18:59 15d167 2 s testvdi 1 20 MB 20 MB 0.0 MB 2013-02-02 11:45 f348ba 2 name s testvdi 2 20 MB 0.0 MB 20 MB 2013-02-03 17:56 f348bb 2 s testvdi 3 20 MB 12 MB 8.0 MB 2013-02-03 17:58 f348bc 2 testvdi 4 20 MB 12 MB 8.0 MB 2013-02-04 13:15 f348bd 2 There is another snapshot of testvdi created. I am not clear about why another one is created? I just boot a VM from snapshot testvdi, which id is 1. Could anyone please give me some suggestions? Thanks in advance ;-) -- Thanks Harry Wei

On 02/03/2013 10:42 PM, harryxiyou wrote:
My question is before i boot VM from sheepdog:testvdi:1, my vdi list like
...
However, after VM is destroied, my vdi list like ... testvdi 4 20 MB 12 MB 8.0 MB 2013-02-04 13:15 f348bd 2
There is another snapshot of testvdi created. I am not clear about why another one is created? I just boot a VM from snapshot testvdi, which id is 1.
I'm not that familiar with sheepdog, but I'll give it a shot: id 1 is a static point in time. But you booted your guest, which means you have made modifications since that point in time. Those modifications have to be stored somewhere. You can't rewrite id 1, so sheepdog auto-created id 4 as the storage for all changes since you booted from the point in time that id 1 was recording. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, Feb 5, 2013 at 4:31 AM, Eric Blake <eblake@redhat.com> wrote: [...]
I'm not that familiar with sheepdog, but I'll give it a shot: id 1 is a static point in time. But you booted your guest, which means you have made modifications since that point in time. Those modifications have to be stored somewhere. You can't rewrite id 1, so sheepdog auto-created id 4 as the storage for all changes since you booted from the point in time that id 1 was recording.
Hmmm..., i understand your thoughts. Thanks. -- Thanks Harry Wei
participants (2)
-
Eric Blake
-
harryxiyou