Hello I made a backup of a VM guest with these steps:
1. virsh dumpxml --migratable test > /backup/test.xml
2. virsh snapshot-create-as --domain test \
--name backup.qcow2 \
--no-metadata \
--atomic \
--quiesce \
--disk-only \
--diskspec vda,snapshot=external
3. cp /var/lib/libvirt/images/test.qcow2 /backup/
4. virsh blockcommit test vda --active --pivot
5. rm -f /var/lib/libvirt/images/test.backup.qcow2
After backup I am trying to test if I can restore from it.
- I am shutting down guest 'test'
- Undefying guest 'test'
- removing qcow2 image from main images folder
- then copy qcow2 to main image folder
- Trying to define by this command:
virsh define -file /backup/test.xml
and I am getting error: error: unexpected data 'test.xml'
What I am doing wrong? How can I troubleshot this?