[Pacemaker] Order of resources in a group and crm_diff

Vladislav Bogdanov bubble at hoster-ok.com
Tue Jan 28 11:11:54 UTC 2014


Hi all,

Just discovered, that when I add resource to a middle of
(running) group, it is added to the end.

I mean, if I update following (crmsh syntax)

group dhcp-server vip-10-5-200-244 dhcpd

with

group dhcp-server vip-10-5-200-244 vip-10-5-201-244 dhcpd

with 'crm configure load update', actual definition becomes

group dhcp-server vip-10-5-200-244 dhcpd vip-10-5-201-244

Also, strange enough, if I get XML CIB with cibadmin -Q, then edit
order of primitives with text editor, crm_diff doesn't show any differences:

cib-orig.xml:
...
      <group id="dhcp-server">
        <primitive id="vip-10-5-200-244" class="ocf" provider="heartbeat" type="IPaddr2">
          <instance_attributes id="vip-10-5-200-244-instance_attributes">
            <nvpair name="ip" value="10.5.200.244" id="vip-10-5-200-244-instance_attributes-ip"/>
            <nvpair name="cidr_netmask" value="32" id="vip-10-5-200-244-instance_attributes-cidr_netmask"/>
            <nvpair name="nic" value="vlan1" id="vip-10-5-200-244-instance_attributes-nic"/>
          </instance_attributes>
          <operations>
            <op name="start" interval="0" timeout="20" id="vip-10-5-200-244-start-0"/>
            <op name="stop" interval="0" timeout="20" id="vip-10-5-200-244-stop-0"/>
            <op name="monitor" interval="30" id="vip-10-5-200-244-monitor-30"/>
          </operations>
        </primitive>
        <primitive id="dhcpd" class="lsb" type="dhcpd">
          <operations>
            <op name="monitor" interval="10" timeout="15" id="dhcpd-monitor-10"/>
            <op name="start" interval="0" timeout="90" id="dhcpd-start-0"/>
            <op name="stop" interval="0" timeout="90" id="dhcpd-stop-0"/>
          </operations>
          <meta_attributes id="dhcpd-meta_attributes">
            <nvpair id="dhcpd-meta_attributes-target-role" name="target-role" value="Started"/>
          </meta_attributes>
        </primitive>
        <primitive id="vip-10-5-201-244" class="ocf" provider="heartbeat" type="IPaddr2">
          <instance_attributes id="vip-10-5-201-244-instance_attributes">
            <nvpair name="ip" value="10.5.201.244" id="vip-10-5-201-244-instance_attributes-ip"/>
            <nvpair name="cidr_netmask" value="24" id="vip-10-5-201-244-instance_attributes-cidr_netmask"/>
            <nvpair name="nic" value="vlan201" id="vip-10-5-201-244-instance_attributes-nic"/>
          </instance_attributes>
          <operations>
            <op name="start" interval="0" timeout="20" id="vip-10-5-201-244-start-0"/>
            <op name="stop" interval="0" timeout="20" id="vip-10-5-201-244-stop-0"/>
            <op name="monitor" interval="30" id="vip-10-5-201-244-monitor-30"/>
          </operations>
        </primitive>
      </group>
...

cib.xml:
...
     <group id="dhcp-server">
        <primitive id="vip-10-5-200-244" class="ocf" provider="heartbeat" type="IPaddr2">
          <instance_attributes id="vip-10-5-200-244-instance_attributes">
            <nvpair name="ip" value="10.5.200.244" id="vip-10-5-200-244-instance_attributes-ip"/>
            <nvpair name="cidr_netmask" value="32" id="vip-10-5-200-244-instance_attributes-cidr_netmask"/>
            <nvpair name="nic" value="vlan1" id="vip-10-5-200-244-instance_attributes-nic"/>
          </instance_attributes>
          <operations>
            <op name="start" interval="0" timeout="20" id="vip-10-5-200-244-start-0"/>
            <op name="stop" interval="0" timeout="20" id="vip-10-5-200-244-stop-0"/>
            <op name="monitor" interval="30" id="vip-10-5-200-244-monitor-30"/>
          </operations>
        </primitive>
        <primitive id="vip-10-5-201-244" class="ocf" provider="heartbeat" type="IPaddr2">
          <instance_attributes id="vip-10-5-201-244-instance_attributes">
            <nvpair name="ip" value="10.5.201.244" id="vip-10-5-201-244-instance_attributes-ip"/>
            <nvpair name="cidr_netmask" value="24" id="vip-10-5-201-244-instance_attributes-cidr_netmask"/>
            <nvpair name="nic" value="vlan201" id="vip-10-5-201-244-instance_attributes-nic"/>
          </instance_attributes>
          <operations>
            <op name="start" interval="0" timeout="20" id="vip-10-5-201-244-start-0"/>
            <op name="stop" interval="0" timeout="20" id="vip-10-5-201-244-stop-0"/>
            <op name="monitor" interval="30" id="vip-10-5-201-244-monitor-30"/>
          </operations>
        </primitive>
        <primitive id="dhcpd" class="lsb" type="dhcpd">
          <operations>
            <op name="monitor" interval="10" timeout="15" id="dhcpd-monitor-10"/>
            <op name="start" interval="0" timeout="90" id="dhcpd-start-0"/>
            <op name="stop" interval="0" timeout="90" id="dhcpd-stop-0"/>
          </operations>
          <meta_attributes id="dhcpd-meta_attributes">
            <nvpair id="dhcpd-meta_attributes-target-role" name="target-role" value="Started"/>
          </meta_attributes>
        </primitive>
      </group>
...

# crm_diff --original cib-orig.xml --new cib.xml

shows nothing.

And, 'cibadmin --replace --xml-file cib.xml' does nothing:

Jan 28 11:01:21 booter-0 cib[2693]:   notice: cib:diff: Diff: --- 0.427.2
Jan 28 11:01:21 booter-0 cib[2693]:   notice: cib:diff: Diff: +++ 0.427.19 df366a02885285cc95529f402bfdac12
Jan 28 11:01:21 booter-0 cib[2693]:   notice: cib:diff: --           <nvpair id="status-2-shutdown" name="shutdown" value="0"/>
Jan 28 11:01:21 booter-0 cib[2693]:   notice: cib:diff: ++ <cib epoch="427" num_updates="19" admin_epoch="0" validate-with="pacemaker-1.2" cib-last-written="Tue Jan 28 10:46:06 2014" update-origin="booter-0" update-client="cibadmin" crm_feature_set="3.0.8" have-quorum="1" dc-uuid="1"/>

But, after I do

# crm_shadow --create-empty myShadow
shadow[myShadow] # cibadmin -E --force
shadow[myShadow] # cibadmin --replace --xml-file cib.xml
shadow[myShadow] # crm_shadow --commit myShadow --force
Now type Ctrl-D to exit the crm_shadow shell
shadow[myShadow] # exit

group becomes defined in a proper order.

That's why the only suspect is xml-diff algorithm.

Andrew, David, could you please look?

Thank you,
Vladislav




More information about the Pacemaker mailing list