[DRBD-user] Forcing a device to be primary on a backup site

Philipp Marek philipp.marek at linbit.com
Mon Feb 1 21:36:07 CET 2016

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


> I have the following scenario that I am trying to simulate.
> 
> I have a volume replicated between clusters A and B, primary on cluster A.
> The volume is attached to and mounted on a VM instance VM1 on cluster A.
> I take a snapshot of VM1.
> I now imagine that VM1 on cluster A becomes unreachable, so I want to 
> bring up VM1 on cluster B, and attach to it the replicated volume.
> I have to make the volume primary on cluster B.
> As long as the volume is primary on cluster A, I cannot make it primary on 
> cluster B.
> 
> I want to force the transition of the volume on cluster B from secondary 
> to primary, without having to perform operations on cluster A.
> 
> What is the proper sequence of operations / commands to accomplish this?
As in your expected experiment, you will need to cut the communication path 
between the two sites.

The easiest way to do so is to run "drbdadm disconnect <resource>" on one 
of the sites; given your requirements, on cluster B.

If you're using DRBDmanage, there's a command "drbdmanage disconnect 
<resource>" as well.
Please note that this might be undone by other commands in the cluster 
- but that shouldn't hurt you, because you'll already have the resource in 
cluster B Primary, and that means that any further reconnection attempts 
will lead to a split-brain, and therefore a disconnect (again) - so for 
your scenario it would be "stable".


With DRBD 9 you won't even need to make the resource Primary "manually" 
(ie. with a "drbdadm primary" command), you can simply run DRBD with 
auto-promote turned on; then you'll just need to run the "drbdmanage 
disconnect" command, and start your VM.




More information about the drbd-user mailing list