How to export only the config of a Xenserver guest
Hi,
After being able to mirror the data of my guests using a DRBD setup between 2 servers, I obviously wanted to copy the config of these guest machines to.
(Otherwise the data mirror would be rather useless.)
But since I did already have all the data perfectly in sync, I did not want to do a complete export of the virtual machine.
I found an option which allows you to backup only the configuration (metadata) of a guest machine. This way you are free to setup your own data mirrorring solution.
The command:
[root@snake ~]# xe vm-export vm=12c2ee4d-16fd-5564-0589-9f302e4aa329 filename=/root/ddk –metadata
To import the data, just copy the file (here /root/ddk) over to your other server and use the following command to import your guest:
[root@jeremy ~]# xe vm-import filename=/root/ddk –metadata
You might need to manually specify the SR, in which case the command becomes:
xe vm-import filename=/root/ddk sr-uuid=8312500f-9962-59ff-9b0e-797987963750 –metadata
(Please note that wordpress doesn’t like the 2 hyphens before the word metadata and displays only one, the option is "- -metadata" without the space between those 2 hyphens.)
Don’t you just love these undocumented switches?
Koen