No announcement yet.

Xen Virtual Machine migration using Snapshot

  • Filter
  • Time
  • Show
Clear All
new posts

  • eukSam
    started a topic Xen Virtual Machine migration using Snapshot

    Xen Virtual Machine migration using Snapshot

    When it comes to migrating Virtual Machine from older Xen version (XCP 1.6 & older) to a new version (Xenserver 6.2), you cannot use the live migration option. In this case for migration we can use the export & import option but this will result in big downtime. Migrating the Virtual Machine using Snapshot will minimize the downtime.

    1) Create snapshot using following to commands.

    xe vm-snapshot new-name-label=VM1_Snapshot uuid=2cc0444f-56bb-f816-fa19-ccc940913cf0
    Above uuid if of the vm for which snapshot is generated.

    The above command will generate the uuid for the snapshot & the snapshot will be in a template format. We have to set it to non-template format.

    xe snapshot-param-set is-a-template=false uuid=03edea75-a9ff-147f-d17a-b5fd2a2eb765
    Above uuid if of the vm snapshot.

    2) Create a compressed backup of the vm using the snapshot. The backup should be created in a nfs folder which is mount on the host node & same folder will be mounted on the remote server.

    xe vm-export compress=true filename=VM_Backup uuid=03edea75-a9ff-147f-d17a-b5fd2a2eb765
    The above command will create a backup file "VM_Backup" in the nfs mounted folder.

    3) Restoring the backup on remote server.

    xe vm-import filename=VM_Backup sr-uuid=fcdf99d0-fbec-bb55-2ef5-00d40f9c4b63
    The sr-uuid is uuid of the local storage on new server.

    Once the backup is restored, you can shutdown old Virtual Machine & start new Virtual Machine. Make sure to install xen-tools on the new Virtual Machine.

  • Eric Brown
    Re: Xen Virtual Machine migration using Snapshot

    Great tutorial Sam!

    Thanks for sharing.

    Leave a comment: