[Pacemaker] Order of resources in a group and crm_diff
Andrew Beekhof
andrew at beekhof.net
Wed Jan 29 05:44:25 UTC 2014
On 28 Jan 2014, at 10:11 pm, Vladislav Bogdanov <bubble at hoster-ok.com> wrote:
> 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"/>
Thats a known deficiency in the v1 diff format (and why we need costly digests to detect ordering changes).
Happily .12 will have a new and improve diff format that will handle this correctly.
>
> 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?
Its also partly how crmsh is using diffs.
It could be verifying the diff produces the correct result by verifying the above mentioned digest.
Or it could do a replace for the group instead...
>
> Thank you,
> Vladislav
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20140129/8c713608/attachment-0004.sig>
More information about the Pacemaker
mailing list