[DRBD-user] Dual primary and LVM

Digimer lists at alteeve.ca
Thu Jul 27 03:59:43 CEST 2017

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


On 2017-07-26 10:14 AM, Gionatan Danti wrote:
> Hi all,
> I have a possibly naive question about a dual primary setup involving
> LVM devices on top of DRBD.
> 
> The main question is: using cLVM or native LVM locking, can I safely use
> a LV block device on the first node, *close it*, and reopen it on the
> second one? No filesystem is involved and no host is expected to
> concurrently use the same LV.
> 
> Scenario: two CentOS 7 + DRBD 8.4 nodes with LVs on top of DRBD on top
> of a physical RAID array. Basically, DRBD replicate anything written to
> the specific hardware array.
> 
> Goal: having a redundant virtual machine setup, where vms can be live
> migrated between the two hosts.
> 
> Current setup: I currently run a single-primary, dual nodes setup, where
> the second host has no access at all to any LV. This setup worked very
> well in the past years, but it forbid using live migration (the
> secondary host has no access to the LV-based vdisk attached to the vms,
> so it is impossible to live migrate the running vms).
> 
> I thought to use a dual-primary setup to have the LVs available on
> *both* nodes, using a lock manager to arbitrate access to them.
> 
> How do you see such a solution? It is workable? Or would you recommend
> to use a clustered filesystem on top of the dual-primary DRBD device?
> 
> Thanks.

To clarify; The clustered locking in clvmd doesn't do anything to
restrict access to the storage, it's job is only to inform other nodes
that something changing on the underlying shared storage when it makes a
change.

To make sure a VM runs on only one node at a time, then you must use
pacemaker to handle that (and stonith to prevent split-brains, but I am
sure you know that already).

If you use clvmd on top on DRBD, make your life simple and don't use it
below DRBD at the same time. It's technically possible but it is
needless complexity. You seem to already be planning this, but just to
make it clear.

Also note; If you don't use clvmd, then you will probably need to do a
pv/vg/lvscan to pick up changes. This is quite risky though and
certainly not recommended if you run DRBD in dual-primary.

-- 
Digimer
Papers and Projects: https://alteeve.com/w/
"I am, somehow, less interested in the weight and convolutions of
Einstein’s brain than in the near certainty that people of equal talent
have lived and died in cotton fields and sweatshops." - Stephen Jay Gould



More information about the drbd-user mailing list