IPMI power manager hangs when the password is empty.

Bug #1237802 reported by Ryota Mibu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Undecided
Unassigned
OpenStack Compute (nova)
Fix Released
High
Ryota Mibu

Bug Description

While creating Baremetal Node by `nova baremetal-node-create' with --pm_password '' [1] and starting a deployment, IPMI power manager hangs with showing prompt "Password:" in nova-compute process. IPMI power manager creates an empty file and specifies it as the password file in the ipmitool command line, but ipmitool ignores that file [2].

This is an uncommon case that an administrator set password empty, but this is not a low importance bug due to it stops the thread.

I think we can avoid this bug by writing '\0' into the password file [3], since ipmitool checks return value of fgets() is not NULL which means the file is not start with EOF and no error had occurred.

[1] e.g.:
    $ nova baremetal-node-create --pm_address 192.0.2.200 --pm_user admin --pm_password '' service-host 1 1000 10000 00:11:22:33:44:55

[2] In ipmitool manpage:
    -f <password_file>
        Specifies a file containing the remote server password. If this option is absent, or if password_file is empty, the password will default to NULL.

[3] I checked that ipmitool works with a file containing '\0';
    # touch a
    # ipmitool -I lanplus -H 192.0.2.94 -f a -U administrator power status
    Unable to read password from file a
    Unable to read password from file a
    Password: <-- Enter
    Chassis Power is off
    # echo -ne '\0' > b
    # ipmitool -I lanplus -H 192.0.2.94 -f b -U administrator power status
    Chassis Power is off

Tags: baremetal
Revision history for this message
Robert Collins (lifeless) wrote :

That approach, while terrible, seems plausible ;). Want to send in a patch?

Changed in nova:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Dan Prince (dan-prince) wrote :

lifeless: There is already a patch for this:

https://review.openstack.org/#/c/51121/

Not sure why it didn't get linked. In the last few weeks there have been quite a few unlinked patches...

Changed in nova:
status: Triaged → In Progress
Ryota Mibu (r-mibu)
summary: - IPMI power manager hangs up when the password is empty.
+ IPMI power manager hangs when the password is empty.
description: updated
Ryota Mibu (r-mibu)
Changed in nova:
assignee: nobody → Ryota Mibu (r-mibu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to ironic (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/53832

Ryota Mibu (r-mibu)
Changed in ironic:
status: New → Opinion
Revision history for this message
Ryota Mibu (r-mibu) wrote :

This problem does not occur in Ironic. The ipmitool module ignores empty string as "ipmi_password" and raises exception.InvalidParameterValue before executing ipmitool.

Empty password and empty username are options of IPMI, so it's nice to support them in ironic and tripleO.

Revision history for this message
aeva black (tenbrae) wrote :

I'm marking this as Invalid for Ironic because it is presently not possible for the ipmitool driver to accept an empty string for either username or password -- as Ryota pointed out, such values will cause the driver to raise an InvalidParameterValue exception.

I will open a separate bug to indicate the desired functionality -- that is, to accept empty username or password.

Changed in ironic:
status: Opinion → Invalid
Revision history for this message
aeva black (tenbrae) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/51121
Committed: http://github.com/openstack/nova/commit/e936cac67612015e1123b4539a60ec1aa1b1ff82
Submitter: Jenkins
Branch: master

commit e936cac67612015e1123b4539a60ec1aa1b1ff82
Author: Ryota MIBU <email address hidden>
Date: Fri Oct 11 13:54:37 2013 +0900

    Fix power manager hangs while executing ipmitool

    In nova/virt/baremetal, IPMI power manager uses ipmitool with '-F' option to
    specify a file containing the remote server password. When the passowrd was
    empty, ipmitool ignores that file and asks user to set password in stdin.
    This makes the thread stop.

    This patch changes power manager to write '\0' to the password file in the
    case of empty password, to force the password on impitool.

    Closes-bug: #1237802

    Change-Id: I44f56129a8ce2af4dda8dea35eb9c60d9518d54b

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.