Bug 485065

Summary: fence_lpar doesn't work with hmc version 3
Product: [Retired] Red Hat Cluster Suite Reporter: Vadim Grinco <vgrinco>
Component: fenceAssignee: Jim Parsons <jparsons>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 4CC: cfeist, cluster-maint, edamato
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 485700 (view as bug list) Environment:
Last Closed: 2009-05-18 21:15:23 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: 485700    
Attachments:
Description Flags
Fencing library
none
Fence agent with support for HMC v3
none
Patched fence library none

Description Vadim Grinco 2009-02-11 13:41:40 UTC
Description of problem:
fence_lpar uses lssyscfg and chsysstate commands to get/change status of an lpar which are not available in earlier versions of IBM HMC (v3 doesn't work for sure)

How reproducible:
Try to fence an ibm-p4-01 on ppc-tucks.englab.brq.redhat.com

Actual results:
Script fails saying that there is a connection/logon problem

Expected results:
Fence the lpar

Additional info:
Need to add a parameter that will specify the hmc version fence_lpar is used with.
Something like -c 3.5 or -c 6.1 or at least major version (not sure since which one lssyscfg and chsysstate were introduced) to let fence_lpar know which commands to use inside.

Comment 1 Marek Grac 2009-02-16 14:05:59 UTC
Created attachment 332038 [details]
Fencing library

Comment 2 Marek Grac 2009-02-16 14:06:51 UTC
Created attachment 332039 [details]
Fence agent with support for HMC v3

You have to enter '-H 3' to set HMC version.

Comment 3 Vadim Grinco 2009-02-16 17:04:06 UTC
fence_lpar -a hmc-tucks -x -s pseries -n ibm-p4-01 -l <snip> -p <snip> -o
status
Failed: You have to enter valid version number: 3 or 4
Please use '-h' for usage

fence_lpar -h
<snip>
-H, --hmc-version=<version>   Force HMC version to use: 3, 4 (default)
</snip>

A bug? It should work without specifying hmc version. Other way it could break
lots of existing setups.

I also changed sys.path.append("@FENCEAGENTSLIBDIR@") to
sys.path.append("/usr/share/fence") for it to work.

Comment 4 Marek Grac 2009-02-18 10:26:56 UTC
Created attachment 332353 [details]
Patched fence library

Grr, -H should be optional but python distincts between 4 and "4" :( 
It should not broke anything as only v4+ was supported before. 

Changing of path is acceptable as I put there a devel code not a deployment where such things are handled but I should warn you :)

Comment 5 Vadim Grinco 2009-02-18 14:21:41 UTC
Any ideas?
I looks like it can't get the power status correctly...
 
$ ./fence_lpar.py -a hmc-tucks.englab.brq.redhat.com -l <snip> -p <snip> -H 3 -x -s pseries -n ibm-ps-01 -o off
Traceback (most recent call last):
  File "./fence_lpar.py", line 143, in <module>
    main()
  File "./fence_lpar.py", line 134, in main
    fence_action(conn, options, set_power_status, get_power_status, get_lpar_list)
  File "/home/chaos/Download/fencing.py", line 488, in fence_action
    status = get_power_fn(tn, options)
  File "./fence_lpar.py", line 33, in get_power_status
    status = re.compile("^" + options["-n"] + ",(.*?),.*$", re.IGNORECASE | re.MULTILINE).search(conn.before).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Comment 6 Marek Grac 2009-02-19 16:40:11 UTC
You have to enter existing name of machine (-n). Error message should be more clear - I will open a new bugzilla for it as this can be problem for several agents.

Comment 7 Vadim Grinco 2009-02-19 18:06:04 UTC
Thanks Marek,
Works great. You should probably do error handlers for this, and other type of messages...

Comment 10 errata-xmlrpc 2009-05-18 21:15:23 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1050.html