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
This commit is contained in:
jbjohnso 2012-05-18 23:12:37 +00:00
parent 71a904afc7
commit cb995a801a
3 changed files with 16 additions and 3 deletions

View File

@ -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.',

View File

@ -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"

View File

@ -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