Replace backtick command substitutions with $(), quote variable
expansions to prevent word splitting, replace useless cat pipes with
redirections, use grep -q instead of redirecting to /dev/null, and use
bash parameter expansion for case conversion.
Based on the work from PR #6366, rebased and adapted to current master.
Shebangs already merged separately via df64bf8fe are excluded.
Co-Authored-By: Samveen <samveen@yahoo.com>
bmcsetup iterated every user slot and retried ipmitool user disable for slots that were already disabled. Lenovo XCC reports those attempts as Invalid data field in request, so discovery can spend minutes retrying no-op disables.
Read the current user table once per BMC, keep the old fallback when the table cannot be read, and disable only non-target slots whose IPMI Msg flag is true. Also use the loop's current username when resolving the target slot and keep the intended userslot 2 fallback assignment.
Fixesxcat2/xcat-core#5065
Add optional values to ipmi.bmcport to support more fine-grained
configuration for Dell servers, and mirror the `ipmitool delloem`
capabilities:
lan set <Mode>
sets the NIC Selection Mode :
dedicated, shared with lom<idx>
lan set <Shared Failover Mode>
sets the shared Failover Mode :
shared with failover lom<idx>
shared with failover all loms,
shared with failover none.
This patch introduces the possibility to provide 3 (space-separated)
values for ipmi.bmcport:
1st value: 0 = shared / 1 = dedicated
2nd value shared LOM (1-4) (0 or no value means first available LOM)
3rd value: failover LOM (1-4) (0 means no failover, no value means all LOMs)
To ensure maximum compatibility with the default 0/1 shared/dedicated
scheme, the 2nd and 3rd values are optional, and will retain the
previous behavior when not specified.
Examples:
ipmi.bmcport value BMC interface configuration
0 Shared with first available interface, failover with
all LOMs (catch-all mode)
0 1 Shared with LOM1, failover all LOMs
0 1 2 Shared with LOM1, failover LOM2
0 2 0 Shared with LOM2, no failover
1 Dedicated
* bmcsetup: revert previous meaning of bmcport for Dell servers, to
conform with other server types: 0=shared, 1=dedicated
* bmcsetup: remove dependency on `ipmitool delloem` and use raw cmds instead
ipmitool delloem may not work on all Dell server generations,
functionnality depends on ipmitool versions (see
https://github.com/ipmitool/ipmitool/issues/18).
So removing thatdependency and using raw IPMI commands seems more robust.
Don't check $LOCKEDUSERS at all, instead fall back to userslot 2 as a last resort if the user doesn't already exist, and the automatic slot detection doesn't find an unlocked slot. This is essentially what was happening in the older version of the script before #6380 as $LOCKEDUSERS was only ever referenced here.
Also move setting the username before setting privileges and access levels, as those steps fail if done before username is set for the slot.
Instead of relying on hard coded offsets, query each slot's status with ```ipmitool channel getaccess``` and use the first slot that is unlocked.
This fixes an issue on certain Cray x86 nodes that have arbitrary locked IPMI user slots.
* Add ondiscover support for chain table
* For ondiscover, run nextdestiny after the current operation is done
* Don't set OpenPower server boot from network if boot
- zvmdiscovery plugin will not handle findme
- not change request if no temp discovered bmc nodes, to avoid the confusing error message
- add more logs, and ignore the `ipmitool sol info` error output