From 22b49995893c4c7849985341e09e496674f3157f Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 30 Apr 2014 17:49:31 -0400 Subject: [PATCH 1/8] defect 4035 handle multiple servicenode entries --- xCAT-server/lib/xcat/plugins/mic.pm | 38 +++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/mic.pm b/xCAT-server/lib/xcat/plugins/mic.pm index 1037c69b3..6da7c7395 100644 --- a/xCAT-server/lib/xcat/plugins/mic.pm +++ b/xCAT-server/lib/xcat/plugins/mic.pm @@ -612,7 +612,25 @@ sub rflash { # run the cmd on the host to flash the mic my @args = ("-s", "-v", "-e"); push @args, "$::XCATROOT/sbin/flashmic"; - my $master = $request->{'_xcatdest'}; + # assume that all hosts are on the same network connected to this master + # (otherwise, will need to move this call into loop above for each host + # and build separate miccfg calls for each unique returned value from + # my_ip_facing) + my $ipfn = xCAT::NetworkUtils->my_ip_facing(@hosts[0]); + if ($ipfn) { + $master = $ipfn; + } else { + my $hostname = ""; + my $hostnamecmd = "/bin/hostname"; + my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); + if ($::RUNCMD_RC = 0) { + $hostname = "from server $thostname[0]"; + } + xCAT::MsgUtils->message("E", {error=>["Cannot detect an active network interface $hostname to @hosts[0]."], errorcode=>["1"]}, $callback); + return; + } + +} push @args, ("-m", "$master"); push @args, ("-p", "$tftpdir/xcat/miccfg"); @@ -912,7 +930,23 @@ sub nodeset { # run the cmd on the host to configure the mic my @args = ("-s", "-v", "-e"); push @args, "$::XCATROOT/sbin/configmic"; - my $master = $request->{'_xcatdest'}; + # assume that all hosts are on the same network connected to this master + # (otherwise, will need to move this call into loop above for each host + # and build separate miccfg calls for each unique returned value from + # my_ip_facing) + my $ipfn = xCAT::NetworkUtils->my_ip_facing(@hosts[0]); + if ($ipfn) { + $master = $ipfn; + } else { + my $hostname = ""; + my $hostnamecmd = "/bin/hostname"; + my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); + if ($::RUNCMD_RC = 0) { + $hostname = "from server $thostname[0]"; + } + xCAT::MsgUtils->message("E", {error=>["Cannot detect an active network interface $hostname to @hosts[0]."], errorcode=>["1"]}, $callback); + return; + } push @args, ("-m", "$master"); push @args, ("-p", "$tftpdir/xcat/miccfg"); From f3f19a6ff6c3a53b58147575231801b0aa7537e7 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 8 May 2014 03:22:23 -0700 Subject: [PATCH 2/8] fix the problem that redhat provisioning on X will enter infinite installation loop when unicats dhcp is enabled --- xCAT-server/lib/perl/xCAT/Template.pm | 24 ++++++++++++++----- .../share/xcat/install/scripts/post.rh.common | 12 +++++++++- .../xcat/install/scripts/post.sles.common | 2 +- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 82dc54ce5..3ba3117c4 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -105,11 +105,6 @@ sub subvars { } - my @managedaddressmode = xCAT::TableUtils->get_site_attribute("managedaddressmode"); - my $tmp=$managedaddressmode[0]; - if( defined($tmp) ){ - $ENV{MANAGEDADDRESSMODE}=$tmp; - } #replace the env with the right value so that correct include files can be found $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; @@ -248,6 +243,7 @@ sub subvars { $inc =~ s/#WINDISABLENULLADMIN#/windows_disable_null_admin()/eg; $inc =~ s/#MANAGEDADDRESSMODE#/managed_address_mode()/eg; $inc =~ s/#HOSTNAME#/$node/g; + $inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg; my $nrtab = xCAT::Table->new("noderes"); my $tftpserver = $nrtab->getNodeAttribs($node, ['tftpserver']); @@ -619,6 +615,22 @@ sub get_win_prodkey { sub managed_address_mode { return $::XCATSITEVALS{managedaddressmode}; } + + +sub get_node_domain { + my $lcnode=shift; + if ( $lcnode eq 'THISNODE' ){ + $lcnode=$node; + } + + my $nd = xCAT::NetworkUtils->getNodeDomains([$lcnode]); + my %nodedomains = %$nd; + my $domain=$nodedomains{$lcnode}; + + return $domain; + +} + sub esxipv6setup { if (not $::XCATSITEVALS{managedaddressmode} or $::XCATSITEVALS{managedaddressmode} =~ /v4/) { return ""; } # blank line for ipv4 schemes my $v6addr; @@ -686,7 +698,7 @@ sub kickstartnetwork { push @nameserversIP, $ip; } - + #there is no network option to set dns search domain in kickstart, it will be set in %post if (scalar @nameserversIP) { $line .=" --nameserver=". join(",",@nameserversIP); } diff --git a/xCAT-server/share/xcat/install/scripts/post.rh.common b/xCAT-server/share/xcat/install/scripts/post.rh.common index f34fe6e5d..b3b1fc0f1 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh.common +++ b/xCAT-server/share/xcat/install/scripts/post.rh.common @@ -1,7 +1,17 @@ # -# Setup hostname +# Setup hostname and resov.conf # echo "post scripts" >/root/post.log + +#there is no network option to set dns search domain in kickstart file, +#the search domain in /etc/resolv.conf is set in the post installation script +export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# +export SEARCHDOMAIN=#GETNODEDOMAIN:THISNODE# + +if [ "$MANAGEDADDRESSMODE" == "static" ]; then + echo "search $SEARCHDOMAIN" >> /etc/resolv.conf +fi + export PRINIC=#TABLEBLANKOKAY:noderes:THISNODE:primarynic# if [ "$PRINIC" == "mac" ] then diff --git a/xCAT-server/share/xcat/install/scripts/post.sles.common b/xCAT-server/share/xcat/install/scripts/post.sles.common index cfe6f29cc..ae6db1e24 100644 --- a/xCAT-server/share/xcat/install/scripts/post.sles.common +++ b/xCAT-server/share/xcat/install/scripts/post.sles.common @@ -1,5 +1,5 @@ #!/bin/sh -export MANAGEDADDRESSMODE="#XCATVAR:MANAGEDADDRESSMODE#" +export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# cd /etc/sysconfig/network From b94432d9f16740d0c5ba91afb81efd0fb5602b0c Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 8 May 2014 03:45:39 -0700 Subject: [PATCH 3/8] add replace token in kickstart template file for rhels6.x86_64 and rhel7 to support unicast dhcp --- xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl | 1 + xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl index ec75d88bd..b32f1f01d 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl @@ -2,6 +2,7 @@ #cmdline lang en_US +#KICKSTARTNET# # # Where's the source? diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl index 9f0fddf60..c77177ae7 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl @@ -3,6 +3,7 @@ #cmdline lang en_US +#KICKSTARTNET# # # Where's the source? From ed76d20ea9fcfddc610884b2294277e52a456da7 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 9 May 2014 02:02:45 -0700 Subject: [PATCH 4/8] correct the dns configuration during node provision when unicast dhcp is enabled --- xCAT-server/lib/xcat/plugins/sles.pm | 10 +++++++++- xCAT-server/share/xcat/install/scripts/post.rh.common | 10 +--------- xCAT-server/share/xcat/install/scripts/pre.rh | 11 +++++++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index d3a3a29fc..786dcbfd0 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1183,11 +1183,19 @@ sub mkinstall } if(scalar @nameserversIP){ - $kcmdline .=" dns=".join(",",@nameserversIP); + $kcmdline .=" Nameserver=".join(",",@nameserversIP); } + + my $nd = xCAT::NetworkUtils->getNodeDomains([$node]); + my %nodedomains = %$nd; + my $domain=$nodedomains{$node}; + + $kcmdline .=" Domain=$domain "; } + + if (defined $sent->{serialport}) { diff --git a/xCAT-server/share/xcat/install/scripts/post.rh.common b/xCAT-server/share/xcat/install/scripts/post.rh.common index b3b1fc0f1..79bc733a7 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh.common +++ b/xCAT-server/share/xcat/install/scripts/post.rh.common @@ -1,16 +1,8 @@ # -# Setup hostname and resov.conf +# Setup hostname # echo "post scripts" >/root/post.log -#there is no network option to set dns search domain in kickstart file, -#the search domain in /etc/resolv.conf is set in the post installation script -export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# -export SEARCHDOMAIN=#GETNODEDOMAIN:THISNODE# - -if [ "$MANAGEDADDRESSMODE" == "static" ]; then - echo "search $SEARCHDOMAIN" >> /etc/resolv.conf -fi export PRINIC=#TABLEBLANKOKAY:noderes:THISNODE:primarynic# if [ "$PRINIC" == "mac" ] diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index 113c5760b..346b6de73 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -14,6 +14,17 @@ if [ -r /tmp/updates/etc/pki/tls/certs/ca-bundle.crt ]; then fi +#there is no boot option to set dns search domain in kickstart file, +#the search domain in /etc/resolv.conf is set in the pre installation script +export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# +export SEARCHDOMAIN=#GETNODEDOMAIN:THISNODE# + +if [ "$MANAGEDADDRESSMODE" == "static" ]; then + echo "#appended by %pre " >> /etc/resolv.conf + echo "search $SEARCHDOMAIN" >> /etc/resolv.conf +fi + + cat >/tmp/baz.py < Date: Thu, 8 May 2014 00:38:30 -0700 Subject: [PATCH 5/8] fix defect 4117 and 4113 --- build-ubunturepo | 4 ++-- xCAT-server/lib/xcat/plugins/dhcp.pm | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index f8ae7a10d..f23106d12 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -279,7 +279,7 @@ __EOF__ cat << '__EOF__' > mklocalrepo.sh . /etc/lsb-release cd `dirname $0` -echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list +echo deb [arch=amd64] file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list __EOF__ chmod 775 mklocalrepo.sh @@ -380,7 +380,7 @@ __EOF__ cat << '__EOF__' > mklocalrepo.sh . /etc/lsb-release cd `dirname $0` -echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list +echo deb [arch=amd64] file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list __EOF__ chmod 775 mklocalrepo.sh diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 1a936d5c8..22c6dcdb6 100755 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -884,10 +884,15 @@ sub check_options # if not help and not -n, dhcpd needs to be running if (!($opt->{h})&& (!($opt->{n}))) { if (xCAT::Utils->isLinux()) { - my @output = xCAT::Utils->runcmd("service dhcpd status", -1); + my $DHCPSERVER="dhcpd"; + if( -e "/etc/init.d/isc-dhcp-server" ){ + $DHCPSERVER="isc-dhcp-server"; + } + + my @output = xCAT::Utils->runcmd("service $DHCPSERVER status", -1); if ($::RUNCMD_RC != 0) { # not running my $rsp = {}; - $rsp->{data}->[0] = "dhcpd is not running. Run service dhcpd start and rerun your command."; + $rsp->{data}->[0] = "$DHCPSERVER is not running. Run service $DHCPSERVER start and rerun your command."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; } From 30d891e34162146a92b6817d5342f3e5d59a0f24 Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 12 May 2014 01:46:04 -0700 Subject: [PATCH 6/8] fix defect #4123 [fvt]2.8.4:ubuntu 12.04 diskfull install failed --- xCAT/debian/dirs | 1 + xCAT/debian/install | 2 +- xCAT/debian/postinst | 10 ++++------ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/xCAT/debian/dirs b/xCAT/debian/dirs index ef4317183..7fed8339e 100644 --- a/xCAT/debian/dirs +++ b/xCAT/debian/dirs @@ -5,4 +5,5 @@ install/prescripts install/kdump opt/xcat/share/xcat etc/apache2/conf.d +etc/apache2/conf-enabled opt/xcat/share/doc/packages/xCAT diff --git a/xCAT/debian/install b/xCAT/debian/install index edd37eb13..ab485abda 100644 --- a/xCAT/debian/install +++ b/xCAT/debian/install @@ -1,5 +1,5 @@ xcat.conf etc/apache2/conf.d/ -xcat.conf.apach24 etc/apache2/conf.d/ +xcat.conf.apach24 etc/apache2/conf-enabled LICENSE.html opt/xcat/share/doc/packages/xCAT postscripts/* install/postscripts/ prescripts/* install/prescripts/ diff --git a/xCAT/debian/postinst b/xCAT/debian/postinst index bf457cc40..6e6d4cebc 100644 --- a/xCAT/debian/postinst +++ b/xCAT/debian/postinst @@ -40,12 +40,10 @@ case "$1" in else xcatconfig -i -d -s fi - ver=$(cat /etc/issue |awk '{print $2}') - num=${ver%.*} - file="xcat.conf.apach24" - if [ $num -gt 12 ];then - mv /etc/apache2/conf.d/xcat.conf.apach24 /etc/apache2/conf-enabled/xcat.conf - fi + +# [ -e /etc/apache2/conf-enabled/xcat.conf ] && rm /etc/apache2/conf-enabled/xcat.conf +# mv /etc/apache2/conf-enabled/xcat.conf.apach24 /etc/apache2/conf-enabled/xcat.conf + /etc/init.d/apache2 restart ;; From ded873f998a889c91a169d3f870efdbebfb66243 Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 12 May 2014 02:06:08 -0700 Subject: [PATCH 7/8] change the uploader to ligc --- build-ubunturepo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-ubunturepo b/build-ubunturepo index f23106d12..d2d81d47d 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -86,7 +86,7 @@ if [ "$c_flag" -a "$d_flag" ];then exit 2 fi -uploader="bp-sawyers" +uploader="ligc" # Find where this script is located to set some build variables old_pwd=`pwd` cd `dirname $0` From 5451c4eb599786426c6064dd775588f5876a00b0 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 12 May 2014 12:47:14 -0400 Subject: [PATCH 8/8] defect 4124 --- xCAT/postscripts/setupnfsv4replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/setupnfsv4replication b/xCAT/postscripts/setupnfsv4replication index 092007aef..663fcd1cf 100755 --- a/xCAT/postscripts/setupnfsv4replication +++ b/xCAT/postscripts/setupnfsv4replication @@ -10,7 +10,7 @@ # Change these two parameters according to your requirements $::NFSRETRIES = 3; -$::NFSTIMEO = 10; +$::NFSTIMEO = 50; # Candidate commands: mount, df, lsfs, nfs4cl showfs # Only the mount command could list all file systems