96
section called “Backing up Virtual Machine metadata”). This backup method should always
be considered complementary to backing up the pool metadata.
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 currently inactive disk partition of the host. This partition can then be made
active by booting off the installation CD and choosing to restore the appropriate backup.
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 achieved 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 command before
archiving the running filesystem, to snapshot a consistent state of the VM metadata.

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.

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 command 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 restores it to its normal form, but it is written
to another partition (/dev/sda2) and does not overwrite the current version of the filesystem.
2. To use the restored version of the root filesystem, reboot the XenServer host using the XenServer installation
CD and select the Restore from backup option.
After the restore from backup is completed, reboot the XenServer host and it will start up from the restored
image.
Finally, restore the VM meta-data using
xe pool-restore-database file-name=/var/backup/pool-database-*
Note:
Restoring from a backup as described here does not destroy the backup partition.

Restarting a crashed XenServer host

1. If your XenServer host has crashed and is not reachable anymore, you need to use the XenServer installation
CD to do an upgrade install. When that is completed, reboot the machine and make sure your host is
reachable with XenCenter or remote CLI.
2. Then proceed with the section called “Backing up XenServer hosts” above.
Backing up VMs
VMs are best backed up using standard backup tools running on them individually. For Windows VMs, we have
tested CA BrightStor ARCserve Backup.