Adding DRBD shared volumes to Proxmox to support Live Migration

jhr

Member
Nov 29, 2021
57
6
13
50
Hi, I followed this article to build-up 2-nodes Proxmox Cluster with shared DRBD.
I do not understand why I need two drbd partitions, both are Primary/Primary ?

The plan is to create 2 resources in Primary/Primary mode. The first one r0 will be used to store disk images for VM’s running on proxmox01 and r1 for the VM’s running on proxmox02. This way we can easily recover from split brain in that way that for r0 we can discard all the changes from proxmox02 and for r1 all the changes from proxmox01.

Then we will create LVM volume from each of the resources and add that as shared LVM storage to the PVE Datacenter.

I builded-up exactly according that scenario and VM's running on proxmox01 are stored on r0/drbd0 device, BUT when I migrate it to proxmox02, they disks are still stored on r0/drbd0.
Is there any reasons why I cannot used one single drbd partition ?

THX
 
Hey,

Maybe late than never... and perhaps you moved on. The reason for having 2 DRDB volumes is that you in a 2 node cluster practically always need to resolve split-brain scenarios manually. You need to decide, which side holds the best or most accurate data if you like, and which sides holds data that will be discarded.
The author of that article says, that is is easier to discard a side, if you have one volume normally used by VMs on one node. And another volume for VMs on the node. IF you were to experience a disconnect between the 2 nodes, we know that VMs are running on a specific node using a specific DRDB volume. So it is easier to point at a DRDB node that holds the most recent data.
If you have 1 volume for nodes on both nodes, then this works fine when both nodes are up and connected, and changes are synchronised between the nodes. But as soon as a split brain occurs, you will have changes unique on each side of the pond for the same DRDB volume, because you have active nodes on both sides in the same DRDB volume. To restore the DRDB cluster, you will have to decide which side to keep, until then, the DRDB cluster is "broken" and running in standalone mode.

As I'm working though the mechanics of this, I realise that under normal circumstances I can move a single VM to the other node, and not move DRDB volume. But I would be putting myself at risk, when the cluster breaks while I have VMs on both nodes using the same DRDB volume. It would be best to move ALL VMs using a DRDM volume to the other node, so you again would be able to point to a single side, from which we will keep the changes. If you want to move all VMs for service for example, I guess that would be safe enough. You can also start all VMs on the other node, if a node is physically down, because again, you know all the recent changes are on one side or the other.

The thing you don't want, is some VMs on one node, and some on the other node, using the SAME DRDB volume, when the synchronisation breaks. Simply because you might be forced to make a choice which changes (certain VMs) you want to keep and which to discard (other VMs). If you want to move a VM permanently to the other node, you would need to storage migrate it to the other DRDB volume. This would also be the case, if you chose to use a single DRDB volume, as you were asking about.

Hope this helps... even though it is an old post.

The ultimate solution for this type of HA setup would be 3 nodes or some other tiebreaker, this also applies to Proxmox itself. With 3 you can have a majority to determine who is down and who is not, and you will be able to establish an automatic failover and recovery.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!