backuplibvirt

virsh begin-backup — Unable to validate doc …/domainbackup.rng


I am trying to create a backup of a given VM in »push mode« as described here. I have tried a lot of variations of the backup-xml but none passes the validation test. That includes the example posted here (the first one). Additionally I just ran that command:

sudo virsh backup-begin vm1 && sudo virsh backup-dumpxml vm1

which dumps the autogenerated XML of the backup job with default values. In my case that looks like that:

<domainbackup mode='push'>
  <disks>
    <disk name='vda' backup='yes' type='file' backupmode='full' index='4'>
      <driver type='qcow2'/>
      <target file='/home/xxx/.local/share/libvirt/images/vm1.qcow2.1684137281'/>
    </disk>
    <disk name='sda' backup='no'/>
  </disks>
</domainbackup>

So I put that output in a file (bg.xml) and ran: sudo virsh backup-begin vm1 ./bg.xml which than again showed the error:

error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domainbackup.rng
Extra element disks in interleave
Element domainbackup failed to validate content

Any Idea what is going wrong here - since the auto-generated content fails validation I am getting out of ideas.


Solution

  • I've answered this on IRC so for completness:

    The problem is the 'index="4"' part, which is an output-only element and thus not allowed by the schema on input. The rest of the XML is correct.