From 40f3b88c1e27bba9983ee6d6dc31b83dcdfc4bcd Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 1 Sep 2017 04:13:01 -0400 Subject: [PATCH 1/3] enhance bmcsetup for WSP:1. use raw to untag vlan, 2. enable ipsrc static, 3. open set access on and don't check the return code --- xCAT-genesis-scripts/bin/bmcsetup | 33 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index fd88f331f..bf2723081 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -293,9 +293,6 @@ logger -s -t $log_label -p local4.info "Detected LAN channel $LANCHAN" let idev=NUMBMCS if [ $IPCFGMETHOD="static" ]; then - if [ ! -z "$ISOPENBMC" ]; then - let idev=0 - fi while [ $idev -gt 0 ]; do let idev=idev-1 TRIES=0 @@ -370,6 +367,17 @@ else done fi +if [ "$BMCVLAN" = off ]; then + TRIES=0 + logger -s -t $log_label -p local4.info "Untagging BMC vlan..." + while ! ipmitool raw 0xc 1 $LANCHAN 0x14 0 0; do + snooze + let TRIES=TRIES+1 + if [ $TRIES -gt $TIMEOUT ]; then + break; + fi + done +else let idev=0 for b in $BMCVLAN; do TRIES=0 @@ -383,7 +391,7 @@ for b in $BMCVLAN; do done let idev=idev+1 done - +fi # update the node status to 'bmcready' for openbmc, no more configuration is needed. @@ -393,14 +401,15 @@ if [ ! -z "$ISOPENBMC" ]; then bmc_config_rc=0 # Set Channel Access to apply network setting #while ! ipmitool -d 0 lan set $LANCHAN access on; do - while ! ipmitool -d 0 raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do - snooze - let TRIES=TRIES+1 - if [ $TRIES -gt $TIMEOUT ]; then - bmc_config_rc=1 - break; - fi - done + ipmitool -d 0 lan set $LANCHAN access on + #while ! ipmitool -d 0 raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do + # snooze + # let TRIES=TRIES+1 + # if [ $TRIES -gt $TIMEOUT ]; then + # bmc_config_rc=1 + # break; + # fi + #done # update the node status to 'bmcready' if [ ! -z "$XCATMASTER" ]; then From 586d086b9546e6c7d84525465c4bcf0e43b4248e Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 6 Sep 2017 02:44:13 -0400 Subject: [PATCH 2/3] modify bmcsetup according to Victor's comments --- xCAT-genesis-scripts/bin/bmcsetup | 47 +++++++++++-------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index bf2723081..ce25520ea 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -369,7 +369,7 @@ fi if [ "$BMCVLAN" = off ]; then TRIES=0 - logger -s -t $log_label -p local4.info "Untagging BMC vlan..." + logger -s -t $log_label -p local4.info "Disabling VLAN configuration in the BMC..." while ! ipmitool raw 0xc 1 $LANCHAN 0x14 0 0; do snooze let TRIES=TRIES+1 @@ -378,46 +378,33 @@ if [ "$BMCVLAN" = off ]; then fi done else -let idev=0 -for b in $BMCVLAN; do - TRIES=0 - # Set VLAN for the current channel - while ! ipmitool -d $idev lan set $LANCHAN vlan id $b; do - snooze - let TRIES=TRIES+1 - if [ $TRIES -gt $TIMEOUT ]; then - break; - fi + let idev=0 + for b in $BMCVLAN; do + TRIES=0 + # Set VLAN for the current channel + while ! ipmitool -d $idev lan set $LANCHAN vlan id $b; do + snooze + let TRIES=TRIES+1 + if [ $TRIES -gt $TIMEOUT ]; then + break; + fi + done + let idev=idev+1 done - let idev=idev+1 -done fi # update the node status to 'bmcready' for openbmc, no more configuration is needed. if [ ! -z "$ISOPENBMC" ]; then # To enable network configuration for openbmc - TRIES=0 - bmc_config_rc=0 - # Set Channel Access to apply network setting - #while ! ipmitool -d 0 lan set $LANCHAN access on; do ipmitool -d 0 lan set $LANCHAN access on - #while ! ipmitool -d 0 raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do - # snooze - # let TRIES=TRIES+1 - # if [ $TRIES -gt $TIMEOUT ]; then - # bmc_config_rc=1 - # break; - # fi - #done - # update the node status to 'bmcready' if [ ! -z "$XCATMASTER" ]; then - if [ "$bmc_config_rc" = "0" ]; then - # Wait for some time for the new network setting is ready - snooze + # Wait for some time for the new network setting is ready + snooze + if ipmitool lan print 1 | grep $BMCIP >/dev/null; then updateflag.awk $XCATMASTER 3002 "installstatus bmcready" - else + else updateflag.awk $XCATMASTER 3002 "installstatus failed" fi fi From 95f6e07614f93002ff7a85086baf4cadf159e4c8 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 11 Sep 2017 23:17:51 -0400 Subject: [PATCH 3/3] Remove the log to output Disabling VLAN configuration information --- xCAT-genesis-scripts/bin/bmcsetup | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index ce25520ea..7b712a0d9 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -369,7 +369,6 @@ fi if [ "$BMCVLAN" = off ]; then TRIES=0 - logger -s -t $log_label -p local4.info "Disabling VLAN configuration in the BMC..." while ! ipmitool raw 0xc 1 $LANCHAN 0x14 0 0; do snooze let TRIES=TRIES+1