This is an old revision of the document!
Needs testing and updating
With XenServer it is possible to create backups of VMs, even if they are running. The process is as follows:
First look for the uuid of the VMs to backup. We don’t want to backup the control domain itself, so we add is-control-domain=false
to the vm-list command and we also don’t want backups of snapshots so we add is-a-snapshot=false
:
xe vm-list is-control-domain=false is-a-snapshot=false
Now we create a snapshot of the VMs we want to backup, replacing the uuid one by one with the ones we found with the previous command. Also replace the name of the snapshot if desired:
xe vm-snapshot uuid=<uuid of VM> new-name-label=<snapshotname>
Note the return value (the uuid of the created snapshot).
Then we transform the snapshot into a VM to be able to export it to a file. Replace the uuid with the return value of the previous command:
xe template-param-set is-a-template=false ha-always-run=false uuid=<uuid of snapshot>
In the next step we export the snapshot to a file. Replace the uuid with the snapshot uuid and provide a meaningful filename:
xe vm-export vm=<uuid of snapshot> filename=/path/to/filename.xva
In the final step we delete the snapshot:
xe vm-uninstall uuid=<uuid of snapshot> force=true