Comment 0 for bug 1237802

Revision history for this message
Ryota Mibu (r-mibu) wrote : IPMI power manager hangs up when the password is empty.

While creating Baremetal Node by `nova baremetal-node-create' with --pm_password '' [1] and starting a deployment, IPMI power manager hangs up 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 -e '\0' > b
    # ipmitool -I lanplus -H 192.0.2.94 -f b -U administrator power status
    Chassis Power is off