LINBIT / linstor-proxmox

Integration pluging bridging LINSTOR to Proxmox VE
31 stars 7 forks source link

DrbdOptions/Net/allow-two-primaries is yes by default #47

Closed albe190290 closed 2 years ago

albe190290 commented 2 years ago

Hello, in commit https://github.com/LINBIT/linstor-proxmox/commit/0fbe3f4dc53eaab91b7c4af434297c579b9c3217

option DrbdOptions/Net/allow-two-primaries was set to yes by default. Is it safe when used with ext3, ext4, XFS etc?

rck commented 2 years ago

It is completely unsafe if you really write data on 2 nodes concurrently. But that should never ever happen as usually the VM is only started on 1 node, so allow-two-primaries does not matter. So why does it even exist? Because it is required for live-migration. There the device really is active on 2 nodes, but Proxmox/qemu make sure that it is only written on 1 node. This will be the source of live migration, and then the target, but never source + target concurrently. If (and I would not know how) we as plugin would get a callback for "live migration starts" and "live migration ends", then we would enable it selectively during that period, but AFAK we as plugin don't get that information, so we just enable it. We enable it but don't use it (except during live migration).

tl;tr: that is fine (and required), as long as everybody plays according to the rules

albe190290 commented 2 years ago

But what will be if current primary node will lost quorum? In this situation is it possible that proxmox ha-manager will run another primary node? Is it possible not to set this option for LXC containters?

rck commented 2 years ago

It is set at creation time, and not touched later, so if you don't trust it, you can always unset it via the linstor command line client. At the cost that live migration will not work. Or you change the plugin code. I would like to say "patches welcome", but really, it is there for years (years before the commit you referenced) without any problems. If you think there is a problem, or you don't trust the ha-manager to do funny things, then patch your local plugin accordingly, thanks.

albe190290 commented 2 years ago

Will do our local patch. Thanks. I just wanted to clarify your opinion.