From cb995a801a8a75f929be4a392e2b76c382daa6d2 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 18 May 2012 23:12:37 +0000 Subject: [PATCH] Add setting vlan tag to bmcsetup git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12814 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Schema.pm | 3 ++- xCAT-nbroot2/bmcsetup | 9 +++++++++ xCAT-server/lib/xcat/plugins/bmcconfig.pm | 7 +++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 5f008c085..dc5f93bf7 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -334,13 +334,14 @@ hosts => { }, }, ipmi => { - cols => [qw(node bmc bmcport username password comments disable )], + cols => [qw(node bmc bmcport taggedvlan username password comments disable )], keys => [qw(node)], table_desc => 'Settings for nodes that are controlled by an on-board BMC via IPMI.', descriptions => { node => 'The node name or group name.', bmc => 'The hostname of the BMC adapater.', 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', + taggedvlan => 'Have bmcsetup place the BMC on the specified vlan tag on a shared netwirk interface. Some network devices may be incompatible with this option', username => 'The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.', password => 'The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default.', comments => 'Any user-written notes.', diff --git a/xCAT-nbroot2/bmcsetup b/xCAT-nbroot2/bmcsetup index 8ef5639c5..e07ebf670 100755 --- a/xCAT-nbroot2/bmcsetup +++ b/xCAT-nbroot2/bmcsetup @@ -25,6 +25,8 @@ while [ -z "$BMCIP" -a $IPCFGMETHOD="static" ]; do done TIMEOUT=15 BMCIP=`grep bmcip /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` + BMCVLAN=`grep taggedvlan /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` + if [ -z "$BMCVLAN" ]; then BMCVLAN=off; fi BMCGW=`grep gateway /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` BMCNM=`grep netmask /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` BMCUS=`grep username /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` @@ -151,6 +153,13 @@ else done fi +let idev=NUMBMCS-1 +while [ $idev -gt 0 ]; do + let idev=idev-1 + TRIES=0 + ipmitool -d $idev lan set $LANCHAN vlan id $BMCVLAN +done + let idev=NUMBMCS-1 for bmcu in $BMCUS; do DISABLEUSERS="1 2 3 4" diff --git a/xCAT-server/lib/xcat/plugins/bmcconfig.pm b/xCAT-server/lib/xcat/plugins/bmcconfig.pm index 6259df6b5..9dd82eefd 100644 --- a/xCAT-server/lib/xcat/plugins/bmcconfig.pm +++ b/xCAT-server/lib/xcat/plugins/bmcconfig.pm @@ -113,9 +113,9 @@ sub process_request { if ($tmphash->{value} eq "1" or $tmphash->{value} =~ /y(es)?/i) { $password = genpassword(10)."1cA!"; $gennedpassword=1; - $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username','bmcport']); + $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username','bmcport','taggedvlan']); } else { - $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username','bmcport','password']); + $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username','bmcport','password','taggedvlan']); if ($tmphash->{password}) { $password = $tmphash->{password}; } @@ -146,6 +146,9 @@ sub process_request { if (defined $bmcport) { $response->{bmcport}=$bmcport; } + if (defined $tmphash->{taggedvlan}) { + $response->{taggedvlan}=$tmphash->{taggedvlan}; + } $callback->($response); } if ($gennedpassword) { # save generated password