Difference between revisions of "KVM: Create Live backups (snapshot-create-as, blockcommit)"
Jump to navigation
Jump to search
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Reference document: https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit | Reference document: https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit | ||
− | * Overview: <code>[[virsh snapshot-create-as]]</code> -> <code>[[virsh blockcommit]]</code> | + | * Overview: <code>[[virsh snapshot-create-as]]</code> -> <code>[[cp]]/[[rsync]]</code> -> <code>[[virsh blockcommit]]</code> |
Line 14: | Line 14: | ||
2. Take a backup of the '''original disk''': <code>[[cp]]</code> or <code>[[rsync]]</code> | 2. Take a backup of the '''original disk''': <code>[[cp]]</code> or <code>[[rsync]]</code> | ||
− | 3. <code>[[virsh blockcommit]] VM_TO_BACKUP | + | 3. <code>[[virsh blockcommit]] VM_TO_BACKUP DEVICE_TARGET --active --verbose --pivot</code> |
− | :<code>[[virsh blockcommit]] VM_TO_BACKUP vda --active --verbose --pivot</code> | + | :<code>[[virsh blockcommit]] VM_TO_BACKUP vda --active --verbose --pivot</code> (--wait) |
− | == Related | + | == Related terms == |
− | * <code>[[virsh domblklist]]</code> | + | * <code>[[virsh domblklist]] VM_NAME --details</code> |
* <code>[[virsh dumpxml]]</code> | * <code>[[virsh dumpxml]]</code> | ||
− | + | * <code>[[virsh vol-list]] POOL_NAME --details</code> | |
− | + | * [[Error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device]] | |
== Activities == | == Activities == | ||
− | # Review [[Bash]] script https://gist.github.com/cabal95/e36c06e716d3328b512b implementing Live Backup and https://gist.github.com/maxim-gorkin/f0e8a2c01a93ca65ad2ad10566a78d72 with [[logging]] capabilities, remote destination and rsync usage. | + | # Review [[Bash]] script https://gist.github.com/cabal95/e36c06e716d3328b512b implementing Live Backup and https://gist.github.com/maxim-gorkin/f0e8a2c01a93ca65ad2ad10566a78d72 with [[logging]] capabilities, remote destination and rsync usage. ([[Kvm backup.sh]]) |
# Review [[bacula]] solution: http://www.bacula.lat/kvm-hot-online-virtual-machines-backup-with-bacula-bpipe/?lang=en | # Review [[bacula]] solution: http://www.bacula.lat/kvm-hot-online-virtual-machines-backup-with-bacula-bpipe/?lang=en | ||
# Review Veritas [[Netbackup]] support for [[Red Hat Virtualization|RHV]] | # Review Veritas [[Netbackup]] support for [[Red Hat Virtualization|RHV]] | ||
+ | # View [[Eric Blacke]] video: https://www.youtube.com/watch?v=zQK5ANionpU | ||
== See also == | == See also == | ||
* {{virsh snapshot}} | * {{virsh snapshot}} | ||
+ | * {{virsh block}} | ||
* {{KVM}} | * {{KVM}} | ||
Latest revision as of 16:37, 30 September 2020
Reference document: https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
- Overview:
virsh snapshot-create-as
->cp/rsync
->virsh blockcommit
1. Create an external disk snapshot, specify image destination :
virsh snapshot-create-as --domain VM_TO_BACKUP --diskspec vda,file=/export/images/VM_TO_BACKUP_overlay1.qcow2 --disk-only --atomic
--diskspec
To indicate external snapshot and location--disk-only
Do not save memory information--atomic
2. Take a backup of the original disk: cp
or rsync
3. virsh blockcommit VM_TO_BACKUP DEVICE_TARGET --active --verbose --pivot
virsh blockcommit VM_TO_BACKUP vda --active --verbose --pivot
(--wait)
Related terms[edit]
virsh domblklist VM_NAME --details
virsh dumpxml
virsh vol-list POOL_NAME --details
- Error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device
Activities[edit]
- Review Bash script https://gist.github.com/cabal95/e36c06e716d3328b512b implementing Live Backup and https://gist.github.com/maxim-gorkin/f0e8a2c01a93ca65ad2ad10566a78d72 with logging capabilities, remote destination and rsync usage. (Kvm backup.sh)
- Review bacula solution: http://www.bacula.lat/kvm-hot-online-virtual-machines-backup-with-bacula-bpipe/?lang=en
- Review Veritas Netbackup support for RHV
- View Eric Blacke video: https://www.youtube.com/watch?v=zQK5ANionpU
See also[edit]
- Virsh Snapshots:
virsh snapshot-create-as
,virsh snapshot-info
,virsh snapshot-list
,virsh blockjob
,virsh snapshot-revert (Destructive action)
,virsh snapshot-delete
virsh blockcopy
,virsh blockjob
,virsh blockcommit
,virsh domblklist
,virsh blockresize
,virsh blockpull
- KVM, Installation, QEMU,
virsh
,virtinst
,libguestfs-tools
, libvirt, qemu, Red Hat Virtualization (RHV), MacVTap, Virtio, oVirt, KVM services, KVM networking, KVM graphics, CPU, KVM on ARM
Advertising: