Bug 485065 - fence_lpar doesn't work with hmc version 3
fence_lpar doesn't work with hmc version 3
Product: Red Hat Cluster Suite
Classification: Red Hat
Component: fence (Show other bugs)
All Linux
high Severity medium
: ---
: ---
Assigned To: Jim Parsons
Cluster QE
Depends On:
Blocks: 485700
  Show dependency treegraph
Reported: 2009-02-11 08:41 EST by Vadim Grinco
Modified: 2009-05-18 17:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 485700 (view as bug list)
Last Closed: 2009-05-18 17:15:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fencing library (17.38 KB, application/octet-stream)
2009-02-16 09:05 EST, Marek Grac
no flags Details
Fence agent with support for HMC v3 (4.02 KB, application/octet-stream)
2009-02-16 09:06 EST, Marek Grac
no flags Details
Patched fence library (17.38 KB, application/octet-stream)
2009-02-18 05:26 EST, Marek Grac
no flags Details

  None (edit)
Description Vadim Grinco 2009-02-11 08:41:40 EST
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 09:05:59 EST
Created attachment 332038 [details]
Fencing library
Comment 2 Marek Grac 2009-02-16 09:06:51 EST
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 12:04:06 EST
fence_lpar -a hmc-tucks -x -s pseries -n ibm-p4-01 -l <snip> -p <snip> -o
Failed: You have to enter valid version number: 3 or 4
Please use '-h' for usage

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

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 05:26:56 EST
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 09:21:41 EST
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>
  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 11:40:11 EST
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 13:06:04 EST
Thanks Marek,
Works great. You should probably do error handlers for this, and other type of messages...
Comment 10 errata-xmlrpc 2009-05-18 17:15:23 EDT
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.


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