Bug 1272570

Summary: clufter does not add resource operations (monitor, start) to converted resource into cib.xml
Product: Red Hat Enterprise Linux 7 Reporter: Miroslav Lisik <mlisik>
Component: clufterAssignee: Jan Pokorný [poki] <jpokorny>
Status: CLOSED UPSTREAM QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: slevine
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
ccs2pcs conversion now properly propagates or adds monitor action.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-16 17:50:47 UTC Type: Bug
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: 1269964, 1343661    
Attachments:
Description Flags
configuration file cluster.conf with apache resource none

Description Miroslav Lisik 2015-10-16 19:03:06 UTC
Created attachment 1083797 [details]
configuration file cluster.conf with apache resource

Description of problem:
Converted resource has no start/monitor operations in cib.xml.

Version-Release number of selected component (if applicable):
clufter-cli-0.50.4-1.el7.noarch

How reproducible:
always


Steps to Reproduce:

1. Convert attached configuration file with apache resource using clufter. 
2. Check the resulting cib.xml file for operations.

Actual results:

The resulting cib file contains only stop operation:
<operations>
    <op id="RESOURCE-apache-webserver-OP-stop" name="stop" interval="0" timeout="0s"/>
</operations>

Expected results:

The resulting cib file contains start, stop and monitor operations:
<operations>
          <op id="webserver-start-interval-0s" interval="0s" name="start" timeout="40s"/>
          <op id="webserver-stop-interval-0s" interval="0s" name="stop" timeout="60s"/>
          <op id="webserver-monitor-interval-10" interval="10" name="monitor" timeout="20s"/>
</operations>


Additional info:
http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html#_resource_operations
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/High_Availability_Add-On_Reference/index.html#s1-resourceoperate-HAAR

Comment 2 Jan Pokorný [poki] 2015-12-16 17:50:47 UTC
Thanks for the report.

Should be fixed upstream as of
https://pagure.io/clufter/db80d13dd3dffbcda6a4c5aac2c9c7e5605efac4

This is planned for new (soonish) release.

Comment 3 Jan Pokorný [poki] 2016-10-10 13:27:25 UTC
Note this is addressed in RHEL 6.8 through rebase ([bug 1269964])
+ in RHEL 7.3 also through rebase ([bug 1343661]).

Comment 4 Miroslav Lisik 2016-10-10 16:35:08 UTC
[root@virt-101 ~]# rpm -q clufter-cli
clufter-cli-0.59.5-2.el7.noarch

ccs2pcs-flatirion/ccs2pcs-needle for apache and ip resource:

[root@virt-101 ~]# cat cluster-apache.conf 
<?xml version="1.0"?>
<cluster name="test" config_version="1">

  <clusternodes>
  </clusternodes>

  <fencedevices>
  </fencedevices>

  <rm>
   <failoverdomains/>
   <resources>
	 <ip address="10.34.71.228/23" monitor_link="yes" sleeptime="10"/>
	 <apache config_file="conf/httpd.conf" name="webserver" server_root="/etc/httpd" shutdown_wait="0"/>
   </resources>
   <service autostart="1" name="webserver" recovery="relocate">
	 <ip ref="10.34.71.228/23"/>
	 <apache ref="webserver"/>
   </service>
  </rm>
</cluster>
[root@virt-101 ~]# clufter ccs2pcs-needle --input=cluster-apache.conf --cib=cib-apache.xml
[ccs2needlexml        ] xslt: WARNING: secret key used by corosync for encryption/integrity checking is, as a measure to prevent from dropping these security features entirely, stored directly in the main configuration file (totem/key), possibly readable by arbitrary system-local user
[xml2simpleconfig     ] output: corosync-a7363234.conf
[cibcompact2cib       ] xslt: NOTE: no fencing is configured hence stonith is disabled; please note, however, that this is suboptimal, especially in shared storage scenarios
[cib2cibfinal         ] output: cib-apache.xml
[root@virt-101 ~]# clufter ccs2pcs-flatiron --input=cluster-apache.conf --cib=cib-apache-flatiron.xml
[ccs-version-bump     ] output: cluster-a7363234.conf
[cibcompact2cib       ] xslt: NOTE: no fencing is configured hence stonith is disabled; please note, however, that this is suboptimal, especially in shared storage scenarios
[cib2cibfinal         ] output: cib-apache-flatiron.xml
[root@virt-101 ~]# diff -ur cib-apache.xml cib-apache-flatiron.xml 
[root@virt-101 ~]# grep monitor cib-apache.xml 
			<op id="RESOURCE-ip-10.34.71.228_23-OP-monitor" name="monitor" interval="20s"/>
			<op id="RESOURCE-apache-webserver-OP-monitor" name="monitor" interval="60s"/>

> OK. Both resources have a monitor operation.

ccs2pcs-flatirion/ccs2pcs-needle for mysql resource:

[root@virt-101 ~]# cat cluster-mysql.conf 
<?xml version="1.0"?>
<cluster name="test" config_version="1">

  <clusternodes>
  </clusternodes>

  <fencedevices>
  </fencedevices>

  <rm>
	<failoverdomains/>
	<resources/>
	<service name="mysql" recovery="relocate">
		<mysql config_file="/etc/oh-my.cnf" listen_address="0.0.0.0" mysqld_options="--verbose" name="oh-my" shutdown_wait="34" startup_wait="12"/>
	</service>
  </rm>
</cluster>
[root@virt-101 ~]# clufter ccs2pcs-needle --input=cluster-mysql.conf --cib=cib-mysql.xml
[ccs2needlexml        ] xslt: WARNING: secret key used by corosync for encryption/integrity checking is, as a measure to prevent from dropping these security features entirely, stored directly in the main configuration file (totem/key), possibly readable by arbitrary system-local user
[xml2simpleconfig     ] output: corosync-fa470f0b.conf
[cibcompact2cib       ] xslt: NOTE: no fencing is configured hence stonith is disabled; please note, however, that this is suboptimal, especially in shared storage scenarios
[cib2cibfinal         ] output: cib-mysql.xml
[root@virt-101 ~]# clufter ccs2pcs-flatiron --input=cluster-mysql.conf --cib=cib-mysql-flatiron.xml
[ccs-version-bump     ] output: cluster-fa470f0b.conf
[cibcompact2cib       ] xslt: NOTE: no fencing is configured hence stonith is disabled; please note, however, that this is suboptimal, especially in shared storage scenarios
[cib2cibfinal         ] output: cib-mysql-flatiron.xml
[root@virt-101 ~]# diff -ur cib-mysql.xml cib-mysql-flatiron.xml 
[root@virt-101 ~]# grep monitor cib-mysql.xml 
			<op id="RESOURCE-mysql-oh_my-OP-monitor" name="monitor" interval="60s"/>

> OK. Resource has a monitor operation.