Project

General

Profile

Actions

Bug #25933

open

User is not created with bmc_nic_setup snippet

Added by Fabien Brachere over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
BMC
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

If the user is absent from the IPMI user list, the script try to create it with the following command:

ipmitool user set name ${ipmi_user_id} <%= bmc_nic.username %>

where ipmi_use_id is defined by:
ipmi_user_id=$[$(ipmitool user list <%= channel_id %> | tail -n 1 | cut -d ' ' -f1)+1]

On my environnement (iDrac 8), the command:
ipmitool user list <%= channel_id %> | tail -n 1 | cut -d ' ' -f1

always returns 16
because of:
# ipmitool user list 1
ID  Name         Callin  Link Auth    IPMI Msg   Channel Priv Limit
1                    true    false      false      NO ACCESS
2   root             true    true       true       ADMINISTRATOR
3   bmprov           true    true       true       OPERATOR
4   maas             true    false      true       ADMINISTRATOR
5                    true    true       true       NO ACCESS
6                    true    false      false      NO ACCESS
7                    true    false      false      NO ACCESS
8                    true    false      false      NO ACCESS
9                    true    false      false      NO ACCESS
10                   true    false      false      NO ACCESS
11                   true    false      false      NO ACCESS
12                   true    false      false      NO ACCESS
13                   true    false      false      NO ACCESS
14                   true    false      false      NO ACCESS
15                   true    false      false      NO ACCESS
16                   true    false      false      NO ACCESS

I suggest to change the definition of the ipmi_user_id with:

ipmi_user_id=$[$(ipmitool user list <%= channel_id %> | grep -v 'NO ACCESS$' | tail -n 1 | cut -d ' ' -f1)+1]

So, we take the first available id with "NO ACCESS". It's not optimal because we can have a user already defined with "NO ACCESS" but it will work in most cases.

No data to display

Actions

Also available in: Atom PDF