Installation guide
Maintenance Procedures
27
This section describes the XenServer Host control domain backup and restore procedures.
These procedures do not back up the storage repositories that house the VMs, but only the priv-
ileged control domain that runs Xen and the XenServer agent.
Note that since the the privileged control domain is best left as installed, without customizing it
with other packages, we recommend you set up a PXE boot environment to cleanly perform a
fresh installation from the XenServer media as a recovery strategy. In many cases you will not
need to backup the control domain at all, but just save the pool metadata (see Section B.7.1,
“Backing up Virtual Machine metadata”). This backup method should always be considered com-
plementary to backing up the pool metadata.
Another approach is to run the XenServer installation twice, selecting to back up the existing
installation when prompted. This will create a pristine copy of the freshly-installed control domain
that can later be restored if necessary by using the installation CD and choosing the Restore
option.
Using the xe commands host-backup and host-restore is another approach that you can take.
The xe host-backup command archives the active partition to a file you specify, and the xe
host-restore command extracts an archive created by xe host-backup over the host's currently
inactive disk partition. This partition can then be made active by booting off the installation CD
and choosing the Restore option.
After completing the above steps and rebooting the host, you must ensure that the VM meta-data
is restored to a consistent state. This can be achived by running xe pool-restore-database on
/var/backup/pool-database-${DATE}. This file is created by xe host-backup using xe
pool-dump-database prior to archiving the running filesystem, in order to snapshot a consistent
state of the VM metadata.
Procedure B.7. To back up a XenServer Host
• On a remote host with enough disk space, run the command:
xe host-backup file-name=<filename> -h <hostname> -u root -pw <password>
This creates a compressed image of the control domain file system in the location specified
by the file-name argument.
Procedure B.8. To restore a running XenServer Host
1. If you want to restore a XenServer Host from a specific backup, run the following command
while the XenServer Host is up and reachable:
xe host-restore file-name=<filename> -h <hostname> -u root -pw <password>
This restores the compressed image back to the hard disk of the XenServer Host on which
the command is run (not the host on which filename resides). In this context “restore” is
something of a misnomer, as the word usually suggests that the backed-up state has been
put fully in place. The restore command here only unpacks the compressed backup file and