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

Veit Wahlich cru.lists at zodia.de
Mon Nov 2 23:04:23 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.


Am Montag, den 02.11.2015, 17:14 +0100 schrieb Lars Ellenberg:
> res=XYZ
> if drbdsetup show $res | grep -q allow-two-primaries; then
> 	echo "Two primaries are allowed."
> else
> 	echo "Two primaries are not allowed."
> fi
> 
> complicated to parse?
> where?

Well, for safety reasons I thought about something more sophisticated, a
parser that understands the structure of drbdsetup's configuration data
output and converts sections and attributes to a neat data structure
that can be addressed directly.
I will use the data captured for other things to, in this case (live
migration) to determine the protocol before setting it to C, to be able
re-set it after migration to its previous value. E.g. in case some VMs
might use protocol B in the future, so after live migration I will set
it back to B without having to call drbdadm adjust.

Best regards,
// Veit




More information about the drbd-user mailing list