Bug 485065 - fence_lpar doesn't work with hmc version 3
Summary: fence_lpar doesn't work with hmc version 3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: fence
Version: 4
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Jim Parsons
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 485700
TreeView+ depends on / blocked
 
Reported: 2009-02-11 13:41 UTC by Vadim Grinco
Modified: 2009-05-18 21:15 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 485700 (view as bug list)
Environment:
Last Closed: 2009-05-18 21:15:23 UTC
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1050 0 normal SHIPPED_LIVE Fence bug-fix and enhancement update 2009-05-18 21:15:16 UTC

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


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