RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 866894 - ccs is creating invalid cluster.conf
Summary: ccs is creating invalid cluster.conf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ricci
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Chris Feist
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 881827
TreeView+ depends on / blocked
 
Reported: 2012-10-16 09:30 UTC by michal novacek
Modified: 2013-02-21 10:47 UTC (History)
6 users (show)

Fixed In Version: ccs-0.16.2-57.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 10:47:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix issue (1.05 KB, patch)
2012-11-13 00:02 UTC, Chris Feist
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0453 0 normal SHIPPED_LIVE ricci bug fix and enhancement update 2013-02-20 21:07:44 UTC

Description michal novacek 2012-10-16 09:30:16 UTC
Description of problem: 
trying to add resource with ccs will fail and if forced it will result in
invalid cluster.conf

Version-Release number of selected component (if applicable):
ccs-0.16.2-56.el6.x86_64 
rhel6.3 

How reproducible: always

Steps to Reproduce:
$ ccs -f /tmp/c --getconf
<cluster config_version="8" name="STSRHTS24386">  
    <cman/>  
    <totem token="3000"/>  
    <fence_daemon clean_start="0" post_join_delay="20"/>  
    <clusternodes>    
        <clusternode name="rhel6-node01" nodeid="1" votes="1">      
            <fence>        
                <method name="virt">          
                    <device domain="rhel6-node01" name="xvm"/>          
                </method>        
            </fence>      
        </clusternode>    
        <clusternode name="rhel6-node02" nodeid="2" votes="1">      
            <fence>        
                <method name="virt">          
                    <device domain="rhel6-node02" name="xvm"/>          
                </method>        
            </fence>      
        </clusternode>    
        <clusternode name="rhel6-node03" nodeid="3" votes="1">      
            <fence>        
                <method name="virt">          
                    <device domain="rhel6-node03" name="xvm"/>          
                </method>        
            </fence>      
        </clusternode>    
    </clusternodes>  
    <fencedevices>    
		<fencedevice agent="fence_xvm" auth="sha256" hash="sha256"
		key_file="/etc/cluster/fence_xvm.key" name="xvm" timeout="5"/>    
    </fencedevices>  
</cluster>
$ ccs -f /tmp/c --addresource lvm
Validation Failure, unable to modify configuration file (use -i to ignore this \
error).
$ ccs -f /tmp/c --addresource lvm -i
$ ccs -f /tmp/c --getconf
Cluster.conf file specified is not a valid cluster.conf file (use -i to ignore \
this error)
  
Actual results: 
<resource> tag is created incorrectly:
	--not creating itself inside <rm> if <rm> is not created yet
	--not puting itself inside already existing <rm> 

Expected results:
Created cluster.conf validates.

Comment 2 Lon Hohberger 2012-11-12 14:51:35 UTC
Here's the result from doing the above:

<cluster config_version="9" name="STSRHTS24386">
  <cman/>
  <totem token="3000"/>
  <fence_daemon clean_start="0" post_join_delay="20"/>
  <clusternodes>
    <clusternode name="rhel6-node01" nodeid="1" votes="1">
      <fence>
        <method name="virt">
          <device domain="rhel6-node01" name="xvm"/>
        </method>
      </fence>
    </clusternode>
    <clusternode name="rhel6-node02" nodeid="2" votes="1">
      <fence>
        <method name="virt">
          <device domain="rhel6-node02" name="xvm"/>
        </method>
      </fence>
    </clusternode>
    <clusternode name="rhel6-node03" nodeid="3" votes="1">
      <fence>
        <method name="virt">
          <device domain="rhel6-node03" name="xvm"/>
        </method>
      </fence>
    </clusternode>
  </clusternodes>
  <fencedevices>
    <fencedevice agent="fence_xvm" auth="sha256" hash="sha256" key_file="/etc/cluster/fence_xvm.key" name="xvm" timeout="5"/>
  </fencedevices>
  <resources>  <!-- this should be in a rm block, but isn't -->
    <lvm/>
  </resources>
</cluster>

Reproduced on ccs-0.16.2-56.el6.x86_64

(Note that adding an lvm resource with no parameters will also generate an invalid cluster.conf, as there is at least one required attribute)

Comment 3 Chris Feist 2012-11-13 00:02:44 UTC
Created attachment 643822 [details]
Patch to fix issue

Comment 4 Chris Feist 2012-11-13 00:06:57 UTC
Looks like there are two issues, first the correct syntax for using --addresource with lvm should be the following:

ccs -f cluster.conf --addresource lvm name=lvm_resource_name vg_name=my_vg_name


2nd, there's a bug in ccs which doesn't properly create the rm & resources section of the xml if the resources section doesn't exist.  I've fixed this bug and attached it to the bz.

This issue is easy to replicate.  Start with the cluster.conf from Comment #1 and run 'ccs -f cluster.conf --addresource lvm name=lvm_resource_name vg_name=my_vg_name'

Before the patch you'll get an error, after the patch you won't.

I'm not sure how critical this is for 6.4 since there is a workaround.

Workaround:
Add '<rm><resources></resources></rm>' at the end of the cluster.conf before '</cluster>'

Comment 6 Chris Feist 2012-11-15 22:15:52 UTC
Before Fix:
[root@ask-02 ~]# cat testclusterfile 
<cluster config_version="1" name="clus">
  <fence_daemon/>
  <clusternodes/>
  <cman/>
  <fencedevices/>
</cluster>
[root@ask-02 ~]# ccs -f testclusterfile --addresource lvm name=lvm_resource_name vg_name=my_vg_name
Validation Failure, unable to modify configuration file (use -i to ignore this error).


After Fix:
[root@ask-02 ~]# rpm -q ccs
ccs-0.16.2-57.el6.x86_64
[root@ask-02 ~]# ccs -f testclusterfile --addresource lvm name=lvm_resource_name vg_name=my_vg_name
[root@ask-02 ~]# cat testclusterfile
<cluster config_version="2" name="clus">
  <fence_daemon/>
  <clusternodes/>
  <cman/>
  <fencedevices/>
  <rm>
    <resources>
      <lvm name="lvm_resource_name" vg_name="my_vg_name"/>
    </resources>
  </rm>
</cluster>

Comment 10 errata-xmlrpc 2013-02-21 10:47:51 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-2013-0453.html


Note You need to log in before you can comment on or make changes to this bug.