Difference between revisions of "Migration"

From Xen
(New page)
 
m (Migrate without shared storage)
 
(4 intermediate revisions by 3 users not shown)
Line 10: Line 10:
 
== Migrate without shared storage ==
 
== Migrate without shared storage ==
   
If you have no real shared storage (eg SAN) available, you can still test VM migration, using NBD. This allows you to share the harddrive of opne host to another. The disadvantage of this is that whilst you can migrate the VM, you cannot shutdown the host that contains the storage.
+
If you have no real shared storage (eg SAN) available, you can still test VM migration, using NBD. This allows you to share the harddrive of one host with another. The disadvantage of this is that whilst you can migrate the VM, you cannot shutdown the host that contains the storage.
   
 
* Install nbd-client on all Dom0s you will migrate between (apt-get install nbd-client on Debian-based distros)
 
* Install nbd-client on all Dom0s you will migrate between (apt-get install nbd-client on Debian-based distros)
Line 27: Line 27:
 
* Start the VM
 
* Start the VM
 
* Run `xl migrate <Domain> <new host>`
 
* Run `xl migrate <Domain> <new host>`
  +
  +
== Additional Information ==
  +
* A good [https://www.suse.com/documentation/sles-12/book_virt/data/sec_xen_manage_migrate.html external article] from the SUSE SLES 12 manual
   
 
[[Category:Users]]
 
[[Category:Users]]
  +
[[Category:Xen]]
  +
[[Category:HowTo]]

Latest revision as of 19:17, 2 June 2017

Performing VM migration under Xen

Xen can migrate virtual machines between different servers, running Xen. This can be useful if you need to take a physical server offline, for maintenance. Rather than having to shutdown the VMs running on that host during the maintenance, you can migrate them to another physical server, and keep them running. Performing a migration does not require restarting the virtual server, and has no noticeable downtime.

Setup

The persistent storage for the VMs must be shared, so that both Dom0s can see the same disk, at the same location.

Then run `xl migrate <domain> <host>` to migrate the VM

Migrate without shared storage

If you have no real shared storage (eg SAN) available, you can still test VM migration, using NBD. This allows you to share the harddrive of one host with another. The disadvantage of this is that whilst you can migrate the VM, you cannot shutdown the host that contains the storage.

  • Install nbd-client on all Dom0s you will migrate between (apt-get install nbd-client on Debian-based distros)
  • Install nbd-server (apt-get intall nbd-server) on the Dom0 of the machine that contains the storage
  • Add the following to /etc/nbd-server/config
[<name>]
    exportname = <path to disk to share>
    port = 9000
  • Run `nbd-client 127.0.0.1 9000 /dev/nbd1` on the same machine
  • Run `nbd-client <hostname of machine that contains the storage> 9000 /dev/nbd1` on the machine you are migrating to
  • Modify your /etc/xen/foo.cfg file to use /dev/nbd1 as its disk, on the host backing the storage
  • Start the VM
  • Run `xl migrate <Domain> <new host>`

Additional Information