Bug 714841

Summary: fence_<agent> metadata behaviour and docs
Product: Red Hat Enterprise Linux 6 Reporter: Madison Kelly <mkelly>
Component: fence-agentsAssignee: Marek Grac <mgrac>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: cluster-maint, djansa, fdinitto, lhh, mjuricek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fence-agents-3.1.5-13.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 825667 (view as bug list) Environment:
Last Closed: 2012-06-20 14:39:58 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 Madison Kelly 2011-06-21 03:37:12 UTC
Description of problem:

This is more of a feature request/usage improvement ticket. It will try to cover a summary of all current fence agents in RHEL6, but should not be taken as exhaustive.

Currently, it seems like some fence agents do not implement the 'metadata' option in an ideal manner. For example, 'fence_ipmilan' requires an address in order to return the metadata XML. There is no need for this. Further, it's man page lists 'metadata' as an unknown action.

Most (all?) fence agents' man pages list 'metadata' as "The operational behaviour of this is not known."

I believe that a suitable description of this action would be:

"Returns the valid syntax, command line switches and usage notes in XML format. The cluster references this action's output when validating fence agent configuration."

The following agents do not seem to support the 'metadata' action at all. These agents can not be used (or at least, can't be validated) with the current cman or pacemaker given this. This should be updated or deprecated.

fence_brocade
fence_drac
fence_egenera
fence_na           - This is my agent, I will fix it asap.
fence_nss_wrapper  - Has no man page at all
fence_rsb

fence_scsi supports '-o metadata', but has no mention of it in it's man page at all.

fence_virt and fence_xvm *do* document '-o metadata', but it is minimal; "Print XML metadata to standard output."


Version-Release number of selected component (if applicable):

fence-agents-3.0.12-23.el6.x86_64
fence-virt-0.2.1-8.el6.x86_64


How reproducible:

100%

Steps to Reproduce:
1. try running 'fence_$agent -o metadata'
2. read the man pages for the same.
3.
  
Actual results:

The metadata action is not documented (or supported, in some cases)


Expected results:

Explain what metadata is for (and add it where needed)


Additional info:

Comment 3 Madison Kelly 2011-06-21 03:46:38 UTC
Ignore 'fence_nss_wrapper'; Not a fence agent.

Comment 7 Marek Grac 2011-11-24 13:31:50 UTC
Test suite:

cd fence/agents
for i in `ls */*pl`; do echo $i; perl $i -o metadata; done

[do not enter action; as there always should be default action]
perl baytech/fence_baytech -l user -p pass -a host -n 1
perl brocade/fence_brocade.pl -a host -l login -p pass -n 1
perl bullpap/fence_bullpap.pl -a host -l login -d domain -p pass
perl cpint/fence_cpint -u machine
perl drac/fence_drac -a host -l login -p pass
perl egenera/fence_egenera -c cs -l lpan -p pser
perl mcdata/fence_mcdata -l login -p pass -n 1 -a host
perl vixel/fence_vixel -n 1 -p pass -a host
perl xcat/fence_xcat -n node
perl zvm/fence_zvm -u userid -a host -p pass

New code was added to place where it should be tested by either first or second block of tests. Second block of tests should not fail with errors like 'unknown argument', 'operation not specified'. It is correct if it fails after arguments are checked e.g. 'hostname not found'. 

This testing does not need an access to all those fencing devices.

Comment 10 Marek Grac 2012-02-20 16:12:28 UTC
Unit test & results:

1) test metadata option

cd fence/agents
for i in `ls */*pl`; do echo $i; perl $i -o metadata; done

before:
metadata option is not available for most of the perl fence agents and they will either print error message or end without printing any problem

baytech/fence_baytech.pl
failed: must specify hostname
brocade/fence_brocade.pl
bullpap/fence_bullpap.pl
cpint/fence_cpint.pl
drac/fence_drac.pl
egenera/fence_egenera.pl
failed: no cserver defined
mcdata/fence_mcdata.pl
...


after:

metadata are correctly printed

baytech/fence_baytech.pl
<?xml version="1.0" ?>
<resource-agent name="fence_baytech" shortdesc="I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server" >
<longdesc>
This fencing agent is written for the Baytech RPC27-20nc in  combination  with  a Cyclades  terminal server. The Cyclades TS exports the RPC's seria
l port via a Telnet interface.  Other interfaces, such as SSH, are  possible. However, this script relies upon the assumption that Telnet is used.  

The  other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo    " are identical when the RPC prints them wit
h the status command.
</longdesc>
<vendor-url>http://www.baytech.net</vendor-url>
<parameters>
        <parameter name="action" unique="1" required="1">
                <getopt mixed="-o &lt;action&gt;" />
                <content type="string" default="disable" />
                <shortdesc lang="en">Fencing Action</shortdesc>
        </parameter>
...


2) 
perl baytech/fence_baytech -l user -p pass -a host -n 1
perl brocade/fence_brocade.pl -a host -l login -p pass -n 1
perl bullpap/fence_bullpap.pl -a host -l login -d domain -p pass
perl cpint/fence_cpint -u machine
perl drac/fence_drac -a host -l login -p pass
perl egenera/fence_egenera -c cs -l lpan -p pser
perl mcdata/fence_mcdata -l login -p pass -n 1 -a host
perl vixel/fence_vixel -n 1 -p pass -a host
perl xcat/fence_xcat -n node
perl zvm/fence_zvm -u userid -a host -p pass

Fence agents should not end with any difference in output against previous version. This should just test if there are no syntax errors and code works like before

Comment 14 errata-xmlrpc 2012-06-20 14:39:58 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-0943.html