Re: [Libvirt]Snapshot operations in Libvirt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/02/2013 07:02 AM, harryxiyou wrote:
> Hi all,

[no need to cc me specifically, I read the list for a reason]
[no need to add "[Libvirt]" to your subject line, the list already adds
that automatically, making your messages come through with double tags:
https://www.redhat.com/archives/libvir-list/2013-February/thread.html#00072]

> 
> I see our libvirt snapshot XML form like following, which this
> XML is to create a disk snapshot of just vda on a qemu domain
> with two disks.
> 
> <domainsnapshot>
>   <description>Snapshot of OS install and updates</description>
>   <disks>
>     <disk name='/path/to/old'>
>       <source file='/path/to/new'/>
>     </disk>
>     <disk name='vdb' snapshot='no'/>
>   </disks>
> </domainsnapshot>
> 
> My understanding about up XML is like this: it creates a snapshot
> for '/path/to/old', which '/path/to/old' would be the read-only backing
> file to the new active file '/path/to/new'. I also have some questions
> about current libvirt snapshot operations like following.
> 
> 1, Is my up understanding right? Or maybe you have any other suggestions.

Yes, loading that snapshot XML with 'virsh snapshot-create $dom $file
--disk-only' while $dom is active would do what you describe, by using
the qemu 'blockdev-snapshot-sync' QMP command under the hood.

> 
> 2, I wonder whether libvirt *NOW* support start a snapshot and then
> mount this new storage block, which is based on the snapshot.
> Please give me some real examples (like Sheepdog volumes) if you
> can.

By default, that snapshot XML will create /path/to/new as a qcow2 file,
even if /path/to/old is a sheepdog volume.  I'm not very familiar with
sheepdog myself, but my impression is that sheepdog always forms the
base element of a stack as used by qemu - there's no way to make qemu
use a sheepdog volume that has /path/to/old as it's backing file with
qemu managing /path/to/old.  I don't know if sheepdog as a protocol
supports internal snapshots; but if it does, then we still need support
added to qemu to tell sheepdog to take an internal snapshot, then wiring
up support in libvirt to use that new qemu command.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]