December 2015
Intermediate to advanced
250 pages
4h 41m
English
While a KVM stores some of the resources' configuration on the disk in a human readable format, it is a good idea to query libvirt for the configuration of your resources.
In this recipe we'll back up all relevant KVM metadata by performing the following steps:
Here's the network configuration:
~]# for i in $(virsh net-list --all | sed -e '1,2d' |awk '{print $1}'); do \ virsh net-dumpxml --network $i --inactive > /tmp/net-$i.xml; \ done
Here's the storage configuration:
~]# for i in $(virsh pool-list --all | sed -e '1,2d' |awk '{print $1}'); do \ for j in $(virsh vol-list --pool $i |sed -e '1,2d') | awk '{print $1}'; do \ virsh vol-dumpxml --pool $i --vol $j > /tmp/vol-$j.xml; \ done \ virsh pool-dumpxml ...