Export VM command line XenServer 6

Export VM command line XenServer 6

Export VM command line XenServer 6

This tutorial walks you through how to export a VM via command line in XenServer6, this is helpful if you need to make a backup of a VM, or move to another pool. Let’s get started!

login, and su to root

Root shell prompt on xenserver1

from here we need to make a location to mount a NFS Share

mkdir /mnt/Xen to create the NFS mount point on XenServer

mount the NFS share where you will export the VM to

mount nfsserver:/mount /mnt/Xen

from here issue the vm-list command

xe vm-list on xenserver1

in this example, we are exporting the VM named “DNS3”

xe vm-export vm=DNS3 filename=/mnt/Xen/DNS3.xva

from the XenServer console, you should notice that the status has changed to “busy” or yellow

XenCenter tree showing VM DNS3 under xenserver1 while the export runs

This will take some time, and it’s relative to your Storage, and Network. Usually the smaller the VMs, the better in this case.

you should see the following once completed:

xe vm-export vm=DNS3 completed with Export succeeded

You have successfully Exported your VM to .xva format.

You can additionally use this Script:

#!/bin/sh
# Created By Andrew Zwieg 2/23/2014
# Version 2.1

# Prompt for Server Name
echo Enter Server Name as it appears in XenServer, and hit Enter
read SERVERNAME

# export the VM to file
echo Enter the Location to Export VM to “ex: /mnt/Xen”
read MOUNT

# Export the VM to File
xe vm-export vm=$SERVERNAME filename=$MOUNT/$SERVERNAME.xva

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

Related guides: Mount NFS Share on CentOS 6

Leave a Reply

Your email address will not be published. Required fields are marked *