pcs resource master issue

Some years ago, I organized my resources according to the following scheme:

pcs resource create drbd_test ocf:linbit:drbd --group test drbd_resource=drbd_volume op monitor interval=60s
pcs resource master master_slave_drbd_test drbd_test master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
pcs resource create fs_test ocf:heartbeat:Filesystem --group test device="/dev/drbd1" directory="/var/www/test" fstype="ext4" op monitor interval=20s timeout=40s
pcs resource create ip_test ocf:heartbeat:IPaddr2 --group test ip=192.168.58.80 cidr_netmask=24 op monitor interval=45s timeout=30s
pcs constraint colocation add fs_test with master_slave_drbd_test INFINITY with-rsc-role=Master
pcs constraint order promote master_slave_drbd_test then start fs_test

But since PCS version 0.10.1, the “pcs resource master” (the second command from above) has been replaced by “pcs resource promotable”, as it says here pcs/CHANGELOG.md at main · ClusterLabs/pcs · GitHub can anyone help me convert these commands to the latest modern syntax?

Something like this should work:

pcs resource create drbd_test ocf:linbit:drbd --group test \
    drbd_resource=drbd_volume \
    op monitor interval="29s" role="Promoted" \
    op monitor interval="31s" role="Unpromoted"
pcs resource clone drbd_test promotable_drbd_test \
    promoted-max=1 promoted-node-max=1 promotable=true \
    clone-max=2 clone-node-max=1 notify=true
pcs resource create fs_test ocf:heartbeat:Filesystem --group test \
    device="/dev/drbd1" directory="/var/www/test" fstype="ext4" \
    op monitor interval=20s timeout=40s
pcs resource create ip_test ocf:heartbeat:IPaddr2 --group test \
    ip=192.168.58.80 cidr_netmask=24 \
    op monitor interval=45s timeout=30s
pcs constraint colocation add fs_test with promoted promotable_drbd_test
pcs constraint order promotable_drbd_test then fs_test
1 Like