Ahmad Ismail
2022-Jan-14 17:39 UTC
What does the positional parameters of "virsh backup-begin" actually do?
Normally when I backup a kvm machine I shutdown the machine then run: virsh list -all virsh shutdown Ubuntu18 virsh dumpxml Ubuntu18 > /MyBackup/Ubuntu18.xml cp /var/lib/libvirt/images/Ubuntu18.qcow2 /MyBackup/Ubuntu18.qcow2 However, I found a new sub-command. The help file says: % virsh backup-begin --help NAME backup-begin - Start a disk backup of a live domain SYNOPSIS backup-begin <domain> [--backupxml <string>] [--checkpointxml <string>] [--reuse-external] DESCRIPTION Use XML to start a full or incremental disk backup of a live domain, optionally creating a checkpoint OPTIONS [--domain] <string> domain name, id or uuid --backupxml <string> domain backup XML --checkpointxml <string> domain checkpoint XML --reuse-external reuse files provided by caller The problem with this help is, it is not clear enough. I understand that I should use virsh backup-begin vm1 to backup a live kvm machine. However, this command only create .qcow2 files. What about the .xml file. What does --backupxml , --checkpointxml & --reuse-external actually do? When should I use them? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20220114/b7934132/attachment.htm>
Peter Krempa
2022-Jan-14 21:18 UTC
What does the positional parameters of "virsh backup-begin" actually do?
On Fri, Jan 14, 2022 at 23:39:10 +0600, Ahmad Ismail wrote:> Normally when I backup a kvm machine I shutdown the machine then run:[...]> The problem with this help is, it is not clear enough. > > I understand that I should use virsh backup-begin vm1 to backup a live kvm > machine. However, this command only create .qcow2 files. What about the .xml > file. > > What does --backupxml , --checkpointxml & --reuse-external actually do? > > When should I use them?'man virsh' states: backup-begin Syntax: backup-begin domain [backupxml] [checkpointxml] [--reuse-external] Begin a new backup job. If backupxml is omitted, this defaults to a full backup using a push model to filenames generated by lib? virt; supplying XML allows fine-tuning such as requesting an in? cremental backup relative to an earlier checkpoint, controlling which disks participate or which filenames are involved, or re? questing the use of a pull model backup. The backup-dumpxml com? mand shows any resulting values assigned by libvirt. For more in? formation on backup XML, see: https://libvirt.org/formatbackup.html If --reuse-external is used it instructs libvirt to reuse tempo? rary and output files provided by the user in backupxml. If checkpointxml is specified, a second file with a top-level ele? ment of domaincheckpoint is used to create a simultaneous check? point, for doing a later incremental backup relative to the time the backup was created. See checkpoint-create for more details on checkpoints. This command returns as soon as possible, and the backup job runs in the background; the progress of a push model backup can be checked with domjobinfo or by waiting for an event with event (the progress of a pull model backup is under the control of whatever third party connects to the NBD export). The job is ended with domjobabort. Does this clarify it sufficiently?