[Pacemaker] Drbd primary never on SyncTarget

Johan Verrept Johan.Verrept at able.be
Thu Sep 3 08:31:10 EDT 2009


Hello,

   I have been trying to keep my cluster from making the synctarget the
drbd primary, but I cannot get it to work. See the end of the email for
versions I use.
   I am using the heartbeat::drbd OCF RA. I had to patch it so it would
work with my drbd version (see below). As far as I can tell, the
attributes are correctly updated and the values adjusted when syncing
starts/ends. The values of the attribute seem to be 100 for the
SyncSource, 75 for normal operation and 10 for WFConnection and 5 for
anything else.
   I added the following location rules:

location ms-drbd0-master-never-on-synctarget-0 ms-drbd0 \
        rule $id="ms-drbd0-primary-never-on-synctarget-0-rule" \
	$role="Master" -inf: defined master-drbd0:0 and \
	master-drbd0:0 lt 10
location ms-drbd0-master-never-on-synctarget-1 ms-drbd0 \
        rule $id="ms-drbd0-primary-never-on-synctarget-1-rule" \
	$role="Master" -inf: defined master-drbd0:1 and \
	master-drbd0:1 lt 10

I found the master-drbd0:x attributes:

      <transient_attributes id="00963868-845b-4dc4-927b-ef8b86ea38b8">
        <instance_attributes
id="status-00963868-845b-4dc4-927b-ef8b86ea38b8">
          <nvpair
id="status-00963868-845b-4dc4-927b-ef8b86ea38b8-probe_complete"
name="probe_complete" value="true"/>
          <nvpair
id="status-00963868-845b-4dc4-927b-ef8b86ea38b8-master-drbd0:1"
name="master-drbd0:1" value="75"/>
        </instance_attributes>
      </transient_attributes>

and

      <transient_attributes id="d8481b1a-97a3-4852-89de-ec9ab1828b15">
        <instance_attributes
id="status-d8481b1a-97a3-4852-89de-ec9ab1828b15">
          <nvpair
id="status-d8481b1a-97a3-4852-89de-ec9ab1828b15-probe_complete"
name="probe_complete" value="true"/>
          <nvpair
id="status-d8481b1a-97a3-4852-89de-ec9ab1828b15-master-drbd0:0"
name="master-drbd0:0" value="75"/>
        </instance_attributes>
      </transient_attributes>

I am assuming these are in the status part of the cib because they have
a "reboot" lifetime.

The cluster still puts the drbd primary on the synctarget.
I also cannot read the node attribute from the cib:

# crm node attribute node1 show master-drbd0:1
scope=nodes  name=master-drbd0:1 value=(null)
Error performing operation: The object/attribute does not exist

(same if I try the other attribute)

Where am I going wrong?

Thanks for reading this far,

  Johan



drbd OCF RA patch:

In function drbd_get_status I patched the line:

DRBD_CSTATE=$(do_drbdadm cstate $RESOURCE)

to

DRBD_CSTATE=$(do_drbdadm cstate $RESOURCE | cut -d ' ' -f 1)

because the cstate command returns extra output when syncing and it
would always end up with DRBD_CSTATE "Unconfigured" because of the case
statement that follows (in the code).

Versions:

Pacemaker  1.0.4-6dede86d6105786af3a5321ccf66b44b6914f0aa
Heartbeat  2.99.2 (node: 7d5b329e13ca485b43826bfb80679ce6b9dc5324)
DRBD: version: 8.3.0 (api:88/proto:86-89) GIT-hash:
9ba8b93e24d842f0dd3fb1f9b90e8348ddb95829





More information about the Pacemaker mailing list