Table of Contents

KVM CLI Commands Cheet Sheat and Configuration Examples

KVM : How to backup/restore KVM Guest OS



Method 1

Backup

# cp -p /etc/libvirt/qemu/serv01.xml /backup/
# cp -p /var/lib/libvirt/images/serv01.img /backup/

Restore

# cp -p /backup/serv01.xml /etc/libvirt/qemu/
# cp -p /backup/serv01.img /var/lib/libvirt/images/

If you copy, not move the Images, Change uuid、MAC address.
# vi /etc/libvirt/qemu/server01.xml


# virsh define /etc/libvirt/qemu/serv01.xml 
# virsh start serv01
# virsh list --all


Method 2

Backup

# virsh save kvm_centos7 /var/kvm/save/kvm_centos7_01.vmsave

Restore

# virsh restore /var/kvm/save/kvm_centos7_01.vmsave