libvirt 7.2.0 domainbackup

Hello one and all. Just wanted to check out the new feature domainbackup but having trouble to configure it. I thought I just have to put <domainbackup> <disks> <disk name='vda' type='file'> <target file='/var/lib/libvirt/jitsi'/> <driver type='raw'/> </disk> </disks> </domainbackup> at the top level of my domain xml file but that does not seem to work. I get: error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Element domain has extra content: domainbackup Can someone please push me in the right direction? cheers, t.

Got a little bit further. "virsh backup-begin jitsi jitsi-backup.xml" works and I have a backup file now. VM was running all the time. Question. Is it save to use this function this way? Currently I do: virsh snapshot-create-as --domain jitsi weekly --diskspec vda,file=/var/lib/libvirt/jitsi/jitsi_weekly.qcow2-$(date +%Y-%m-%d) --disk-only --atomic --no-metadata ncftpput -V -F -d ... virsh blockcommit jitsi vda --active --verbose --pivot So while the backup is being written there is no write operation happening to the file. Any thoughts? cheers, t. On 2021-04-07 19:03, Thomas Stein wrote:
Hello one and all.
Just wanted to check out the new feature domainbackup but having trouble to configure it. I thought I just have to put
<domainbackup> <disks> <disk name='vda' type='file'> <target file='/var/lib/libvirt/jitsi'/> <driver type='raw'/> </disk> </disks> </domainbackup>
at the top level of my domain xml file but that does not seem to work. I get:
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Element domain has extra content: domainbackup
Can someone please push me in the right direction?
cheers, t.

On Wed, Apr 07, 2021 at 19:46:54 +0200, Thomas Stein wrote:
Got a little bit further. "virsh backup-begin jitsi jitsi-backup.xml" works and I have a backup file now. VM was running all the time. Question. Is it save to use this function this way? Currently I do:
The backup file you'll get will represent the state of the VM at the time the backup operation has started, but should contain a full copy of the image from that time.

Cool! So just to be clear, if I start the backup at 1400 and it's finished at 1410, changes to the image at 1405 are not included? It's the same quality as my current backup solution then. Thank you for your answer Peter. cheers, t. Am 8. April 2021 15:46:56 MESZ schrieb Peter Krempa <pkrempa@redhat.com>:
On Wed, Apr 07, 2021 at 19:46:54 +0200, Thomas Stein wrote:
Got a little bit further. "virsh backup-begin jitsi jitsi-backup.xml"
works
and I have a backup file now. VM was running all the time. Question. Is it save to use this function this way? Currently I do:
The backup file you'll get will represent the state of the VM at the time the backup operation has started, but should contain a full copy of the image from that time.

On Thu, Apr 08, 2021 at 15:53:14 +0200, Thomas Stein wrote:
Cool! So just to be clear, if I start the backup at 1400 and it's finished at 1410, changes to the image at 1405 are not included?
Yes, exactly.
It's the same quality as my current backup solution then. Thank you for your answer Peter.
If you do full backups (create just 1 overlay, copy over the full original image, merge the 1 overlay back) then yes. If you were doing an "incremental" backup (2 overlays when backing up, 1 overlay in normal use) then that is not yet supported. The code for incremental backups via 'virsh backup-begin' exists in libvirt but qemu doesn't yet support the 'blockdev-reopen' command which is used by the incremental backup code.
cheers, t.
Am 8. April 2021 15:46:56 MESZ schrieb Peter Krempa <pkrempa@redhat.com>:
On Wed, Apr 07, 2021 at 19:46:54 +0200, Thomas Stein wrote:
Got a little bit further. "virsh backup-begin jitsi jitsi-backup.xml"
works
and I have a backup file now. VM was running all the time. Question. Is it save to use this function this way? Currently I do:
The backup file you'll get will represent the state of the VM at the time the backup operation has started, but should contain a full copy of the image from that time.

On Wed, Apr 07, 2021 at 19:03:21 +0200, Thomas Stein wrote:
Hello one and all.
Just wanted to check out the new feature domainbackup but having trouble to configure it. I thought I just have to put
<domainbackup> <disks> <disk name='vda' type='file'> <target file='/var/lib/libvirt/jitsi'/> <driver type='raw'/> </disk> </disks> </domainbackup>
at the top level of my domain xml file but that does not seem to work. I get:
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Element domain has extra content: domainbackup
That's not how it's used, if you want to create a backup you have to use the virDomainBackupBegin API e.g. via `virsh backup-begin VMNAME /path/to/backup.xml`. Your backup xml file seems to look correct.
participants (2)
-
Peter Krempa
-
Thomas Stein