Skip to content

Commit d2378d8

Browse files
authored
Merge pull request #7469 from stanford-rc/dell_bmcport
Provide more options to setup BMC port for Dell servers
2 parents 39664c5 + 8092f31 commit d2378d8

File tree

2 files changed

+64
-35
lines changed

2 files changed

+64
-35
lines changed

perl-xCAT/xCAT/Schema.pm

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -412,41 +412,33 @@ passed as argument rather than by table value',
412412
bmc => 'The hostname of the BMC adapter.',
413413
bmcport => 'In systems with selectable shared/dedicated ethernet ports, this parameter can be used to specify the preferred port. 0 means use the shared port, 1 means dedicated, blank is to not assign.
414414
415-
The following special cases exist for IBM System x servers:
415+
The following special cases exist for IBM System x servers:
416416
417-
For x3755 M3 systems, 0 means use the dedicated port, 1 means
418-
shared, blank is to not assign.
417+
- For x3755 M3 systems, 0 means use the dedicated port, 1 means shared, blank is to not assign.
419418
420-
For certain systems which have a mezzaine or ML2 adapter, there is a second
421-
value to include:
419+
- For certain systems which have a mezzaine or ML2 adapter, there is a second value to include:
420+
For x3750 M4 (Model 8722):
421+
0 2 1st 1Gbps interface for LOM
422+
0 0 1st 10Gbps interface for LOM
423+
0 3 2nd 1Gbps interface for LOM
424+
0 1 2nd 10Gbps interface for LOM
425+
For x3750 M4 (Model 8752), x3850/3950 X6, dx360 M4, x3550 M4, and x3650 M4:
426+
0 Shared (1st onboard interface)
427+
1 Dedicated
428+
2 0 First interface on ML2 or mezzanine adapter
429+
2 1 Second interface on ML2 or mezzanine adapter
430+
2 2 Third interface on ML2 or mezzanine adapter
431+
2 3 Fourth interface on ML2 or mezzanine adapter
422432
423-
424-
For x3750 M4 (Model 8722):
425-
426-
427-
0 2 1st 1Gbps interface for LOM
428-
429-
0 0 1st 10Gbps interface for LOM
430-
431-
0 3 2nd 1Gbps interface for LOM
432-
433-
0 1 2nd 10Gbps interface for LOM
434-
435-
436-
For x3750 M4 (Model 8752), x3850/3950 X6, dx360 M4, x3550 M4, and x3650 M4:
437-
438-
439-
0 Shared (1st onboard interface)
440-
441-
1 Dedicated
442-
443-
2 0 First interface on ML2 or mezzanine adapter
444-
445-
2 1 Second interface on ML2 or mezzanine adapter
446-
447-
2 2 Third interface on ML2 or mezzanine adapter
448-
449-
2 3 Fourth interface on ML2 or mezzanine adapter',
433+
For Dell systems, a second and third values can also be used:
434+
1st value: 0 = shared / 1 = dedicated
435+
2nd value shared LOM (1-4) (0 or no value means first available LOM)
436+
3rd value: failover LOM (1-4) (0 means no failover, no value means all LOMs)
437+
0 Shared with first available interface, failover all LOMs (catch all mode)
438+
0 1 Shared with LOM1, failover all LOMs
439+
0 1 2 Shared with LOM1, failover LOM2
440+
0 2 0 Shared with LOM2, no failover
441+
1 Dedicated',
450442
taggedvlan => 'bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.',
451443
bmcid => 'Unique identified data used by discovery processes to distinguish known BMCs from unrecognized BMCs',
452444
username => 'The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.',

xCAT-genesis-scripts/usr/bin/bmcsetup

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,53 @@ elif [ "$IPMIMFG" == 20301 -o "$IPMIMFG" == 19046 ] ; then
263263
elif [ "$IPMIMFG" == "47488" ]; then
264264
LOCKEDUSERS=1
265265
elif [ "$IPMIMFG" == "674" ]; then # DELL
266+
logger -s -t $log_label -p local4.info "Dell server detected"
266267
BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'`
268+
# BMCPORT can take 3 values:
269+
# 1st value: 0 = shared / 1 = dedicated
270+
# 2nd value shared LOM (1-4) (0 or no value means first available LOM)
271+
# 3rd value: failover LOM (1-4) (0 means no failover, no value means all LOMs)
272+
read -r bmc_mode shared_lom failover_lom <<< "$BMCPORT"
267273
logger -s -t $log_label -p local4.info "BMCPORT is $BMCPORT"
268-
if [ "$BMCPORT" == "0" ]; then # shared
274+
logger -s -t $log_label -p local4.info "bmc_mode:$bmc_mode shared_lom:$shared_lom failover_lom:$failover_lom"
275+
if [ "$bmc_mode" == "1" ]; then # dedicated
276+
logger -s -t $log_label -p local4.info "Setting BMC to dedicated mode"
269277
# https://github.com/ipmitool/ipmitool/issues/18
270278
# ipmitool raw 0x30 0x28 0xAA 0xBB, with:
271279
# AA: 01 = dedicated, 02...05 = shared with lom1...4
272280
# BB: 00 = no failover, 02...05 = failover on lom1...4, , 06 = failover on all loms
273-
ipmitool raw 0x30 0x28 0x02 0x06
274-
elif [ "$BMCPORT" == "1" ]; then # dedicated
275281
ipmitool raw 0x30 0x28 0x01 0x00
282+
elif [ "$bmc_mode" == "0" ]; then # shared
283+
logger -s -t $log_label -p local4.info "Setting BMC to shared mode"
284+
case "$failover_lom" in
285+
"" ) xFAIL=0x06 ;;
286+
0 ) xFAIL=0x00 ;;
287+
[1-4]) xFAIL=$(printf 0x%02x $((failover_lom+1))) ;;
288+
*) logger -s -t $log_label -p local4.info "WARNING: can't set failover LOM to $failover_lom, defaulting to failover all LOMs"
289+
xFAIL=0x06 ;;
290+
esac
291+
case "$shared_lom" in
292+
""|0) xLOM=00 ;;
293+
[1-4]) xLOM=$(printf 0x%02x $((shared_lom+1))) ;;
294+
*) logger -s -t $log_label -p local4.info "WARNING: can't set shared LOM to $shared_lom, defaulting to first available LOMs"
295+
xLOM=00 ;;
296+
esac
297+
case "$xLOM" in
298+
"00") # try to find the first available LOM
299+
_lom=1
300+
while ! ipmitool raw 0x30 0x28 "$(printf 0x%02x $((_lom+1)))" "$xFAIL" 2>/dev/null; do
301+
_lom=$((_lom+1))
302+
snooze
303+
if [ $_lom -gt 4 ]; then
304+
logger -s -t $log_label -p local4.info "ERROR: setting BMC to share mode failed"
305+
break;
306+
fi
307+
done
308+
;;
309+
*) ipmitool raw 0x30 0x28 "$xLOM" "$xFAIL" || \
310+
logger -s -t $log_label -p local4.info "ERROR: error setting BMCPORT to requested parameters"
311+
;;
312+
esac
276313
fi
277314
elif [ "$IPMIMFG" == "10876" ]; then # Supermicro
278315
BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'`

0 commit comments

Comments
 (0)