[DRBD-user] Determining whether a resource is in dual-primary mode

Veit Wahlich cru.lists at zodia.de
Thu Oct 29 18:11:28 CET 2015

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

Hi Ivan,

thank you for your suggestions.

Am Donnerstag, den 29.10.2015, 18:28 +0200 schrieb Ivan:
> you may be interested by this:
> https://github.com/taradiddles/cluster/blob/master/libvirt_hooks/qemu
> I wrote it some time ago as a qemu hook before ending setting up a full 
> fledged cluster (pacemaker) with proper fencing, which rendered the 
> script useless. It worked pretty well though (it doesn't change the 
> "--allow-two-primaries" but you could easily add it if you end up using 
> the script).

This looks nice. I have written a similar Perl based hook for this case,
but at the moment it only takes care to promote resources used by the
domain before the domain starts, and demotes the resources when it stops
or is migrated away.

I was unsure to add migration support to this hook due to safety
concerns about what happens when migration fails. I already experienced
split-brain situations due to configuration mismatch after one side
executed the "drbdadm --allow-two-primaries" command, but the other one
did not.

So I decided to put this functionality into a control program with
direct user interaction. It also checks for a lot of other potential
problems before migration starts, such as 'file' type disks (e.g. ISOs
for domains' cdroms) not on cluster filesystems, 'dir' type disks, any
DRBD-backed disk cache setting not being 'writethrough', domain being
already defined on other nodes than source, domain having active
snapshots, domain not being persistently defined, ...

> are you sure ? on my machine, cat /proc/drbd
> version: 8.4.6 (api:1/proto:86-101)
> GIT-hash: 9304f3b0995d97316d6bd4455ecbcf2963147ab4 build by 
> build at vm-build-el7.c3i.priv, 2015-10-03 16:07:33
> 10: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----
> ns:9850696 nr:7822820 dw:17672764 dr:10737789 al:151 bm:0 lo:0 pe:0 ua:0 
> ap:0 ep:1 wo:f oos:0
> 11: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----
> ns:977368 nr:16 dw:977384 dr:1143886 al:212 bm:0 lo:0 pe:0 ua:0 ap:0 
> ep:1 wo:f oos:0

> $ drbdadm role vm-file
> Primary/Primary
> Primary/Primary

I think I explained my problem mistakable:

My problem is not that I do not know whether there are two primaries
active, but whether two primaries are still allowed (esp. whether
"drbdadm --allow-two-primaeries=no" has been successfully executed.

So I was unable to find a flag in /proc/drbd that indicates whether
allow-dual-primary is active or not.

Best regards,
// Veit

More information about the drbd-user mailing list