This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


RE: [Xen-users] Xen-DRBD Migration question

To: "'Eric Laflamme'" <elaflamme@xxxxxxxx>, <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-users] Xen-DRBD Migration question
From: "Simon Billis" <simon@xxxxxxxxxx>
Date: Tue, 10 Aug 2010 18:28:47 +0100
Delivery-date: Tue, 10 Aug 2010 10:30:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <714EA284-EF71-46D8-AC75-B8EB71B3F6E2@xxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <714EA284-EF71-46D8-AC75-B8EB71B3F6E2@xxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acs4mqVTaFSsjJLxTruIJ8MluZ2qRwAFMHug
Eric Laflamme sent a missive on 2010-08-10:

> Hi,
> Let me introduce our setup so you can have a better ideas on my
> situation.
> We have 2 physical hosts. Both have Xen for the vm and as for the
> disk, we have DRBD that sync between the two host. We would like to be
> able to do migration or live migration between host. This is possible
> as we have successfully done it.
> As we can read on documentation and all is that migration and live
> migration is done with --allow-two-primaries options on DRBD.
> Unfortunately and for obvious reasons this option is too dangerous to
> be left on and we would like to avoid using this at all cost.
> I've heard from a post somewhere that a migration Secondary-Primary
> can be done. Our best way to do this will be to put de VM on pause.
> Put the drbd disk on Secondary. Then migrate the vm to the second
> host, then put the drbd disk on second host to primary and unpause the
> vm. I've searched on google and I can't find anything on this method.
> Is there a way to do this? Is there another way you are thinking of?
> Thanks for you help,

I think that doing a live migration is very simple with DRBD and that
provided you're not attempting to write to the same drbd resource from both
machines at the same time I _think_ you'll be fine. I've live migrated back
and forth between hosts with no problem using drbd storage in
primary/primary mode. I allocate a drbd resource for each domU. I also have
duplicated the config for the domU's between hosts so that I can fail-over
if one of the hosts fails.

It would be possible for you to write a little shell script that does the
following if you didn't want to do it manually:
Parses the config file of the domU for the drbd resource and then logs into
the destination host and brings the required drbd resource from secondary to
primary, then issues the live migration command to move the domU to the
destination host. It would then need to check that the domU has moved to the
other machine by looking at the say the output of xm list (depends on how
you are managing the domU's) and then once the domU has moved over to then
take the drbd resource on the originating host to secondary.

To do this with a paused domain requires that you copy between the hosts the
state file that is created when you pause the domain - but I've not done
this so I am not 100% sure as to if this actually works or what the pitfalls



Xen-users mailing list