[DRBD-user] Temporary dual primary-mode during xen live migration ?

Florian Haas florian.haas at linbit.com
Thu Dec 18 21:22:11 CET 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


> On Thu, Dec 18, 2008 at 08:11:28PM +0100, Christoph Adomeit wrote:
>> Hi,
>>
>> I would love the idea to live migrate xen-domU's in rare cases during
>> maintenance.
>>
>> But I hate the idea to generally allow dual primary mode for those drbd
>> resources
>
> I don't think it is even necessary.
> But I have to double check that...

AFAICS, yes it is. Xen wants to fire up the DRBD device (i.e. in the case
of the block-drbd helper, make it Primary) on the migration target even
before it starts the migration. So you need two Primaries for the entire
duration of live migration.

>> because of the risk to accidently mount a filesystem
>> twice and destroy it.
>>
>> Is it possible to switch drbd resources to dual-primary mode at runtime
>> and later switch them back ?
>
> disconnect both nodes (both go to StandAlone)
>
> reconnect both with the two-primaries setting toggled.
> (should do a very brief re-sync, and then be Connected again)

Unfortunately not easily scriptable with the Xen VBD helper
infrastructure. If anyone's got a better idea on how to do this, I'm all
open for suggestions.

And of course, the fact that you _allow_ dual-primary mode does not mean
that the device in fact _operates_ in dual-primary mode the whole time.
Indeed the block-drbd helper makes sure that the device is Primary on both
nodes _only_ during migration.

So I don't really see the added security in scripting

- enable dual-primary mode
- make primary
- migrate
- make secondary
- disable dual-primary mode

versus the existing

- make primary
- migrate
- make secondary.

Then again, there is of course the option of using file-backed VBDs on GFS
or OCFS2. That way you'll at least have a lock manager to coordinate
access. And since the blktap Xen driver uses direct I/O these days, it
should be pretty much equivalent performance wise, compared to using the
block devices directly. Just steer clear of sparse files. :-)

Just my two cents.

Cheers,
Florian





More information about the drbd-user mailing list