Change the commands sequence to make openibd daemon stable.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6187 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2010-05-20 11:38:09 +00:00
parent fe727e6f81
commit cbd61c2b1f
2 changed files with 39 additions and 20 deletions

View File

@ -15,7 +15,9 @@ chomp $PLTFRM;
my $HOST = `hostname -s`;
chomp $HOST;
my @nums = (0..3);
my @nums = (0..1);
my @nics;
my $OS_name;
foreach my $num ( @nums ) {
# Take primary node name, add -ib$num and then reverse resolve to get what ip should be
my $nic = "ib$num";
@ -38,7 +40,6 @@ foreach my $num ( @nums ) {
if ( $PLTFRM eq "Linux" ) {
# Issue openibd for Linux at boot time
my $OS_name;
if ( -f '/etc/redhat-release' )
{
$OS_name = "redhat";
@ -56,15 +57,12 @@ foreach my $num ( @nums ) {
{
runcmd("/usr/bin/sed -i 's/SDP_LOAD=yes/SDP_LOAD=no/g' /etc/infiniband/openib.conf");
}
my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on";
runcmd($openibd_cmd);
# Write the info to the ifcfg file
my $dir;
if ( $OS_name eq 'suse')
{
$dir = "/etc/sysconfig/network";
runcmd("echo 'options ib_ehca nr_ports=1' >> /etc/modprobe.conf");
}
elsif ( $OS_name eq 'redhat' )
{
@ -80,12 +78,7 @@ foreach my $num ( @nums ) {
print FILE "STARTMODE=auto\n" if ( $OS_name eq 'suse');
close FILE;
my $openibd_start_cmd = "/sbin/service openibd start";
runcmd($openibd_start_cmd);
sleep(5);
runcmd("ifup $nic");
system("logger -t xcat 'configiba: successfully configured $nic.'");
push @nics, $nic;
} elsif ( $PLTFRM eq "AIX" ) {
#Check whether the icm is available
my $cmd = "lsdev -C | grep icm | grep Available";
@ -109,6 +102,25 @@ foreach my $num ( @nums ) {
}
}
if ( $PLTFRM eq "Linux" ) {
if ( $OS_name eq 'suse')
{
runcmd("echo 'options ib_ehca nr_ports=1' >> /etc/modprobe.conf");
}
my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on";
runcmd($openibd_cmd);
my $openibd_start_cmd = "/sbin/service openibd restart";
runcmd($openibd_start_cmd);
sleep(5);
foreach my $nic ( @nics ) {
runcmd("ifup $nic");
system("logger -t xcat 'configiba: successfully configured $nic.'");
}
}
#Configure the ml0 interface
if ( $PLTFRM eq "AIX" ) {
my $hostname;

View File

@ -15,7 +15,8 @@ chomp $PLTFRM;
my $HOST = `hostname -s`;
chomp $HOST;
my @nums = (0..3);
my @nums = (0..1);
my @nics;
foreach my $num ( @nums ) {
# Take primary node name, add -ib$num and then reverse resolve to get what ip should be
my $nic = "ib$num";
@ -60,8 +61,6 @@ foreach my $num ( @nums ) {
{
runcmd("sed -i 's/options\ ib_ehca\ nr_ports=1//g' /etc/modprobe.conf");
}
my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on";
runcmd($openibd_cmd);
# Write the info to the ifcfg file
my $dir;
if ( $OS_name eq 'suse')
@ -82,12 +81,7 @@ foreach my $num ( @nums ) {
print FILE "STARTMODE=auto\n" if ( $OS_name eq 'suse');
close FILE;
my $openibd_start_cmd = "/sbin/service openibd start";
runcmd($openibd_start_cmd);
sleep(5);
runcmd("ifup $nic");
system("logger -t xcat 'configiba: successfully configured $nic.'");
push @nics, $nic;
} elsif ( $PLTFRM eq "AIX" ) {
#Check whether the icm is available
my $cmd = "lsdev -C | grep icm | grep Available";
@ -113,6 +107,19 @@ foreach my $num ( @nums ) {
}
}
if ( $PLTFRM eq "Linux" ) {
my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on";
runcmd($openibd_cmd);
my $openibd_start_cmd = "/sbin/service openibd restart";
runcmd($openibd_start_cmd);
sleep(5);
foreach my $nic ( @nics ) {
runcmd("ifup $nic");
system("logger -t xcat 'configiba: successfully configured $nic.'");
}
}
#Configure the ml0 interface
if ( $PLTFRM eq "AIX" ) {
my $hostname;