Snapshot backup
The backup process involves taking a snapshot of the data volume and securely storing it for future recovery.
Procedure
-
Create a folder for saving the snapshots:
mkdir /var/lib/libvirt/images/hpvs/snap-image -
Take a snapshot:
virsh snapshot-create-as --domain <domain-name> <snapshot-name> --diskspec <volume1>,file=<path where snapshot-image 1 will be saved> --diskspec <volume2>,file=<path where snapshot-image 2 will be saved> --disk-only --atomicSample output:# virsh snapshot-create-as --domain goveng guest-state1 --diskspec vdc,file=/var/lib/libvirt/images/hpvs/snap-image/snapshotimg.qcow2 --diskspec vdb,snapshot=no --diskspec vda,snapshot=no --disk-only --atomic Domain snapshot guest-state1 created -
View the snapshot:
virsh snapshot-list <vm_name> -
List the block devices:
virsh domblklist <vm_name> -
After the backup completes, perform an active-blockcommit by live-merging the contents of
snapshotimg.qcow2intodata volume.virsh blockcommit <vm_name> vdc --active --verbose --pivot -
Shutdown the existing Governance Engine instance by running the following command:
virsh shutdown <domain-name> -
Verify the instance status:
virsh list --allSample output:# virsh list --all Id Name State ------------------------------ 1 goveng shutoff -
Change the directory to snapshot directory:
cd /var/lib/libvirt/images/hpvs/snap-image -
Convert the snapshot to an independent image:
qemu-img convert -O qcow2 -c <snapshot-image> <independent-image> - Copy the converted image to the target LPAR.