Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am busy replacing the (SAN attached) storage configured for this XEN host. Is there some way to "move" the domU from one block device to another on the same host, possibly something similar to live migration, but on a single host and going to new storage?

My current process is:

  1. Shut down the VM.
  2. Delete the VM
  3. Change it's XML config file to refer to the new LUN device.
  4. Copy (at raw level) the data from the old to the new LUN
  5. Re-create the VM using the updated XML config file
  6. Start the VM back up.

This works... but it takes time - some of the LUNs are huge. It would be great if I could either minimize the downtime to a few minutes, or ideal if I could eliminate it entirely.

FWIW this old host is still Running Xen 3.0.

About the current disk setup - it is realy simple. Each DomU have a single whole disk device assigned to it, eg phy:/dev/emcpowerx

As evident by the above, the device is a pseudo device managed by EMC powerpath.

The objective is to move the domU from /dev/emcpowerx to /dev/emcpowerz.

share|improve this question
    
If you have got a SAN I presume you care about high-availability. Have you consideres using a HA-cluster for your XEN-environment? In such an environment this would be pretty easy... –  Nils Jun 20 '13 at 14:51
    
Can you explain your disk setup for the DomU in more detail? Device-name on the Dom0 and how it looks like from inside the DomU. –  Nils Jun 20 '13 at 20:19
    
I guess you do not want to pay for this license?-/ –  Nils Jun 21 '13 at 21:11

2 Answers 2

Live migration works if the underlying storage seems to stay the same.

What is missing in your setup is one abstraction layer

Virtual Storage by implementing either

  • virtual SAN (costly)
  • a block-device of some type that can be a RAID1 (could have been a md-device)
  • a virtual disk using the LV-layer (more flexible anyway than usig a LUN directly)

In your setup you reduce the downtime, if you

  1. I would recommend to use a drbd, md and/or lv layer for the new LUN
  2. Copy (at raw level) the data from the old to the new layer and thus to the new LUN
  3. Prepare the new Xen-DomU-config
  4. Shudown old VM
  5. Copy the delta on filesystem-level from the old VM to the new VM
  6. Delete old VM
  7. Start new VM
share|improve this answer
    
Please provide more detail. Particularly about step 5! –  Johan Jun 20 '13 at 16:37
    
@Johan that depends on your filesystem in your DomU and wether you use LVM inside your DomU. It is easiest if you use a Linux-FS directly or on partitions of your virtual disk. You can mount these in the Dom0 and then do an rsync. –  Nils Jun 20 '13 at 20:17

I have another approach, now that I know about your disk-setup:

  1. Stop the DomU
  2. Replace your virtual disk with a md-raid1 in degraded mode consisting of your old disk
  3. Start the DomU
  4. Add the new disk to the raid1
  5. wait until sync is complete
  6. remove the old disk from the md-device
  7. reduce the number of needed devices to 1 to make degraded mode default

I will go into further detail for step 2 when I`ve got my hands on a Linux-box...

Basically your downtime boils down to a shutdown/boot of your DomU.

share|improve this answer
    
Interesting. I was actually toying with the idea of using ZFS as the layer between the VM and the block device, particularly because of the rock-solid snapshot ability, ability to create overcommitted virtual devices, differential snapshots, ability to mirror/break mirrors, etc. And also it is easier than LVM. Particularly now that ZoL is rated "production ready" –  Johan Jun 25 '13 at 16:12

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.