Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have created a snapshot of a Citrix XenServer virtual machine using XenCenter, and now I would like to save this snapshot as an *.xva file, just as if I right-click on the snapshot icon in XenCenter and choose "Export to file...".

However since the VM has a size of 100 GByte I would rather do this operation from the XenServer console and save it right to a fast NFS mounted volume instead of downloading the VM through a slow network connection.

Please advise how to do this via the console. I spent some time googling but was unable to find a solution for this particular problem.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Once you snapshot a server you can export that snapshot to locally mounted storage such as NFS. Take a look at a free script written by Andy Burton Here:

http://blog.andyburton.co.uk/index.php/2009-08/citrix-xenserver-automated-live-vm-backup-to-windows-cifs-share/

I have cut and pasted the relevant command from his script below.

# Create snapshot

            snapshot=`xe vm-snapshot vm=$uuid new-name-label=backup_$date`
            vm_log[${#vm_log[@]}]="Snapshot: $snapshot"

            # Set as VM not template

            snapshot_template=`xe template-param-set is-a-template=false uuid=$snapshot`
            vm_log[${#vm_log[@]}]="Set as VM"

            # Export

            snapshot_export=`xe vm-export vm=$snapshot filename="$backup_dir$label-$date$backup_ext"`
            vm_log[${#vm_log[@]}]="Export: $snapshot_export"

            # Delete snapshot

            snapshot_delete=`xe vm-uninstall uuid=$snapshot force=true`
            vm_log[${#vm_log[@]}]="Delete Snapshot: $snapshot_delete"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.