# DRBD M/S resource NOT migrating properly

**URL:** <https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536>\
**Category:** SLES High Availability Extension\
**Created:** [November 12, 2019, 8:12am UTC](https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536 "2019-11-12T08:12:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johngoutbeck](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@johngoutbeck](https://forums.suse.com/u/johngoutbeck)\
**Post date:** [November 12, 2019, 8:12am UTC](https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536/1 "2019-11-12T08:12:45Z")

</div>

SLES 15 SP1 + HA

2 node HA cluster setup for DRBD storage

Used HAWK Wizard to create a DRBD M/S resource. When this resource is started, it starts on both nodes with sn04 being the master/primary and sn03 as slave/secondary.

primitive drbd01 ocf:linbit:drbd \  
params drbd\_resource=drbd01 drbdconf="/etc/drbd.conf" \  
op monitor interval=29s role=Master \  
op monitor interval=31s role=Slave  
ms ms-drbd01 drbd01 \  
meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true

If migrated, sn03 becomes master/primary and the resource does not run on sn04. In fact a location constraint ban is made for this resource on sn04.

location cli-ban-ms-drbd01-on-sn04 ms-drbd01 role=Started -inf: sn04

If the location constraint is deleted or the resource is un-migrated then the M/S resource goes back to master/primary on sn04 and slave/secondary on sn03

SO, the question is;  
I would like to have the migrate just switch roles of the resource without any location constraint ban.  
Role switch of Master/Primary on sn04 and Slave/Secondary on sn03 → migrate to → Master/Primary on sn03 and Slave/Secondary on sn04.  
How can this be done?

---

<div class="post-metadata">

**Author:** ![Rich](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@Rich](https://forums.suse.com/u/Rich)\
**Post date:** [November 13, 2019, 3:23am UTC](https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536/2 "2019-11-13T03:23:17Z")

</div>

The cleanest method might be to set the primary node into “standby” → # crm node standby → or through HAWK  
This will stop all resources on this node and move everything over including promoting other node to drbd primary master.  
Once it’s done, then bring node back online → # crm node ready

---

<div class="post-metadata">

**Author:** ![johngoutbeck](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@johngoutbeck](https://forums.suse.com/u/johngoutbeck)\
**Post date:** [November 14, 2019, 2:11am UTC](https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536/3 "2019-11-14T02:11:09Z")

</div>

That may certainly work, but doesn’t solve the issue.  
Migrate of a M/S resource should switch the roles from M/S to S/M and not auto create a location constraint ban.

The DRBD M/S resources should be kept alive on both hosts to keep the replication going.  
Only on a standby or a server down should the DRDB M/S be in non-replication and then when brought back online be in replication

How can I stop the auto creation of a location constraint ban?

---

<div class="post-metadata">

**Author:** ![Rich](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@Rich](https://forums.suse.com/u/Rich)\
**Post date:** [November 14, 2019, 3:29am UTC](https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536/4 "2019-11-14T03:29:26Z")

</div>

[QUOTE=johngoutbeck;58855]That may certainly work, but doesn’t solve the issue.  
Migrate of a M/S resource should switch the roles from M/S to S/M and not auto create a location constraint ban.

The DRBD M/S resources should be kept alive on both hosts to keep the replication going.  
Only on a standby or a server down should the DRDB M/S be in non-replication and then when brought back online be in replication

How can I stop the auto creation of a location constraint ban?[/QUOTE]

The constraint is how the cluster decides where to place the resource. The cli-ban constraint normally get’s created when a “node name” location is not provided so it’s essentially moving the resource away from a node with the “-inf” location constraint.  
If you use "crm resource migrate " it will create the cli-location constraint with a “inf” of the specified so it will prefer this node.

If you don’t want any constraints, then you need to use the cluster standby mode which is only in standby mode for the time it takes for resources to move over and then you can mark the node back online to start resources again which will start the replication again. This is normally done in less than a minute.

---

<div class="post-metadata">

**Author:** ![johngoutbeck](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@johngoutbeck](https://forums.suse.com/u/johngoutbeck)\
**Post date:** [November 14, 2019, 4:45pm UTC](https://forums.suse.com/t/drbd-m-s-resource-not-migrating-properly/34536/5 "2019-11-14T16:45:37Z")

</div>

## Following your advice Created location constraint location l-drbd01 ms-drbd01 3000: sn03 This ensures the M/S resource runs on the designated host

## Master/Slave Set: ms-drbd01 [drbd01] Masters: [sn03] Slaves: [sn04]

then use the cli to migrate  
sn03:~ # crm resource migrate ms-drbd01 sn04  
INFO: Move constraint created for ms-drbd01 to sn04

- switched the roles from M/S to S/M and auto created a prefer location constraint ( with infinity) overriding the manuel location contraint with a score of 3000  
–  
Master/Slave Set: ms-drbd01 [drbd01]  
Masters: [sn04]  
Slaves: [sn03]  
–

now 2 location constraints  
location cli-prefer-ms-drbd01 ms-drbd01 role=Started inf: sn04  
location l-drbd01 ms-drbd01 3000: sn03

HAWK unmigrate moves the resource back (and auto deletes the prefer location constraint)  
or deleting the location cli-prefer-ms-drbd01 moves the resource back on sn03 (either through HAWK ir cli)

– cli unmigrate  
crm resource unmigrate ms-drbd01  
INFO: Removed migration constraints for ms-drbd01  
– cli delete prefer location constraint  
crm configure delete cli-prefer-ms-drbd01

So this works in keeping the replication going on the 2 hosts.

Thank you for your help.  
Hope this helps others.
