Skip to content

Instantly share code, notes, and snippets.

@jondkelley
Last active April 3, 2018 15:23
Show Gist options
  • Save jondkelley/2592dab5c4afba2c972c97b3c7e485b7 to your computer and use it in GitHub Desktop.
Save jondkelley/2592dab5c4afba2c972c97b3c7e485b7 to your computer and use it in GitHub Desktop.

Managing Xen Images

On a hypervisor host

Restoring from a backup from backup server

If restoring a hypervisor, setup the backups to the point of step 1.9 Test NFS mount

On the hypervisor, run

 mount -t nfs -o port=3049 localhost:/mnt/data /mnt/nfs/data

Look in /mnt/nfs/data/hypervisor_name/ for your backup (should be an .xva file)

Run

 xe vm-import vm=RESTORE_VM_NAME filename=/mnt/nfs/data/PATH_TO_BACKUP

Restoring from a backup from a local disk

 xe vm-import vm=RESTORE_VM_NAME filename=/mnt/disk/backup.xva

Backing up a VM to a local disk

Using VM name

 xe vm-export vm=ubuntu filename=/mnt/diskname/ubuntu.xva

Using UUID

 xe vm-list | less

Scroll and find the VM and UUID you want, then q to quit.

xe vm-export uuid=b24dcd65-5e12-4576-2f39-46ecab9362ab filename=/mnt/diskname/ubuntu.xva

Note you can hit tab for UUIDs or arguements at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment