0% found this document useful (0 votes)
46 views

Citrix XenServer VM Backup

This document provides instructions for exporting and backing up Citrix XenServer virtual machines to an attached USB drive. It describes how to identify and format the USB drive, mount it, use the xe vm-export command to export VMs to .xva files on the drive, and monitor the process with iostat. It also explains how to import the VMs on another system by plugging in the USB drive, mounting it, and using xe vm-import.

Uploaded by

Jinu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Citrix XenServer VM Backup

This document provides instructions for exporting and backing up Citrix XenServer virtual machines to an attached USB drive. It describes how to identify and format the USB drive, mount it, use the xe vm-export command to export VMs to .xva files on the drive, and monitor the process with iostat. It also explains how to import the VMs on another system by plugging in the USB drive, mounting it, and using xe vm-import.

Uploaded by

Jinu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Citrix XenServer EBI

Working with Citrix XenServer


(EBI) export/backup/import citrix xen vm on the quick with attached
usb drive vs OTN (Optical Transport Network) based EBI.

/dev/sdd is our usb drive


(get list of all disks on xen system)

[root@dev1-xen ~]# fdisk -l 

Disk /dev/sdd: 500.1 GB, 500107861504 bytes


255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

If starting from scratch, then you will need to create a partition and
new Linux filesystem. Otherwise, mount your device to /mnt/usb or
whatever your destination needs to be.

[root@dev1-xen ~]# fdisk /dev/sdd

Enter n for new drive, then p for primary, you can just hit enter until
the rest is completed.
Now we format thew new partition with ext3 filesystem

[root@dev1-xen ~]# mkfs.ext3 -L xenbackup /dev/sdd1

We can now mount it


[root@dev1-xen ~]# mkdir /mnt/usb && mount /dev/sdd1 /mnt/usb
Now verify it
[root@dev1-xen ~]# df -h

Filesystem Size Used Avail Use% Mounted on


/dev/sda1 4.0G 1.8G 2.1G 46% /
none 373M 4.0K 373M 1% /dev/shm
/opt/xensource/packages/iso/XenCenter.iso
52M 52M 0 100% /var/xen/xc-install
/dev/sdd1 459G 0G 459G 0% /mnt/usb

Now we are good to go to backup/export our vm.


First, lets get a list of all vms on the citrix xen host system

[root@dev1-xen ~]# xe vm-list

Should return something like this

uuid ( RO) : 557f19c6-d54f-a5G8-d9ad-e7ae0d07c25c


name-label ( RW): casterdev.local
power-state ( RO): halted
uuid ( RO) : cb0685a5-8f88-fdda-0084-f1c1c9e5711f
name-label ( RW): casterstage.local
power-state ( RO): running

We want to go by the name-label so our export command to export


will look like this.
[root@dev1-xen ~]# xe vm-export vm="casterdev.local"
filename="/mnt/usb/casterdev.xva"
Could take some time depending in size of vm and speed of USB
drive, to watch in real time, simply use the iostat command to see

[root@dev1-xen ~]# iostat sdb sdd 1

Since our vms are stored on the internal drive /dev/sdb, we want to
watch the read speed as well.

[root@dev1-xen ~]# iostat sdb sdd 1

Linux 2.6.32.43-0.4.1.xs1.6.10.734.170748xen (dev1-xen ) 3/7/2015


avg-cpu: %user %nice %system %iowait %steal %idle
0.54 0.00 0.36 1.21 0.04 97.85
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sdb 9.18 1250.52 91.95 75808942 5574071
sdd 3.44 0.08 766.68 4731 46477358

Once this process is completed, we will be ready to import our vms on


new machines or simply keep as a backup copy in which case, nothing
more is needed to be done. If we are migrating vms to another
system, the process looks like this.

Plugin the usb drives and mount

[root@dev1-xen ~]# mount /dev/sdc1 /mnt/usb 

(or whatever device is returned as the usb drive from fdisk -l output)
Now finish it up and import.

[root@dev1-xen ~]# xe vm-import


filename=/mnt/usb/whateveryounamedthis.xva

That's it, process completed.

You might also like