This article will describe how to export an XVA file of a VPX from an SDX. This file contains the entire contents of the VPX including an image of the VPX's file systems.
xe vm-export vm=VMName filename= | ssh -T user@x.x.x.x 'cat > /pathOnExtSystem/filename.xva'
xe vm-list name-label=VMName params=uuid uuid ( RO) : 3043e1c2-82ac-9ecb-47c7-aaa41767b517 xe vbd-list vm-uuid=3043e1c2-82ac-9ecb-47c7-aaa41767b517 params=vdi-uuid vdi-uuid ( RO) : 5596d7cb-f2e7-43e8-81d1-802e1d2e0766 xe vdi-list uuid=5596d7cb-f2e7-43e8-81d1-802e1d2e0766 params=virtual-size virtual-size ( RO) : 21474836480
pvscan PV /dev/sda4 VG VG_XenStorage-5c32bc7b-8725-0133-275b-578a5bc06fb5 lvm2 [220.46 GiB / 50.91 GiB free] Total: 1 [220.46 GiB] / in use: 1 [220.46 GiB] / in no VG: 0 [0 ]
xe vdi-create sr-uuid=5c32bc7b-8725-0133-275b-578a5bc06fb5 name-label=tempVDIName type=user virtual-size=25000000000 2fc0de94-c616-4731-859f-41a3905f8f8d^^^ Note the UUID of the created VDI for later use below:
xe vm-list
uuid ( RO) : 73a38c3b-b28e-4f64-8408-40990a79bdb6
name-label ( RW): Control domain on host: netscaler-sdx
power-state ( RO): running
^^^ Locate the uuid of XenServer Dom0.xe vbd-create device=7 vm-uuid=73a38c3b-b28e-4f64-8408-40990a79bdb6 vdi-uuid=2fc0de94-c616-4731-859f-41a3905f8f8d bootable=false mode=RW type=Disk 7b99a08c-eb44-293c-cec9-bf0b595f9cc3^^^ Note the UUID of the created VBD for later use below:
ls /dev/td* /dev/tda /dev/tdb /dev/tdc /dev/tdd /dev/tde
xe vbd-plug uuid=7b99a08c-eb44-293c-cec9-bf0b595f9cc3
Find the newly-created "td" device node
ls /dev/td*
/dev/tda /dev/tdb /dev/tdc /dev/tdd /dev/tde /dev/tdf
mkfs -t ext4 /dev/tdf
mount /dev/tdf /mnt
^^^ This will make the temporary VDI appear as /mnt on the XenServer. You can type df -h to confirm.Export the VM as an XVA file to the temporary VDI
xe vm-export vm=VMName filename=/mnt/vm.xva(If you get an error like CLIENT_ERROR, the vdi you created is not large enough to hold the XVA file; follow the cleanup steps below and then start over creating the VDI with a larger size.)
umount /mnt xe vbd-unplug uuid=7b99a08c-eb44-293c-cec9-bf0b595f9cc3 xe vbd-destroy uuid=7b99a08c-eb44-293c-cec9-bf0b595f9cc3 xe vdi-destroy uuid=2fc0de94-c616-4731-859f-41a3905f8f8d