#2716 getting password is wrong for blade, and ppc


Today, a customer reported that upgrading from 2.6.10 to 2.7 broke his cluster. He has IBM BladeCenter H with HS22 servers. After the upgrade, every r* command failed with the following error:

rpower/rscan/r* <node>

<node>: Error: Unknown user name

We found out that the problem is in blade.pm where it is looking for the username and password for a mpa. The code looks like this:
($ent)=$mpatab->getNodeSpecAttribs($mpa, {username=>"USERID"},qw(username password));
First, it should not assume that the username is always USERID for a mpa. In fact, most users change this default username on blade center AMM. Second a new Table function getNodeSpecAttribs is introduced here. We should try not to introduce new Table function without reviewing from the group. So please remove this Table function and use getNodeAttribs instead. So the logic should be:
use getNodeAttribes to get all the rows from mpa table for this mpa.
If there is only one row returned, then use it
if there there are mutiple rows returned, use the one with username=USERID.
if there is no row with username=USERID, then use the first one. (this can be discussed.)
If no row returned, use passwd table.

We have searched the places where getNodeSpecAttribs is used and found that there are 2 in blade.pm and 2 in PPCdb.pm. Please fix them all.


  • Ling

    Ling - 2012-03-22

    Should use getNodesAttribs (not getNodeAttribs) to get all the entries for a mpa. Like this:
    $result=$tab->getNodesAttribs(["c98m6hmc01"], ["username", "password"]);

  • Guang Cheng Li

    Guang Cheng Li - 2012-03-23

    Er Tao, please work on this bug and provide an efix if possible.

  • zhao er tao

    zhao er tao - 2012-03-23

    I had fixed this bug with SVN revision 11956. I had modified the code in blade.pm where get password for telnet from 'mpa' table. The modification is like this: if the 'username' attribute of (username,password) pair match 'USERID' or do not match 'HMC'/'general'/'admin' which are used in DFM, the pair will be returned.
    If face, the function getNodeSpecAttribs is the combine of getNodeAttribs and getAttribs, it support getting attributes from the group of the node. So I did not modify the other 3 place that used getNodeSpecAttribs.

  • Lissa Valletta

    Lissa Valletta - 2012-03-23

    I am glad the customer problem is fixed. It is necessary for you to remove getNodeSpecAttribs from Table.pm. and change as Ling suggests below for the next 2.7 release. I will send you a note explaining the reason.

  • Lissa Valletta

    Lissa Valletta - 2012-03-23

    Workaround is to add the password entry to the password table.

  • Lissa Valletta

    Lissa Valletta - 2012-03-23

    blade plugin

  • Lissa Valletta

    Lissa Valletta - 2012-03-23

    Attached blade.pm fixes problem (2.7)
    To put on system
    cd /opt/xcat/lib/perl/xCAT_plugin
    cp blade.pm blade.pm.org
    put attached blade.pm to replace
    service xcatd restart