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.
Created attachment 332038 [details] Fencing library
Created attachment 332039 [details] Fence agent with support for HMC v3 You have to enter '-H 3' to set HMC version.
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.
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 :)
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'
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.
Thanks Marek, Works great. You should probably do error handlers for this, and other type of messages...
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