KVM | Backup a Guest Virtual Machine

Опубликовано: 15 Март 2025
на канале: Yogesh Mehta
12,852
102

As a system admin, taking backup is the one of critical task to ensure you have required data to restore the services incase recover from a disaster. To backup a KVM guest , follow the steps below

Power off the guest VM , if it is running.
virsh shutdown guest-vm

Note – You can take backups when guest is running, but it can lead to a unhealthy backup image.

Take backup of the disk-image file. (default path is : /var/lib/libvirt/images)
cp -p /var/lib/libvirt/images/ guest-vm-image /path/to/backup/location

3. Take Backupo of configuration file.
cp -p  /etc/libvirt/qemu/ guest-vm.xml /path/to/backup/location

If you have data which is not local , i.e. some NFS shares etc, take perform the backups as recommended by the vendor.


Watch the video for details :