mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-05-06 09:04:13 +00:00
Merge pull request #2238 from xcat2/master
merge the changes from master to 2.13 branch for 2.13 release
This commit is contained in:
@@ -3432,7 +3432,6 @@ sub kit_addpkgs
|
||||
$kittarfile = abs_path($kittarfile);
|
||||
|
||||
foreach my $rpmdir (@pkgdirlist) {
|
||||
print "rpmdir = $rmpdir\n";
|
||||
if (!(-d $rpmdir)) {
|
||||
print "The package directory $rpmdir could not be read. \n";
|
||||
return 1;
|
||||
|
||||
@@ -24,19 +24,27 @@ if [ -z $1 ]; then
|
||||
HOSTOS="fedora23"
|
||||
fi
|
||||
if [ $BUILDARCH = 'ppc64' -a $HOSTOS != 'mcp' -a $HOSTOS != '-y' ]; then
|
||||
echo "The steps below is used to installed mlnx driver 3.2-1, if you are sure you have it or newer driver, pls use \"-y\" to skip!"
|
||||
echo "The steps below are used to install mlnx driver 3.2-1 and i40e driver 1.5.16, if you are sure you have these or newer drivers, pls use \"-y\" to skip!"
|
||||
echo "1. Install OS related packages"
|
||||
echo " yum install rpmbuild"
|
||||
echo " yum install kernel-devel-`uname -r`"
|
||||
echo " yum install kernel-headers-`uname -r`"
|
||||
echo " yum install gcc-c++"
|
||||
echo "2. Download Mellanox EN Driver for Linux from http://www.mellanox.com/downloads/Drivers/mlnx-en-3.2-1.0.1.1.tgz"
|
||||
echo "3. Extract it and run ./install.sh from the extracted directory"
|
||||
echo " Download Intel EN Driver follow this link and download from webpage https://downloadcenter.intel.com/downloads/eula/26370/Intel-Network-Adapter-Driver-for-PCI-E-Intel-40-Gigabit-Ethernet-Network-Connections-under-Linux-?httpDown=https%3A%2F%2Fdownloadmirror.intel.com%2F26370%2Feng%2Fi40e-1.5.16.tar.gz"
|
||||
echo "3. To install Mellanox Driver, extract it and run ./install.sh from the extracted directory"
|
||||
echo " tar -xvf mlnx-en-3.2-1.0.1.1.tgz"
|
||||
echo " ./mlnx-en-3.2-1.0.1.1/install.sh"
|
||||
echo "4. Check whether the mlx4 driver is updated"
|
||||
echo " To install Intel Driver, create rpm and install"
|
||||
echo " rpmbuild -tb i40e-1.5.16.tar.gz"
|
||||
echo " rpm -i /<path-to>/i40e-1.5.16-1.ppc64le.rpm"
|
||||
echo " Additional Intel instructions can be found in README included in i40e-1.5.16.tar.gz"
|
||||
echo "4. Check whether the drivers are updated"
|
||||
echo " modprobe mlx4-en"
|
||||
echo " modinfo mlx4-en | grep version"
|
||||
echo " version: 3.2-1.0.1.1 (31 Jan 2016)"
|
||||
echo " modinfo i40e | grep version"
|
||||
echo " version: 1.5.16"
|
||||
echo "5. Once the steps above done, run \"$0 -y\" to build xCAT-genesis-base-ppc64"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -74,7 +74,7 @@ sub process_request {
|
||||
}
|
||||
}
|
||||
my $nicips = xCAT::NetworkUtils->get_nic_ip();
|
||||
foreach (keys $nicips) {
|
||||
foreach (keys %$nicips) {
|
||||
# To support tagged vlan, create entries in the hash for the
|
||||
# interface name removing the physical interface ending:
|
||||
# 'enP1p12s0f0.2@enP1p12s0f0' => 'enP1p12s0f0.2'
|
||||
|
||||
@@ -481,13 +481,8 @@ sub process_request {
|
||||
}
|
||||
|
||||
$suffix = $method.".".$suffix;
|
||||
unlink("$destdir/rootimg.sfs");
|
||||
unlink("$destdir/rootimg.gz");
|
||||
unlink("$destdir/rootimg.cpio.xz");
|
||||
unlink("$destdir/rootimg.cpio.gz");
|
||||
unlink("$destdir/rootimg.tar.xz");
|
||||
unlink("$destdir/rootimg.tar.gz");
|
||||
|
||||
unlink glob("$destdir/rootimg.*");
|
||||
|
||||
if ($method =~ /cpio/) {
|
||||
if (!$exlistloc) {
|
||||
$excludestr = "find . -xdev -print0 | cpio -H newc -o -0 | $compress -c - > ../rootimg.$suffix";
|
||||
|
||||
@@ -197,7 +197,7 @@ sub process_request {
|
||||
}
|
||||
|
||||
my @filestoremove = ("$imagedir/kernel", "$imagedir/initrd-stateless.gz", "$imagedir/initrd-statelite.gz");
|
||||
my @rootimgtars=glob "$imagedir/rootimg.{tar,cpio}.{xz,gz}";
|
||||
my @rootimgtars=glob "$imagedir/rootimg.*";
|
||||
push @filestoremove,@rootimgtars;
|
||||
#unmount all the mount points under rootimg directory
|
||||
#to avoid removing the directory/files on management node by mistake
|
||||
|
||||
@@ -6,7 +6,7 @@ RWDIR=.statelite
|
||||
. /lib/dracut-lib.sh
|
||||
XCAT="$(getarg XCAT=)"
|
||||
XCATMASTER=$XCAT
|
||||
|
||||
STATEMNT="$(getarg STATEMNT=)"
|
||||
rootlimit="$(getarg rootlimit=)"
|
||||
|
||||
getarg nonodestatus
|
||||
|
||||
@@ -32,9 +32,11 @@ my @nodes;
|
||||
my @filternodes;
|
||||
|
||||
|
||||
#---------------------------------------------------------
|
||||
#Main
|
||||
$::SWITCH_TYPE="EthSwitch::BNT";
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Main
|
||||
#---------------------------------------------------------
|
||||
# parse the options
|
||||
if (
|
||||
!GetOptions(
|
||||
@@ -49,6 +51,8 @@ if (
|
||||
'ip' => \$::IP,
|
||||
'name' => \$::NAME,
|
||||
'all' => \$::ALL,
|
||||
'V' => \$::VERBOSE,
|
||||
'desc=s' => \$::DESC,
|
||||
)
|
||||
)
|
||||
{
|
||||
@@ -67,7 +71,7 @@ if ($::SWITCH) {
|
||||
my @filternodes = xCAT::NodeRange::noderange( $::SWITCH );
|
||||
if (nodesmissed) {
|
||||
my $nodenotdefined = join(',', nodesmissed);
|
||||
xCAT::MsgUtils->message("I","The following nodes are not defined in xCAT DB: $nodenotdefined");
|
||||
xCAT::MsgUtils->message("I","The following nodes are not defined in xCAT: $nodenotdefined");
|
||||
}
|
||||
# check switch type
|
||||
my $switchestab = xCAT::Table->new('switches');
|
||||
@@ -80,11 +84,11 @@ if ($::SWITCH) {
|
||||
}
|
||||
}
|
||||
unless (@nodes) {
|
||||
xCAT::MsgUtils->message("E","No Valid Switch to process");
|
||||
xCAT::MsgUtils->message("E","No valid switches provided.");
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E","Invalid flag, please provide switches with --switches");
|
||||
xCAT::MsgUtils->message("E","A switch must be provided using the --switches keyword");
|
||||
&usage;
|
||||
exit(1);
|
||||
}
|
||||
@@ -100,23 +104,21 @@ my $port;
|
||||
my $sub_req;
|
||||
my $rc;
|
||||
|
||||
if (($::IP) || ($::ALL))
|
||||
{
|
||||
if (($::IP) || ($::ALL)) {
|
||||
config_ip();
|
||||
}
|
||||
|
||||
if (($::NAME) || ($::ALL))
|
||||
{
|
||||
if (($::NAME) || ($::ALL)) {
|
||||
config_hostname();
|
||||
}
|
||||
if (($::SNMP) || ($::ALL))
|
||||
{
|
||||
if (($::SNMP) || ($::ALL)) {
|
||||
config_snmp();
|
||||
}
|
||||
if ($::VLAN)
|
||||
{
|
||||
if ($::VLAN) {
|
||||
config_vlan();
|
||||
}
|
||||
if ($::DESC) {
|
||||
config_desc();
|
||||
}
|
||||
|
||||
sub config_ip {
|
||||
my @config_switches;
|
||||
@@ -502,6 +504,34 @@ sub config_vlan {
|
||||
|
||||
}
|
||||
|
||||
sub config_desc {
|
||||
# checking for port number, switches is checked earlier
|
||||
if ($::PORT) {
|
||||
$port = $::PORT;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E","Error - When setting description, a port must be provided.");
|
||||
&usage;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my $cmd_prefix = "xdsh $switches --devicetype $::SWITCH_TYPE";
|
||||
my $cmd;
|
||||
|
||||
# Build up the commands for easier readability
|
||||
$cmd = $cmd . "enable\;";
|
||||
$cmd = $cmd . "configure terminal\;";
|
||||
$cmd = $cmd . "interface port $port\;";
|
||||
$cmd = $cmd . "description \\\"$::DESC\\\"\;";
|
||||
$cmd = $cmd . "write memory\;";
|
||||
$cmd = $cmd . "exit\;exit\;";
|
||||
|
||||
my $final_cmd = $cmd_prefix . " \"" . $cmd . "\"";
|
||||
print "Setting description=\"$::DESC\" on port $port of switches=$switches\n";
|
||||
if ($::VERBOSE) {
|
||||
print "Executing cmd: \n==> $final_cmd\n";
|
||||
}
|
||||
`$final_cmd`
|
||||
}
|
||||
|
||||
#---------------------------------------------------------
|
||||
|
||||
@@ -521,6 +551,10 @@ sub usage
|
||||
configBNT [--switches switchnames] [--name ]
|
||||
configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group]
|
||||
configBNT [--switches switchnames] [--port port] [--vlan vlan]
|
||||
|
||||
To set the description for a port on the switch:
|
||||
|
||||
configBNT --switches switchnames --port port --desc \"description\"
|
||||
\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
|
||||
check:rc==0
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p ;mkvm $$CN -s 20G; fi;fi
|
||||
#comment for vm debug
|
||||
#cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p ;mkvm $$CN -s 20G; fi;fi
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
|
||||
@@ -5,7 +5,9 @@ cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
|
||||
check:rc=0
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi
|
||||
#comment for vm debug
|
||||
#cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p ;mkvm $$CN -s 20G; fi;fi
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi
|
||||
check:rc=0
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
|
||||
@@ -7,7 +7,7 @@ description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two
|
||||
#check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
|
||||
check:rc==0
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi
|
||||
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
@@ -118,7 +118,7 @@ stop:yes
|
||||
#check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
|
||||
check:rc==0
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi
|
||||
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
|
||||
@@ -7,7 +7,7 @@ description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two
|
||||
#check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
|
||||
check:rc==0
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi
|
||||
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
@@ -120,7 +120,7 @@ description:update xCAT from $$MIGRATION22VERSION to $$LATEST_VERSION, these two
|
||||
#check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
|
||||
check:rc==0
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
|
||||
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi
|
||||
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
|
||||
@@ -71,7 +71,7 @@ cmd:xdsh $$CN "apt-get clean all"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get update"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get -y install xcat xCAT-test"
|
||||
cmd:xdsh $$CN "apt-get -y install xcat xcat-test"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /oldxcat/old_version"
|
||||
check:rc==0
|
||||
@@ -103,7 +103,7 @@ cmd:xdsh $$CN "apt-get clean all"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get update"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get -y upgrade xcat xCAT-test"
|
||||
cmd:xdsh $$CN "apt-get -y upgrade xcat xcat-test"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version"
|
||||
check:rc==0
|
||||
|
||||
@@ -71,7 +71,7 @@ cmd:xdsh $$CN "apt-get clean all"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get update"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get -y install xcat xCAT-test"
|
||||
cmd:xdsh $$CN "apt-get -y install xcat xcat-test"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /oldxcat/old_version"
|
||||
check:rc==0
|
||||
@@ -103,7 +103,7 @@ cmd:xdsh $$CN "apt-get clean all"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get update"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "apt-get -y upgrade xcat xCAT-test"
|
||||
cmd:xdsh $$CN "apt-get -y upgrade xcat xcat-test"
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version"
|
||||
check:rc==0
|
||||
|
||||
Reference in New Issue
Block a user