Fwd: virsh backup-begin problem

Ok. Sorry. On Thu, Jan 21, 2021 at 3:38 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 15:16:44 +0300, Andrey Fokin wrote:
Yes, there is an error message. sudo virsh backup-begin lubuntu2 ./backup.xml error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domainbackup.rng Element domainbackup has extra content: disk
As I've noted in the exact mail you are replying to, I will not offer any further assistance unless you post the question also on libvirt-users@redhat.com list as you did with your original question. This is to archive any discussions for future reference.
On Thu, Jan 21, 2021 at 2:40 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 14:31:18 +0300, Andrey Fokin wrote:
Peter, thanks. I understood you message about additional configuration in domen settings. It's really interesting, and I'll going to test it as well. But could you please advise how change backup-begin command XML
On Thu, Jan 21, 2021 at 12:34:43 +0100, Peter Krempa wrote: parameters
file to start full backup process? What is wrong in my case and how to fix it? My config below. Thanks a lot! <domainbackup> <disk name='/var/lib/libvirt/images/lubuntu2.qcow2' type='file'> <target file='$PWD/scratch1.img'/> <driver type='raw'/> </disk> <disk name='/var/lib/libvirt/images/lubuntu2-1.qcow2' type='file'> <target file='$PWD/scratch2.img'/> <driver type='raw'/> </disk> </domainbackup>
Could you please describe what the problem is? You are getting an error? If so why didn't you paste it?
I'm not going to setup a backup just to try your configuration. Please provide all information you have and describe the problem as best as possible.
Here:
Oh, and don't drop libvirt-users from the CC-list! That way my advice would not be recorded in the mailing list archives and browsable by others with a possibly same problem.
Please Re-post your query to the list AND include any information you have to get a reply from me.
-- BRG, Andrey
-- BRG, Andrey

On Thu, Jan 21, 2021 at 15:42:21 +0300, Andrey Fokin wrote:
Ok. Sorry.
On Thu, Jan 21, 2021 at 3:38 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 15:16:44 +0300, Andrey Fokin wrote:
Yes, there is an error message. sudo virsh backup-begin lubuntu2 ./backup.xml error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domainbackup.rng Element domainbackup has extra content: disk
As I've noted in the exact mail you are replying to, I will not offer any further assistance unless you post the question also on libvirt-users@redhat.com list as you did with your original question. This is to archive any discussions for future reference.
On Thu, Jan 21, 2021 at 2:40 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 14:31:18 +0300, Andrey Fokin wrote:
Peter, thanks. I understood you message about additional configuration in domen settings. It's really interesting, and I'll going to test it as well. But could you please advise how change backup-begin command XML
On Thu, Jan 21, 2021 at 12:34:43 +0100, Peter Krempa wrote: parameters
file to start full backup process? What is wrong in my case and how to fix it? My config below. Thanks a lot!
Let me rescue the XML as you've posted it. <domainbackup> <disk name='/var/lib/libvirt/images/lubuntu2.qcow2' type='file'> <target file='$PWD/scratch1.img'/> <driver type='raw'/> </disk> <disk name='/var/lib/libvirt/images/lubuntu2-1.qcow2' type='file'> <target file='$PWD/scratch2.img'/> <driver type='raw'/> </disk> </domainbackup> So there are multiple issues here. Firstly please refer to the XML documentation, because the mistakes you have in your are actually documented properly: https://libvirt.org/formatbackup.html Problems: 1) Missing <disks> container around the individual <disk> elements 2) <disk name=' attribute must contain the disk target (such as 'vda', 'vdb' refering to the disk in the domain definition, paths are not allowed. This fact is mentioned in the docs. 3) If the <target file=' paths are not examples, but you really have $PWD in there, note that neither virsh nor libvirt will replace it with the working directory. The XML is used as-is. This then violates the rule that paths must start with a /. So the proper XML then is. Obviously you need to make sure that it's what you actually meant ... <domainbackup> <disks> <disk name='hda' type='file'> <target file='/path/scratch1.img'/> <driver type='raw'/> </disk> <disk name='hdc' type='file'> <target file='/path/scratch2.img'/> <driver type='raw'/> </disk> </disks> </domainbackup> e.g. the output files will be raw and not qcow2.

Peters, thanks! It was a lot of XML errors. You are right about. But it doesn't work... I've an error about backup type- Operation not supported: incremental backup is not supported yet How is possible describe full backup operation? On Thu, Jan 21, 2021 at 4:33 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 15:42:21 +0300, Andrey Fokin wrote:
Ok. Sorry.
On Thu, Jan 21, 2021 at 3:38 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 15:16:44 +0300, Andrey Fokin wrote:
Yes, there is an error message. sudo virsh backup-begin lubuntu2 ./backup.xml error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domainbackup.rng Element domainbackup has extra content: disk
As I've noted in the exact mail you are replying to, I will not offer any further assistance unless you post the question also on libvirt-users@redhat.com list as you did with your original question. This is to archive any discussions for future reference.
On Thu, Jan 21, 2021 at 2:40 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 14:31:18 +0300, Andrey Fokin wrote: > Peter, thanks. I understood you message about additional configuration in > domen settings. It's really interesting, and I'll going to test it as well. > But could you please advise how change backup-begin command XML
On Thu, Jan 21, 2021 at 12:34:43 +0100, Peter Krempa wrote: parameters
> file to start full backup process? What is wrong in my case and how to fix > it? My config below. > Thanks a lot!
Let me rescue the XML as you've posted it.
<domainbackup> <disk name='/var/lib/libvirt/images/lubuntu2.qcow2' type='file'> <target file='$PWD/scratch1.img'/> <driver type='raw'/> </disk> <disk name='/var/lib/libvirt/images/lubuntu2-1.qcow2' type='file'> <target file='$PWD/scratch2.img'/> <driver type='raw'/> </disk> </domainbackup>
So there are multiple issues here.
Firstly please refer to the XML documentation, because the mistakes you have in your are actually documented properly:
https://libvirt.org/formatbackup.html
Problems:
1) Missing <disks> container around the individual <disk> elements 2) <disk name=' attribute must contain the disk target (such as 'vda', 'vdb' refering to the disk in the domain definition, paths are not allowed. This fact is mentioned in the docs. 3) If the <target file=' paths are not examples, but you really have $PWD in there, note that neither virsh nor libvirt will replace it with the working directory. The XML is used as-is. This then violates the rule that paths must start with a /.
So the proper XML then is. Obviously you need to make sure that it's what you actually meant ...
<domainbackup> <disks> <disk name='hda' type='file'> <target file='/path/scratch1.img'/> <driver type='raw'/> </disk> <disk name='hdc' type='file'> <target file='/path/scratch2.img'/> <driver type='raw'/> </disk> </disks> </domainbackup>
e.g. the output files will be raw and not qcow2.
-- BRG, Andrey

On Thu, Jan 21, 2021 at 17:34:25 +0300, Andrey Fokin wrote:
Peters, thanks! It was a lot of XML errors. You are right about. But it doesn't work... I've an error about backup type- Operation not supported: incremental backup is not supported yet How is possible describe full backup operation?
Did you apply the VM XML workaround that I've pointed out twice already: https://www.redhat.com/archives/libvirt-users/2021-January/msg00034.html And if yes, did you restart your VM after adding the XML to enable the feature?

Do you mean "experimental" feature to enable incremental backup? No, didn't because I try to implement full buckup (not an incremental one). Or am I missing something and it is the same? On Thu, Jan 21, 2021 at 6:04 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Jan 21, 2021 at 17:34:25 +0300, Andrey Fokin wrote:
Peters, thanks! It was a lot of XML errors. You are right about. But it doesn't work... I've an error about backup type- Operation not supported: incremental backup is not supported yet How is possible describe full backup operation?
Did you apply the VM XML workaround that I've pointed out twice already:
https://www.redhat.com/archives/libvirt-users/2021-January/msg00034.html
And if yes, did you restart your VM after adding the XML to enable the feature?
-- BRG, Andrey

On Thu, Jan 21, 2021 at 18:12:54 +0300, Andrey Fokin wrote:
Do you mean "experimental" feature to enable incremental backup? No, didn't because I try to implement full buckup (not an incremental one). Or am I missing something and it is the same?
It's the same. Implementing lockouts for every single sub-feature which is actually complete would be too much of a hassle. If you don't do incrementals (don't create checkpoints) the snapshot/blockjob APIs will work as expected. And yes, it's still considered experimental.
participants (2)
-
Andrey Fokin
-
Peter Krempa