RFC: using a network device as a destination for a disk snapshot

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

 



Right now, when creating an external snapshot, the snapshot xml requires
that the destination be in the local file system:

http://libvirt.org/formatsnapshot.html

<domainsnapshot>
  ...
  <disks>
    <disk name='vda' snapshot='external'>
      <driver type='qcow2'/>
      <source file='/path/to/new'/>
    </disk>
...

But libvirt already allows for a network device with qcow2 contents,
provided that there is no backing chain:

# qemu-img info gluster://red/vol1/img2
image: gluster://red/vol1/img2
file format: qcow2
virtual size: 10M (10485760 bytes)
disk size: 193K
cluster_size: 65536
# virsh dumpxml dom
<domain type='kvm'>
  ...
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source protocol='gluster' name='vol1/img2'>
        <host name='red'/>
      </source>
      <target dev='vdc' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09'
function='0x0'/>
    </disk>
...

I'm working on patches to the backing chain code to allow a gluster (or
other network device) with qcow2 contents to have a backing file, but
for the code to be useful, we also need to patch <domainsnapshot> xml to
allow the destination file to be a gluster or other network device,
rather than forcing it to be a local file name.

Here's the XML I think we need to add to domainsnapshot:

<domainsnapshot>
  ...
  <disks>
    <disk name='vda' snapshot='external' type='network'>
      <driver type='qcow2'/>
      <source protocol='gluster' name='vol1/img2'>
        <host name='red'/>
      </source>
    </disk>

that is, add an optional /disk@type attribute (if absent, it defaults to
type='file'), and where if present, the <source> subelement then takes
on alternate forms in the same manner in which //domain/devices/disk
handles alternates (here, allowing a protocol, name, and host
specification).

[Ultimately, we need to fix //domain/devices/disk to specify a full
backing chain, but one step at a time...]

-- 
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]