Bug 740552

Summary: <altname ../> element validation is position dependent
Product: Red Hat Enterprise Linux 6 Reporter: Jaroslav Kortus <jkortus>
Component: clusterAssignee: Fabio Massimo Di Nitto <fdinitto>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2CC: ccaulfie, cluster-maint, jpayne, lhh, rpeterso, teigland
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cluster-3.0.12.1-26.el6 Doc Type: Bug Fix
Doc Text:
No Documentation needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:54:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 756082    

Description Jaroslav Kortus 2011-09-22 12:43:26 UTC
Description of problem:
<altname ../> element validation is position dependent
If it's the first element of <clusternode> then it works, if it's the last element there then it does not work.

Version-Release number of selected component (if applicable):
cman-3.0.12.1-21.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1. add <altname> as a first tag
2. ccs_config_validate
3. move the <altname> tag so that it's the last element of <clusternode>
4. ccs_config_validate
  
Actual results:
step 4 fails:
tempfile:15: element altname: Relax-NG validity error : Element clusternode has extra content: altname
tempfile:6: element clusternode: Relax-NG validity error : Element clusternodes has extra content: clusternode


Expected results:
Configuration validates


Additional info:
(07:35:20) [root@marathon-01:/etc/cluster]$ cat cluster.conf 
<?xml version="1.0"?>
<cluster name="marathon" config_version="1">
  <cman>
  </cman>
  <fence_daemon post_join_delay="20" clean_start="0"/>
  <clusternodes>
    <clusternode name="marathon-01" votes="1" nodeid="1">
      <fence>
        <method name="scsi">
          <device name="scsi_fence_dev"/>
        </method>
      </fence>
      <unfence>
        <device name="scsi_fence_dev" action="on"/>
      </unfence>
      <altname name="marathon-01-a"/>
    </clusternode>
  </clusternodes>
 <fencedevices>
    <fencedevice agent="fence_scsi" name="scsi_fence_dev" devices="/dev/disk/by-id/scsi-3600213a0ffffffff043a1c519a5c7601,/dev/disk/by-id/scsi-3600213a0ffffffff043a1c519a5c7600"/>
  </fencedevices>
</cluster>


(07:35:22) [root@marathon-01:/etc/cluster]$ ccs_config_validate 
tempfile:15: element altname: Relax-NG validity error : Element clusternode has extra content: altname
tempfile:6: element clusternode: Relax-NG validity error : Element clusternodes has extra content: clusternode
Configuration fails to validate


(07:35:37) [root@marathon-01:/etc/cluster]$ cat cluster.conf 
<?xml version="1.0"?>
<cluster name="marathon" config_version="1">
  <cman>
  </cman>
  <fence_daemon post_join_delay="20" clean_start="0"/>
  <clusternodes>
    <clusternode name="marathon-01" votes="1" nodeid="1">
      <altname name="marathon-01-a"/>
      <fence>
        <method name="scsi">
          <device name="scsi_fence_dev"/>
        </method>
      </fence>
      <unfence>
        <device name="scsi_fence_dev" action="on"/>
      </unfence>
    </clusternode>
  </clusternodes>
 <fencedevices>
    <fencedevice agent="fence_scsi" name="scsi_fence_dev" devices="/dev/disk/by-id/scsi-3600213a0ffffffff043a1c519a5c7601,/dev/disk/by-id/scsi-3600213a0ffffffff043a1c519a5c7600"/>
  </fencedevices>
</cluster>


(07:35:40) [root@marathon-01:/etc/cluster]$ ccs_config_validate 
Configuration validates

Comment 1 Fabio Massimo Di Nitto 2011-09-22 12:46:35 UTC
Targetting 6.3. A workaround exists and issue for a TP technology.

Comment 3 Fabio Massimo Di Nitto 2011-11-28 09:49:44 UTC
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=c39f49052a97fe2bdd5f46c29409676bd1783ed9

Unit test postpatch:

1) no altname

[root@clusternet-node2 ~]# ccs_config_validate 
Configuration validates
[root@clusternet-node2 ~]# 

2) altname on top

    <clusternode name="clusternet-node1-eth1" votes="1" nodeid="1">
      <altname name="clusternet-node1-eth2"/>
      <fence>
        <method name="single">
          <device name="xvm" domain="clusternet-node1"/>
        </method>
      </fence>
    </clusternode>

[root@clusternet-node2 ~]# ccs_config_validate 
Configuration validates

3) altname bottom

    <clusternode name="clusternet-node1-eth1" votes="1" nodeid="1">
      <fence>
        <method name="single">
          <device name="xvm" domain="clusternet-node1"/>
        </method>
      </fence>
      <altname name="clusternet-node1-eth2"/>
    </clusternode>

[root@clusternet-node2 ~]# ccs_config_validate 
Configuration validates
[root@clusternet-node2 ~]# 

4) altname mixed

    <clusternode name="clusternet-node1-eth1" votes="1" nodeid="1">
      <fence>
        <method name="single">
          <device name="xvm" domain="clusternet-node1"/>
        </method>
      </fence>
      <altname name="clusternet-node1-eth2"/>
      <unfence>
      </unfence>
    </clusternode>

Comment 5 Fabio Massimo Di Nitto 2012-05-02 07:19:50 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation needed

Comment 6 Justin Payne 2012-05-09 21:06:12 UTC
Verified in cman-3.0.12.1-28.el6:

[root@dash-03 ~]# cat /etc/cluster/cluster.conf 
<?xml version="1.0"?>
<cluster name="dash" config_version="1">
  <cman>
                </cman>
<logging debug="on"/>  
<fence_daemon post_join_delay="20" clean_start="0"/>
  <clusternodes>
    <clusternode name="dash-01" votes="1" nodeid="1">
      <fence>
        <method name="apc">
          <device name="link-apc" switch="2" port="2"/>
        </method>
      </fence>
        <altname name="dash-01-a"/>
    </clusternode>
    <clusternode name="dash-02" votes="1" nodeid="2">
      <fence>
        <method name="apc">
          <device name="link-apc" switch="2" port="3"/>
        </method>
      </fence>
    </clusternode>
    <clusternode name="dash-03" votes="1" nodeid="3">
      <fence>
        <method name="apc">
          <device name="link-apc" switch="2" port="4"/>
        </method>
      </fence>
    </clusternode>
  </clusternodes>
  <fencedevices>
    <fencedevice name="link-apc" agent="fence_apc" ipaddr="link-apc" login="apc" passwd="apc"/>
    <fencedevice name="di-1" agent="fence_ipmilan" ipaddr="dash-01-ipmi" login="root" passwd="password"/>
    <fencedevice name="di-2" agent="fence_ipmilan" ipaddr="dash-02-ipmi" login="root" passwd="password"/>
    <fencedevice name="di-3" agent="fence_ipmilan" ipaddr="dash-03-ipmi" login="root" passwd="password"/>
  </fencedevices>
</cluster>

[root@dash-03 ~]# rpm -q cman
cman-3.0.12.1-24.el6.x86_64
[root@dash-03 ~]# ccs_config_validate
tempfile:13: element altname: Relax-NG validity error : Element clusternode has extra content: altname
tempfile:7: element clusternode: Relax-NG validity error : Element clusternodes has extra content: clusternode
Configuration fails to validate

Same cluster.conf as above with updated packages:

[root@dash-03 ~]# rpm -q cman
cman-3.0.12.1-28.el6.x86_64
[root@dash-03 ~]# ccs_config_validate 
Configuration validates

1) No altname:

[root@dash-03 ~]# ccs_config_validate 
Configuration validates

2) altname on top:

<?xml version="1.0"?>
<cluster name="dash" config_version="1">
  <cman>
                </cman>
<logging debug="on"/>
<fence_daemon post_join_delay="20" clean_start="0"/>
  <clusternodes>
    <clusternode name="dash-01" votes="1" nodeid="1">
        <altname name="dash-01-a"/>
      <fence>
        <method name="apc">
          <device name="link-apc" switch="2" port="2"/>
        </method>
      </fence>
    </clusternode>

[root@dash-03 ~]# ccs_config_validate 
Configuration validates

3) altname bottom:

<?xml version="1.0"?>
<cluster name="dash" config_version="1">
  <cman>
                </cman>
<logging debug="on"/>
<fence_daemon post_join_delay="20" clean_start="0"/>
  <clusternodes>
    <clusternode name="dash-01" votes="1" nodeid="1">
      <fence>
        <method name="apc">
          <device name="link-apc" switch="2" port="2"/>
        </method>
      </fence>
        <altname name="dash-01-a"/>
    </clusternode>

[root@dash-03 ~]# ccs_config_validate 
Configuration validates

4) altname mixed:

<?xml version="1.0"?>
<cluster name="dash" config_version="1">
  <cman>
                </cman>
<logging debug="on"/>
<fence_daemon post_join_delay="20" clean_start="0"/>
  <clusternodes>
    <clusternode name="dash-01" votes="1" nodeid="1">
      <fence>
        <method name="apc">
          <device name="link-apc" switch="2" port="2"/>
        </method>
      </fence>
        <altname name="dash-01-a"/>
        <unfence>
        </unfence>
    </clusternode>

[root@dash-03 ~]# ccs_config_validate 
Configuration validates

Comment 8 errata-xmlrpc 2012-06-20 13:54:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0861.html