From 2742a29bcfb609511db0199b33374099b9a96ebe Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Fri, 2 Sep 2016 12:08:38 +0000 Subject: [PATCH 001/217] [xCAT-client]xdshbak: make `-q` match manpage --- xCAT-client/bin/xdshbak | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xCAT-client/bin/xdshbak b/xCAT-client/bin/xdshbak index 66bc59ff3..a4d6769ed 100644 --- a/xCAT-client/bin/xdshbak +++ b/xCAT-client/bin/xdshbak @@ -110,8 +110,7 @@ while () # $num_lines++; if (!($quiet)) { - if ($::opt_x) { $num_lines % 100 == 0 && print STDOUT "."; } - else { $num_lines % 1000 == 0 && print STDOUT "."; } + $num_lines % 1000 == 0 && print STDOUT "."; } if (/: /) { @@ -170,7 +169,7 @@ while () # The hostnames are sorted alphabetically # -$num_lines > 999 && print STDOUT "\n"; +!($quiet) && $num_lines > 999 && print STDOUT "\n"; if ($compress) { if ($long_ln eq $prev_ln) @@ -204,7 +203,7 @@ sub d_syntax "-c : compresses the output by listing unique output only once.\n"; my $usage3 = "-h : help \n"; my $usage4 = -"-x : omit extra header output for each node. Can not be used with -c. \n"; + "-x : omit extra header output for each node. Can not be used with -c. \n"; my $usage5 = "-q : quiet mode.\n"; my $usage = $usage1 .= $usage2 .= $usage3 .= $usage4 .= $usage5; xCAT::MsgUtils->message("I", $usage); @@ -302,10 +301,10 @@ sub print_tree xCAT::MsgUtils->message("I", "HOSTS:"); print -"-------------------------------------------------------------------------\n"; + "-------------------------------------------------------------------------\n"; &display_wc; print -"-------------------------------------------------------------------------------\n"; + "-------------------------------------------------------------------------------\n"; print $str{$index}; } } From 7b6b421b17d30fd718e940755213917a5689a7e1 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Fri, 2 Sep 2016 12:16:01 +0000 Subject: [PATCH 002/217] [xCAT-client]xdshbak: make `-x` match manpage --- xCAT-client/bin/xdshbak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/xdshbak b/xCAT-client/bin/xdshbak index a4d6769ed..48b612527 100644 --- a/xCAT-client/bin/xdshbak +++ b/xCAT-client/bin/xdshbak @@ -236,7 +236,9 @@ sub print_list if (!$::opt_x) { ($num_hosts >= 1) && print "\n"; } $num_hosts++; - if ($::opt_x) { print "$hostname: $ls{$hostname}"; } + if ($::opt_x) { + map { print "$hostname: $_\n" } split(/\n/, $ls{$hostname}); + } else { From 7fcfc0700b4ee70a6e24a41e10884d88ee10381d Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Fri, 2 Sep 2016 12:19:41 +0000 Subject: [PATCH 003/217] [xCAT-client]xdshbak: make header match manpage --- xCAT-client/bin/xdshbak | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xCAT-client/bin/xdshbak b/xCAT-client/bin/xdshbak index 48b612527..c200a185c 100644 --- a/xCAT-client/bin/xdshbak +++ b/xCAT-client/bin/xdshbak @@ -243,7 +243,7 @@ sub print_list { #$hn_string = `$SPMSG DSH $MSGCAT INFO510 'HOST: %1\$s\n' $hostname`; - xCAT::MsgUtils->message("I", "HOST:$hostname\n"); + xCAT::MsgUtils->message("I", "HOST:$hostname"); printf '%.' . (6 + length($hostname)) . "s\n", '---------------------------------------------------------------'; @@ -300,10 +300,9 @@ sub print_tree @wc = sort(@wc); #system "$SPMSG DSH $MSGCAT INFO511 'HOSTS '"; - xCAT::MsgUtils->message("I", "HOSTS:"); - - print - "-------------------------------------------------------------------------\n"; + xCAT::MsgUtils->message("I", + "HOSTS -------------------------------------------------------------------------" + ); &display_wc; print "-------------------------------------------------------------------------------\n"; From ccd0ff64f5f779df5a33a6aa56b52b4005dbfb10 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Mon, 10 Oct 2016 15:12:57 +0000 Subject: [PATCH 004/217] [xCAT-client]xdshbak: Use `version` sorting on hostnames --- xCAT-client/bin/xdshbak | 7 +++++-- xCAT-client/debian/control | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-client/bin/xdshbak b/xCAT-client/bin/xdshbak index c200a185c..7084614bb 100644 --- a/xCAT-client/bin/xdshbak +++ b/xCAT-client/bin/xdshbak @@ -10,6 +10,9 @@ use xCAT::MsgUtils; use xCAT::DSHCLI; use locale; use Getopt::Std; + +eval "use Sort::Versions qw/versioncmp/; 1;" or *versioncmp = sub ($$) { ($a,$b)= @_ ; return $a cmp $b }; + ##################################################################### # # # Module: xdshbak # @@ -231,7 +234,7 @@ sub print_list local (@lines, $numhosts, $hn_string, $l_string); - foreach $hostname (sort @hs) + foreach $hostname (sort { versioncmp($a, $b) } @hs) { if (!$::opt_x) { ($num_hosts >= 1) && print "\n"; } $num_hosts++; @@ -297,7 +300,7 @@ sub print_tree ($num_hosts >= 1) && print "\n"; $num_hosts++; @wc = split(/:/, $hdr{$index}); - @wc = sort(@wc); + @wc = sort { versioncmp($a, $b) } @wc; #system "$SPMSG DSH $MSGCAT INFO511 'HOSTS '"; xCAT::MsgUtils->message("I", diff --git a/xCAT-client/debian/control b/xCAT-client/debian/control index 321fc1b19..032f70438 100644 --- a/xCAT-client/debian/control +++ b/xCAT-client/debian/control @@ -8,5 +8,6 @@ Standards-Version: 3.7.2 Package: xcat-client Architecture: all Depends: ${perl:Depends}, nmap, perl-xcat +Recommends: libsort-versions-perl Description: Core executables and data of the xCAT management project xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters. From c6f7861fb1da01f77e1ba9c7cf35b45618ec9d95 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Mon, 10 Oct 2016 15:21:26 +0000 Subject: [PATCH 005/217] [xCAT-client]xdshbak: Add bare output sub-option `-b` for `-x` --- xCAT-client/bin/xdshbak | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/xCAT-client/bin/xdshbak b/xCAT-client/bin/xdshbak index 7084614bb..fd343f30f 100644 --- a/xCAT-client/bin/xdshbak +++ b/xCAT-client/bin/xdshbak @@ -24,6 +24,7 @@ eval "use Sort::Versions qw/versioncmp/; 1;" or *versioncmp = sub ($$) { ($a,$b # output from multiple nodes preceded by the hostname # # # # Inputs: # +# -b : bare output, don't prepend hostname per line. only with -x # # -c : list distinct output only once # # -h : usage # # -x : omit extra header output for each node. # @@ -53,7 +54,7 @@ $::dsh_command = 'xdshbak'; # # Process the command line... # -if (!getopts('cxhq')) +if (!getopts('bcxhq')) { # Gather options; if errors &d_syntax; exit(-1); @@ -71,6 +72,11 @@ if ($::opt_c && $::opt_x) exit(-1); } # these 2 options are mutually exclusive +if ($::opt_b && !($::opt_x)) { + &d_syntax; + exit(-1); +} # -b only makes sense with -x + if ($::opt_c) { $compress++; @@ -201,14 +207,15 @@ else sub d_syntax { - my $usage1 = "Usage: xdshbak [-c | -x | -h | -q] \n"; - my $usage2 = - "-c : compresses the output by listing unique output only once.\n"; - my $usage3 = "-h : help \n"; - my $usage4 = - "-x : omit extra header output for each node. Can not be used with -c. \n"; - my $usage5 = "-q : quiet mode.\n"; - my $usage = $usage1 .= $usage2 .= $usage3 .= $usage4 .= $usage5; + # Duplicates POD - pod2usage ? + my @usage; + push @usage, "Usage: xdshbak [-c | -x [-b] | -h | -q]"; + push @usage, " -b : bare output, don't prepend hostname per line. only with -x"; + push @usage, " -c : compresses the output by listing unique output only once."; + push @usage, " -h : help"; + push @usage, " -x : omit extra header output for each node. Can not be used with -c."; + push @usage, " -q : quiet mode."; + my $usage = join "\n", @usage; xCAT::MsgUtils->message("I", $usage); } @@ -240,7 +247,13 @@ sub print_list $num_hosts++; if ($::opt_x) { - map { print "$hostname: $_\n" } split(/\n/, $ls{$hostname}); + if ($::opt_b) { + # Bare output + print $ls{$hostname}; + } else { + # No header. hostname prepended on every line + map { print "$hostname: $_\n" } split(/\n/, $ls{$hostname}); + } } else { From a91bf8e258f1f32b0aeb4245352c1603bb71f4d7 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Thu, 5 Nov 2015 11:36:05 +0000 Subject: [PATCH 006/217] [xCAT-client]xdshbak: Add `-b` option to manpage --- xCAT-client/pods/man1/xdshbak.1.pod | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-client/pods/man1/xdshbak.1.pod b/xCAT-client/pods/man1/xdshbak.1.pod index 61262572e..fed91b77d 100644 --- a/xCAT-client/pods/man1/xdshbak.1.pod +++ b/xCAT-client/pods/man1/xdshbak.1.pod @@ -4,7 +4,7 @@ B - Formats the output of the B command. =head1 B -B [B<-c> | B<-x> | B<-h> | B<-q>] +B [B<-c> | B<-x> [ B<-b> ] | B<-h> | B<-q>] =head1 DESCRIPTION @@ -62,6 +62,9 @@ the output by hostname for easier viewing: . . +If the B<-b> flag is specified in addition to B<-x>, the hostname at the beginning +of each line is stripped. + =head2 Standard Error When the B filter is used and standard error messages are generated, @@ -72,6 +75,11 @@ output messages. This is true with and without the B<-c> flag. =over 6 +=item B<-b> + +Strip the host prefix from the beginning of the lines. This only +works with the B<-x> option. + =item B<-c> If the output from multiple nodes is identical it will be collapsed From 5af0a890a400a41d192fe02c743460a3ec904bae Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 7 Dec 2016 21:39:21 -0500 Subject: [PATCH 007/217] Add messages to trace the ntpd commands in genesis --- xCAT-genesis-scripts/bin/doxcat | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index e03df7a83..6a637fb91 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -262,18 +262,24 @@ openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' + +logger -s -t $log_label -p local4.info "Starting ntpd..." ntpd -g -x if [ -e "/dev/rtc" ]; then + logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." ( sleep 8 ; hwclock --systohc ) /dev/null 2>&1 & disown fi # rv 0 state does not work with the new ntp versions +logger -s -t $log_label -p local4.info "Checking ntpq for the offset values..." while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do sleep 1 done +logger -s -t $log_label -p local4.info "Checking ntpq for the offset values... Done" +logger -s -t $log_label -p local4.info "Restarting syslog..." read -r RSYSLOG_PID /dev/null kill "$RSYSLOG_PID" 2>/dev/null while kill -0 "$RSYSLOG_PID" 2>/dev/null From 32ccaf70e0712fbf13a668bd82e040f4ef7c6b18 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 8 Dec 2016 14:14:13 -0500 Subject: [PATCH 008/217] change the URL for go-xcat to github --- docs/source/guides/install-guides/common_sections.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index d4fdad136..e9f7cc87e 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -64,7 +64,7 @@ The following sections describe the different methods for installing xCAT. #. Download the ``go-xcat`` tool using ``wget``: :: - wget http://xcat.org/files/go-xcat -O - >/tmp/go-xcat + wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat chmod +x /tmp/go-xcat #. Run the ``go-xcat`` tool: :: From 174145f1a32418349e8d844d7b924d59645b625d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 8 Dec 2016 14:45:53 -0500 Subject: [PATCH 009/217] Update README.rst Update the documentation badges --- README.rst | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/README.rst b/README.rst index 15abed55c..963df8f96 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2124| |docs_2123| |docs_2122| |docs_212| |docs_211| +|docs_latest| |docs_2130| |docs_212| |docs_211| Open Source License ------------------- @@ -22,26 +22,16 @@ Developers Developers and prospective contributors are encouraged to read the `Developers Guide `_ In particular the `GitHub `_ related subsection. -.. |docs_2124| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.4 - :alt: 2.12.4 documentation status +.. |docs_2130| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.0 + :alt: 2.13.0 documentation status :scale: 100% - :target: http://xcat-docs.readthedocs.io/en/2.12.4/ - -.. |docs_2123| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.3 - :alt: 2.12.3 documentation status - :scale: 100% - :target: http://xcat-docs.readthedocs.io/en/2.12.3/ + :target: http://xcat-docs.readthedocs.io/en/2.13.0/ -.. |docs_2122| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.2 - :alt: 2.12.2 documentation status +.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12 + :alt: 2.12 documentation status :scale: 100% - :target: http://xcat-docs.readthedocs.io/en/2.12.2/ - -.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.0 - :alt: 2.12.0 documentation status - :scale: 100% - :target: http://xcat-docs.readthedocs.io/en/2.12.0/ - + :target: http://xcat-docs.readthedocs.io/en/2.12/ + .. |docs_211| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.11 :alt: 2.11 documentation status :scale: 100% From 5b882fc24d92ea29867dba93fe18e1d691332912 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 8 Dec 2016 22:21:12 -0500 Subject: [PATCH 010/217] fix issue [fvt]sles12.2 mysqlsetup -i could not work #2297 --- xCAT-client/bin/mysqlsetup | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index e242ed930..b8936aa30 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -165,12 +165,8 @@ if ($::linuxos == "sles12") { close($relfile); chomp(@lines); - # if == 12.1 - if (grep /VERSION_ID="12.1"/, @lines) { - - #$::linuxos == "sles12.1"; - $sp1flag = 1; - } + # for sles12.x + $sp1flag = 1; } # set flag From 9a4e78ed5aee2efa104a0e1533b9642c9953174b Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 9 Dec 2016 01:07:41 -0500 Subject: [PATCH 011/217] Modify issue 2299: xcatprobe xcatmn do not clear the /etc/hosts if no usefull cn node to check dhcp in the environment --- xCAT-probe/subcmds/xcatmn | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 37d7ac33f..199262d19 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -156,6 +156,7 @@ sub do_main_job { $rc |= $rst; } + cleanup(); return $rc; } From fd79f1c1ac82a3f63a876b6b1d72a99f418e2cd9 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 9 Dec 2016 01:52:57 -0500 Subject: [PATCH 012/217] update Version to 2.13.1 --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index fb2c0766b..94f15e9cc 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.13.0 +2.13.1 From b47445b763fc48e56af9712e25d68e326a995bd9 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 13 Dec 2016 09:19:49 -0500 Subject: [PATCH 013/217] Global symbol "$csw" requires explicit package name at configBNT --- xCAT-server/share/xcat/scripts/configBNT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/scripts/configBNT b/xCAT-server/share/xcat/scripts/configBNT index 3dc4062bc..c307d2806 100755 --- a/xCAT-server/share/xcat/scripts/configBNT +++ b/xCAT-server/share/xcat/scripts/configBNT @@ -158,7 +158,7 @@ sub config_ip { # don't need to set if ip addresses are same if ($dip eq $static_ip) { print "static ip $static_ip and discovery ip $dip is same, will not process command for $switch\n"; - $cmd = "chdef $csw otherinterfaces="; + $cmd = "chdef $switch otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); next; } From c1673f730b485f2a2aed1dcff03251ff0896e410 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 12 Dec 2016 15:43:17 -0500 Subject: [PATCH 014/217] Since the genesis kernel is not intended to be long running, there's no need to start ntp daemon, simply attempt to sync with ntpdate. There's an issue in this code where we query ntpq for the offset too quickly after starting the ntp daemon. This causes the offset to always be 0 and we continue. We have seen situations where ntpd starts before the first check and becomes > 1000. Then it takes 15 minutes before the 2nd attempt and delays the hardware discovery process --- xCAT-genesis-scripts/bin/doxcat | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 6a637fb91..f57234a49 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -260,11 +260,10 @@ fi openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" - ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' -logger -s -t $log_label -p local4.info "Starting ntpd..." -ntpd -g -x +logger -s -t $log_label -p local4.info "Attempting to sync the date with $XCATMASTER..." +ntpdate $XCATMASTER if [ -e "/dev/rtc" ]; then logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." @@ -272,13 +271,6 @@ if [ -e "/dev/rtc" ]; then disown fi -# rv 0 state does not work with the new ntp versions -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values..." -while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do - sleep 1 -done -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values... Done" - logger -s -t $log_label -p local4.info "Restarting syslog..." read -r RSYSLOG_PID /dev/null kill "$RSYSLOG_PID" 2>/dev/null From 23179aeaa90dd32ac06eab85f1f8ec1a724decc4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 13 Dec 2016 13:21:03 -0500 Subject: [PATCH 015/217] Adding ntpdate to the list of commands to put into xCAT-genesis-base --- xCAT-genesis-builder/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 67e6950fa..137d7f008 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -9,7 +9,7 @@ dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 -dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services +dracut_install poweroff ntpq ntpd ntpdate hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si From 482f6b7fc2f40a592b746b39883e6914c27f2f05 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 13 Dec 2016 13:42:07 -0500 Subject: [PATCH 016/217] Use the -b option to force the time change --- xCAT-genesis-scripts/bin/doxcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index f57234a49..12d4e3191 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -263,7 +263,7 @@ logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' logger -s -t $log_label -p local4.info "Attempting to sync the date with $XCATMASTER..." -ntpdate $XCATMASTER +ntpdate -b $XCATMASTER if [ -e "/dev/rtc" ]; then logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." From 09a661c8003af49905935f7f63a55c1aea32f94a Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 13 Dec 2016 21:58:27 -0500 Subject: [PATCH 017/217] enhance xcatprobe osdeploy functions --- xCAT-probe/lib/perl/LogParse.pm | 29 +++++++--- xCAT-probe/subcmds/osdeploy | 95 ++++++++++++++++++++++++--------- 2 files changed, 92 insertions(+), 32 deletions(-) diff --git a/xCAT-probe/lib/perl/LogParse.pm b/xCAT-probe/lib/perl/LogParse.pm index a7c6e5379..026c1adfe 100644 --- a/xCAT-probe/lib/perl/LogParse.pm +++ b/xCAT-probe/lib/perl/LogParse.pm @@ -249,7 +249,7 @@ sub obtain_one_second_logs { while (<$fd>) { chomp; $self->debuglogger("[$loglabel]read: $_"); - my $log_content_ref = $self->obtain_log_content($self->{log_open_info}->{$loglabel}{filetype}, $_); + my $log_content_ref = $self->obtain_log_content($self->{log_open_info}->{$loglabel}{filetype}, $_, 0); #if read the log whoes time bigger than target time, stop to read $self->debuglogger("\t$log_content_ref->{time} $the_time_to_load"); @@ -472,13 +472,15 @@ sub obtain_log_content { my $self = shift; my $log_type = shift; my $original_log = shift; + my $is_monitor = shift; my %log_content = (); my @split_line = split(/\s+/, $original_log); if ($log_type == $::LOGTYPE_RSYSLOG) { if ($split_line[0] =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(.+)-(.+)/) { - $log_content{time} = $self->convert_to_epoch_seconds($split_line[0]); + $log_content{time_record} = "$4:$5:$6"; + $log_content{time} = $self->convert_to_epoch_seconds($split_line[0], $is_monitor); if (!xCAT::NetworkUtils->isIpaddr($split_line[1])) { my @sender_tmp = split(/\./, $split_line[1]); $log_content{sender} = $sender_tmp[0]; @@ -505,7 +507,8 @@ sub obtain_log_content { } } else { my $timestamp = join(" ", @split_line[ 0 .. 2 ]); - $log_content{time} = $self->convert_to_epoch_seconds($timestamp); + $log_content{time_record} = $split_line[2]; + $log_content{time} = $self->convert_to_epoch_seconds($timestamp, $is_monitor); if (!xCAT::NetworkUtils->isIpaddr($split_line[3])) { my @sender_tmp = split(/\./, $split_line[3]); $log_content{sender} = $sender_tmp[0]; @@ -533,7 +536,10 @@ sub obtain_log_content { } } elsif ($log_type == $::LOGTYPE_HTTP) { $split_line[3] =~ s/^\[(.+)/$1/g; - $log_content{time} = $self->convert_to_epoch_seconds($split_line[3]); + if ($split_line[3] =~ /(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+)/) { + $log_content{time_record} = "$4:$5:$6"; + } + $log_content{time} = $self->convert_to_epoch_seconds($split_line[3], $is_monitor); if (!xCAT::NetworkUtils->isIpaddr($split_line[0])) { my @sender_tmp = split(/\./, $split_line[0]); $log_content{sender} = $sender_tmp[0]; @@ -561,6 +567,7 @@ sub obtain_log_content { sub convert_to_epoch_seconds { my $self = shift; my $timestr = shift; + my $is_monitor = shift; my $yday; my $mday; @@ -581,15 +588,23 @@ sub convert_to_epoch_seconds { ($mday, $dday, $h, $m, $s) = ($1, $2, $3, $4, $5); $yday = $self->{current_ref_year}; $epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday); - if ($epoch_seconds > $self->{current_ref_time}) { - --$yday; - $epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday); + if ($is_monitor) { + if ($epoch_seconds < $self->{current_ref_time}) { + ++$yday; + $epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday); + } + } else { + if ($epoch_seconds > $self->{current_ref_time}) { + --$yday; + $epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday); + } } # The time format looks like "15/Aug/2016:01:10:24" } elsif ($timestr =~ /(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+)/) { $epoch_seconds = timelocal($6, $5, $4, $1, $monthsmap{$2}, $3); } + return $epoch_seconds; } diff --git a/xCAT-probe/subcmds/osdeploy b/xCAT-probe/subcmds/osdeploy index 63231b5e2..4b64f67cd 100755 --- a/xCAT-probe/subcmds/osdeploy +++ b/xCAT-probe/subcmds/osdeploy @@ -330,6 +330,7 @@ sub init_node_state { my @nodes = probe_utils->parse_node_range($noderange); foreach my $node (@nodes) { @{ $node_state_ref->{$node}{statehistory} } = (); + %{ $node_state_ref->{$node}{errors} } = (); $node_state_ref->{$node}{done} = 0; } } @@ -463,7 +464,6 @@ sub conclusion_report { foreach (@{ $node_state_ref->{$node}{statehistory} }) { $stop_stage = $_ if ($stop_stage < $_); $start_rpower = 1 if ($_ == $::STATE_POWER_ON); - $power_on = 1 if ($_ == $::STATE_POWERINGON); $isntalling = 1 if ($_ == $::STATE_INSTALLING); $postbootscript = 1 if ($_ == $::STATE_POSTBOOTSCRIPT); } @@ -476,19 +476,29 @@ sub conclusion_report { # 3 There isn't reboot operation for target node during the rollback time window # That means there isn't provision process happened - if ($start_rpower && !$power_on) { - $failed_node{$node}{non_provision_prediction} = "Trigger target node reboot failed"; - } elsif ($start_rpower && $power_on && !$isntalling && $postbootscript) { - $failed_node{$node}{non_provision_prediction} = "Target node just reboot from disk"; - } elsif (! $start_rpower){ - $failed_node{$node}{non_provision_prediction} = "Without provision process during rollback time window"; + if ($monitor) { + if (!$isntalling && $postbootscript) { + $failed_node{$node}{non_provision_prediction} = "Target node just reboot from disk"; + next; + } } else { - if ($stop_stage != $::STATE_COMPLETED) { - $failed_node{$node}{provision_stop_point} = $stop_stage; + if (! $start_rpower) { + $failed_node{$node}{non_provision_prediction} = "Without provision process during rollback time window"; + next; + } elsif (!$isntalling && $postbootscript) { + $failed_node{$node}{non_provision_prediction} = "Target node just reboot from disk"; + next; } } - } + if ($stop_stage != $::STATE_COMPLETED) { + $failed_node{$node}{provision_stop_point} = $stop_stage; + } + + if (@{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) { + $failed_node{$node}{provision_stop_point} = $stop_stage; + } + } if (%failed_node) { my $failed_node_num = keys %failed_node; @@ -503,6 +513,17 @@ sub conclusion_report { probe_utils->send_msg("stdout", "f", "$node : $failed_node{$node}{non_provision_prediction}"); } else { probe_utils->send_msg("stdout", "f", "$node : stop at stage '$::STATE_DESC{$failed_node{$node}{provision_stop_point}}'"); + if ($failed_node{$node}{provision_stop_point} < $::STATE_POSTSCRIPT) { + foreach my $node_error (@{ $node_state_ref->{$node}{errors}{$failed_node{$node}{provision_stop_point}} }) { + probe_utils->send_msg("stdout", "d", "$node_error"); + } + } else { + for (my $stage = $::STATE_POSTSCRIPT; $stage <= $::STATE_COMPLETED; $stage++) { + foreach my $node_error (@{ $node_state_ref->{$node}{errors}{$stage} }) { + probe_utils->send_msg("stdout", "d", "$node_error"); + } + } + } } } } else { @@ -590,7 +611,7 @@ Start capturing every message during OS provision process.... foreach my $hdl (@hdls) { my $line = ""; chomp($line = <$hdl>); - my $log_content_ref = $log_parse->obtain_log_content($fd_filetype_map{$hdl}, $line); + my $log_content_ref = $log_parse->obtain_log_content($fd_filetype_map{$hdl}, $line, $monitor); dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state); } } @@ -718,7 +739,7 @@ sub handle_dhcp_msg { if (exists $macmap{$mac}) { my $node = $macmap{$mac}{"node"}; my $record = "Receive DHCPDISCOVER via $nic"; - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); } } elsif ($log_ref->{msg} =~ /DHCPOFFER\s+on\s+(.+)\s+to\s+(.+)\s+via\s+(.+)/i) { @@ -729,7 +750,7 @@ sub handle_dhcp_msg { if (exists $macmap{$mac}) { my $node = $macmap{$mac}{"node"}; my $record = "Send DHCPOFFER on $ip back to $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); } } elsif ($log_ref->{msg} =~ /DHCPREQUEST\s+for\s+(.+)\s+[\(\)0-9\.]*\s*from\s+(.+)\s+via\s+(.+)/) { @@ -740,7 +761,7 @@ sub handle_dhcp_msg { if (exists $macmap{$mac}) { my $node = $macmap{$mac}{"node"}; my $record = $log_ref->{msg}; - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); } } elsif ($log_ref->{msg} =~ /DHCPACK\s+on\s+(.+)\s+to\s+(.+)\s+via\s+(.+)/) { @@ -751,7 +772,7 @@ sub handle_dhcp_msg { if (exists $macmap{$mac}) { my $node = $macmap{$mac}{"node"}; my $record = "Send DHCPACK on $ip back to $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); if ($macmap{$mac}{"ip"} != "NOIP" and $macmap{$mac}{"ip"} != $ip) { @@ -770,7 +791,7 @@ sub handle_dhcp_msg { if (exists $macmap{$mac}) { my $node = $macmap{$mac}{"node"}; my $record = "Receive BOOTREQUEST from $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); } } elsif ($log_ref->{msg} =~ /BOOTREPLY\s+for\s+(.+)\s+to\s+.+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) { @@ -781,7 +802,7 @@ sub handle_dhcp_msg { if (exists $macmap{$mac}) { my $node = $macmap{$mac}{"node"}; my $record = "Send BOOTREPLY on $ip back to $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); if ($macmap{$mac}{"ip"} != "NOIP" and $macmap{$mac}{"ip"} != $ip) { @@ -817,7 +838,7 @@ sub handle_tftp_msg { my $file = $2; my $record = "Via TFTP download $file"; if (exists($node_state_ref->{ $ipnodemap{$ip} })) { - probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{ $ipnodemap{$ip} }{log} }, $log_ref->{msg}) if ($debug); if ($file =~ /xcat\/xnba.*/i or $file =~ /\/boot\/grub2\/powerpc-ieee1275\//i or $file =~ /\/yb\/node\/yaboot\-/i) { @@ -852,21 +873,26 @@ sub handle_http_msg { if (exists($node_state_ref->{ $ipnodemap{$ip} })) { - if ($log_ref->{msg} =~ /GET\s+(.+)\s+HTTP.+/ or $log_ref->{msg} =~ /HEAD\s+(.+)\s+HTTP.+/) { + if ($log_ref->{msg} =~ /"GET\s+(.+)\s+HTTP.+" (\d+)/ or $log_ref->{msg} =~ /"HEAD\s+(.+)\s+HTTP.+" (\d+)/) { my $file = $1; + my $http_code = $2; my $record = "Via HTTP get $file"; - probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{ $ipnodemap{$ip} }{log} }, $log_ref->{msg}) if ($debug); if ($file =~ /vmlinuz|inst64/i or ($file =~ /linux/i and $file =~ /osimage/i)) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_KERNEL); + push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_KERNEL} }, "$record failed with $http_code") if ($http_code >= 400); } elsif ($file =~ /initrd/i and $file =~ /osimage/i) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_INITRD); + push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_INITRD} }, "$record failed with $http_code") if ($http_code >= 400); } elsif (($file =~ /^\/install\/autoinst\//i) and ($file !~ /getinstdisk$/i) and ($file !~ /\.pre$/i) and ($file !~ /\.post$/i)) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_KICKSTART); + push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_KICKSTART} }, "$record failed with $http_code") if ($http_code >= 400); } elsif ($file =~ /\.deb$/i or $file =~ /\/Packages\/.+\.rpm$/ or $file =~ /\/suse\/noarch\/.+\.rpm$/i) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_INSTALLRPM); + push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_INSTALLRPM} }, "$record failed with $http_code") if ($http_code >= 400); } } } @@ -897,11 +923,11 @@ sub handle_cluster_msg { my $nodes_str = $split_log[4]; my $sub_command = $split_log[5]; - if ($command eq "rinstall" or $command eq "rnetboot" or ($command eq "rpower" and $sub_command =~ /on|boot|reset/)) { + if ($command eq "rinstall" or $command eq "rnetboot" or ($command eq "rpower" and $sub_command =~ /on|boot|reset/) or ($command eq "xdsh" and $log_msg =~ /reboot|shutdown -r/)) { my @nodes = probe_utils->parse_node_range($nodes_str); foreach my $node (@nodes) { if (exists $node_state_ref->{$node}) { - probe_utils->send_msg("stdout", "d", "[$node] Use command $command to reboot node $node") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} Use command $command to reboot node $node") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); set_node_state($node_state_ref, $node, $::STATE_POWER_ON); } @@ -915,7 +941,7 @@ sub handle_cluster_msg { foreach my $node (@split_node) { if (exists $node_state_ref->{$node}) { - probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); if ($status eq "installing") { @@ -951,16 +977,34 @@ sub handle_compute_msg { my $node = $log_ref->{sender}; if (exists $node_state_ref->{$node}) { - probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{msg}") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $log_ref->{msg}") if ($monitor); push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug); if ($log_ref->{msg} =~ /Running postscript:/i) { set_node_state($node_state_ref, $node, $::STATE_POSTSCRIPT); + } elsif ($log_ref->{msg} =~ /postscript (.+) return with (\d+)/) { + my $script_name = $1; + my $return_code = $2; + if ($return_code != 0) { + my $error_str = "postscript $script_name return with $return_code"; + unless (grep {$_ eq $error_str} @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) { + push @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }, $error_str; + } + } } elsif ($log_ref->{msg} =~ /Running postbootscript:/i) { set_node_state($node_state_ref, $node, $::STATE_POSTBOOTSCRIPT); + } elsif ($log_ref->{msg} =~ /postbootscript (.+) return with (\d+)/) { + my $script_name = $1; + my $return_code = $2; + if ($return_code != 0) { + my $error_str = "postbootscript $script_name return with $return_code"; + unless (grep {$_ eq $error_str} @{ $node_state_ref->{$node}{errors}{$::STATE_POSTBOOTSCRIPT} }) { + push @{ $node_state_ref->{$node}{errors}{$::STATE_POSTBOOTSCRIPT} }, $error_str; + } + } } elsif ($log_ref->{msg} =~ /provision completed/) { set_node_state($node_state_ref, $node, $::STATE_COMPLETED); $node_state_ref->{$node}{done} = 1; - probe_utils->send_msg("stdout", "o", "[$node] provision completed") if ($monitor); + probe_utils->send_msg("stdout", "o", "[$node] $log_ref->{time_record} provision completed") if ($monitor); } } } @@ -1021,6 +1065,7 @@ sub set_node_state { if ($newstate == $::STATE_POWER_ON) { push @{ $node_state_ref->{$node}{allstatehistory} }, @{ $node_state_ref->{$node}{statehistory} }; @{ $node_state_ref->{$node}{statehistory} } = (); + %{ $node_state_ref->{$node}{errors} } = (); push @{ $node_state_ref->{$node}{statehistory} }, $newstate; } else { my $index = @{ $node_state_ref->{$node}{statehistory} } - 1; From c9d09d68cf2c4faa262175514b572e8610c5f44e Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 14 Dec 2016 01:23:30 -0500 Subject: [PATCH 018/217] change file name, replace hyphens by underscores --- xCAT-probe/subcmds/switch_macmap | 136 +++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100755 xCAT-probe/subcmds/switch_macmap diff --git a/xCAT-probe/subcmds/switch_macmap b/xCAT-probe/subcmds/switch_macmap new file mode 100755 index 000000000..3a52ca5df --- /dev/null +++ b/xCAT-probe/subcmds/switch_macmap @@ -0,0 +1,136 @@ +#! /usr/bin/perl +# IBM(c) 2016 EPL license http://www.eclipse.org/legal/epl-v10.html +BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } + +use lib "$::XCATROOT/probe/lib/perl"; +use Cwd 'abs_path'; +use Cwd; +use File::Basename; +use File::Path; +use probe_utils; +use Getopt::Long qw(:config no_ignore_case); + +my $proname = basename("$0"); +my $currdir = dirname(abs_path($0)); +my $output = "stdout"; + +$::USAGE = "Usage: + $proname -h + $proname [-c] [-V] + +Description: + To retrieve MAC address mapping for the specified switch, or all the switches defined in switches table in xCAT db. + Currently, this command does not support hierarchy. + +Options: + -c: Check if the switch is OK to retrieve MAC address mapping. + -V: Output verbose information when accessing the switch +"; + +my $help; +my $test; +my $check; +my @nodes = (); +my $verbose = ''; +if (!GetOptions("help|h" => \$help, + "T" => \$test, + "c" => \$check, + "V" => \$verbose)) { + probe_utils->send_msg("$output", "f", "Option not supported"); + probe_utils->send_msg("$output", "d", $::USAGE); + exit 1; +} +foreach (@ARGV) { + if (/^-\w*/) { + probe_utils->send_msg("$output", "f", "Option $_ not supported"); + exit 1; + } else { + push @nodes, $_; + } +} +if ($help) { + probe_utils->send_msg("$output", "d", $::USAGE); + exit 0; +} + +if (!-d "$currdir/bin") { + mkpath("$currdir/bin/"); +} +if (!-e "$currdir/bin/switchprobe") { + link("$::XCATROOT/bin/xcatclient", "$currdir/bin/switchprobe"); +} + +if ($test) { + `$currdir/bin/switchprobe -h`; + if ($?) { + probe_utils->send_msg("$output", "f", "No 'switchprobe' tool is available at $currdir/bin/"); + exit 1; + } else { + probe_utils->send_msg("$output", "o", "To retrieve MAC address mapping for the specified switch, or all the switches defined in 'switches' table in xCAT db. Currently, this command does not support hierarchy."); + exit 0; + } +} +if ($verbose) { + $verbose = "-V"; +} +my $noderange = join(',', @nodes); +my $normal_file = "/tmp/result_normal"; +my $error_file = "/tmp/result_error"; +if (-f $normal_file) { + unlink($normal_file); +} +if (-f $error_file) { + unlink($error_file); +} +if ($check) { +`$currdir/bin/switchprobe $noderange -c $verbose >$normal_file 2>$error_file`; +} +else { + `$currdir/bin/switchprobe $noderange $verbose >$normal_file 2>$error_file`; +} +if (-f $error_file) { + `cat $error_file >> $normal_file`; +} +my $fd; +open($fd, "<", "$normal_file"); +my @fails = (); +my @error_nodes = (); +# There is 2 kinds of error message: +# 1. Error: The nodetype is not 'switch' for nodes: switch1 +# Error: No switch configuration info find for switch-10-5-23-1 +# 2. switch-10-5-23-1: Error: Timeout +foreach (<$fd>) { + chomp($_); + if (/Error:/) { + if (/^(\S*):\s*Error:\s*(.*)/) { + push @fails, "$1 - $2"; + } elsif (/^Error:\s*The nodetype is not 'switch' for nodes: (.+)/) { + push @error_nodes, "$1"; + } elsif (/^Error:\s*(.*)/) { + push @fails, $1; + } else { + push @fails, $_; + } + } + elsif (/^(\S*):\s*PASS/) { + probe_utils->send_msg("$output", "o", "$1"); + } + else { + probe_utils->send_msg("$output", "d", $_); + } +} +close($fd); +if (-f $normal_file) { + unlink($normal_file); +} +if (-f $error_file) { + unlink($error_file); +} +if (@error_nodes) { + my $error_node = join(",", @error_nodes); + probe_utils->send_msg("$output", "d", "[$error_node] : Error, switch-macmap can only be run against xCAT objects that have 'nodetype=switch'"); +} +foreach (@fails) { + probe_utils->send_msg("$output", "f", "$_"); +} +exit 0; From 9ae9d9c2d23663fff6dec9ac522fef7d17be9f81 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 14 Dec 2016 01:32:24 -0500 Subject: [PATCH 019/217] change file name, replace hyphens by underscores --- xCAT-probe/subcmds/switch-macmap | 136 ------------------------------- 1 file changed, 136 deletions(-) delete mode 100755 xCAT-probe/subcmds/switch-macmap diff --git a/xCAT-probe/subcmds/switch-macmap b/xCAT-probe/subcmds/switch-macmap deleted file mode 100755 index 3a52ca5df..000000000 --- a/xCAT-probe/subcmds/switch-macmap +++ /dev/null @@ -1,136 +0,0 @@ -#! /usr/bin/perl -# IBM(c) 2016 EPL license http://www.eclipse.org/legal/epl-v10.html -BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } - -use lib "$::XCATROOT/probe/lib/perl"; -use Cwd 'abs_path'; -use Cwd; -use File::Basename; -use File::Path; -use probe_utils; -use Getopt::Long qw(:config no_ignore_case); - -my $proname = basename("$0"); -my $currdir = dirname(abs_path($0)); -my $output = "stdout"; - -$::USAGE = "Usage: - $proname -h - $proname [-c] [-V] - -Description: - To retrieve MAC address mapping for the specified switch, or all the switches defined in switches table in xCAT db. - Currently, this command does not support hierarchy. - -Options: - -c: Check if the switch is OK to retrieve MAC address mapping. - -V: Output verbose information when accessing the switch -"; - -my $help; -my $test; -my $check; -my @nodes = (); -my $verbose = ''; -if (!GetOptions("help|h" => \$help, - "T" => \$test, - "c" => \$check, - "V" => \$verbose)) { - probe_utils->send_msg("$output", "f", "Option not supported"); - probe_utils->send_msg("$output", "d", $::USAGE); - exit 1; -} -foreach (@ARGV) { - if (/^-\w*/) { - probe_utils->send_msg("$output", "f", "Option $_ not supported"); - exit 1; - } else { - push @nodes, $_; - } -} -if ($help) { - probe_utils->send_msg("$output", "d", $::USAGE); - exit 0; -} - -if (!-d "$currdir/bin") { - mkpath("$currdir/bin/"); -} -if (!-e "$currdir/bin/switchprobe") { - link("$::XCATROOT/bin/xcatclient", "$currdir/bin/switchprobe"); -} - -if ($test) { - `$currdir/bin/switchprobe -h`; - if ($?) { - probe_utils->send_msg("$output", "f", "No 'switchprobe' tool is available at $currdir/bin/"); - exit 1; - } else { - probe_utils->send_msg("$output", "o", "To retrieve MAC address mapping for the specified switch, or all the switches defined in 'switches' table in xCAT db. Currently, this command does not support hierarchy."); - exit 0; - } -} -if ($verbose) { - $verbose = "-V"; -} -my $noderange = join(',', @nodes); -my $normal_file = "/tmp/result_normal"; -my $error_file = "/tmp/result_error"; -if (-f $normal_file) { - unlink($normal_file); -} -if (-f $error_file) { - unlink($error_file); -} -if ($check) { -`$currdir/bin/switchprobe $noderange -c $verbose >$normal_file 2>$error_file`; -} -else { - `$currdir/bin/switchprobe $noderange $verbose >$normal_file 2>$error_file`; -} -if (-f $error_file) { - `cat $error_file >> $normal_file`; -} -my $fd; -open($fd, "<", "$normal_file"); -my @fails = (); -my @error_nodes = (); -# There is 2 kinds of error message: -# 1. Error: The nodetype is not 'switch' for nodes: switch1 -# Error: No switch configuration info find for switch-10-5-23-1 -# 2. switch-10-5-23-1: Error: Timeout -foreach (<$fd>) { - chomp($_); - if (/Error:/) { - if (/^(\S*):\s*Error:\s*(.*)/) { - push @fails, "$1 - $2"; - } elsif (/^Error:\s*The nodetype is not 'switch' for nodes: (.+)/) { - push @error_nodes, "$1"; - } elsif (/^Error:\s*(.*)/) { - push @fails, $1; - } else { - push @fails, $_; - } - } - elsif (/^(\S*):\s*PASS/) { - probe_utils->send_msg("$output", "o", "$1"); - } - else { - probe_utils->send_msg("$output", "d", $_); - } -} -close($fd); -if (-f $normal_file) { - unlink($normal_file); -} -if (-f $error_file) { - unlink($error_file); -} -if (@error_nodes) { - my $error_node = join(",", @error_nodes); - probe_utils->send_msg("$output", "d", "[$error_node] : Error, switch-macmap can only be run against xCAT objects that have 'nodetype=switch'"); -} -foreach (@fails) { - probe_utils->send_msg("$output", "f", "$_"); -} -exit 0; From 842da3e2ba71a3dd28a44aa391732aed37a2eb96 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Wed, 14 Dec 2016 03:43:23 -0500 Subject: [PATCH 020/217] completed --- .../autotest/bundle/sles12.2_ppc64le.bundle | 228 +++++++++++++++++ .../autotest/bundle/sles12.2_x86_64.bundle | 234 ++++++++++++++++++ 2 files changed, 462 insertions(+) create mode 100644 xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle create mode 100644 xCAT-test/autotest/bundle/sles12.2_x86_64.bundle diff --git a/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle new file mode 100644 index 000000000..469a3527c --- /dev/null +++ b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle @@ -0,0 +1,228 @@ +Diskless_installation_flat_p8_le +Full_installation_flat_p8_le +go_xcat_local_repo_case7 +go_xcat_noinput +go_xcat_with_x +go_xcat_with_xcat-version-1 +go_xcat_online_repo_case6 +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +chdef_null +chdef_z +chdef_t_o_error +chtab_null +chtab_d +chtab_modify_node +chtab_modify_key +chtab_err_symble +chtab_err_table +chtab_h +chtab_v +packimage_o_p_a_m +packimage_imagename +packimage_h +packimage_v +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_tar_c_pigz +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +pping_h +pping_v +pping_node +gettab_key_table +gettab_H +gettab_err +gettab_h +lsdef_null +lsdef_a +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t +lsdef_t_i_o +lsdef_t_w +lsdef_t_err +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +makedhcp_n +makedhcp_a +makedhcp_a_d +makedhcp_d +mkdef_null +mkdef_z +mkdef_t_o_error +nodeadd_noderange +nodeadd_err_symbol +nodeadd_null +nodeadd_noderange_nodetype +nodeadd_v +nodeadd_h +nodegrpch_v +nodegrpch_h +nodegrpch_groups +nodegrpch_err +nodech_noderange_table +nodech_noderange_table_comma +nodech_noderange_table_arrow +nodech_noderanage_table_at +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_v +nodech_noderange_table_include +nodech_noderange_table_uninclude +nodech_noderange_table_equal +nodech_noderange_table_unequal +nodech_noderange_shortname_groups +nodech_noderange_shortname_tags +nodech_noderange_shortname_mgt +nodels_null +nodels_H +nodels_noderange +nodels_err_symbol +nodels_err_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_tags +nodels_noderange_shortname_mgt +nodels_table_include +nodels_noderange_table_uninclude +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_b +nodels_S +nodels_noderange_table +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_noderange_tablecolumn +nodels_h +nodels_v +xcatstanzafile_colon +xcatstanzafile_attribute +xcatstanzafile_objtype +xcatstanzafile_tab +xcatstanzafile_multattr +xcatstanzafile_defaultvalue +xcatstanzafile_specificvalue +noderm_noderange +noderm_h +noderm_null +noderm_err_node +nodeset_stat +nodeset_noderange +nodestat_err_node +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_err_noderange +rvitals_noderange_err +tabdump_table +tabdump_d +tabdump_v +tabdump_h +tabdump_help +tabdump_w_match +tabdump_w_equal +tabdump_w_ne +tabdump_w_notmatch +tabdump_w_gt +tabdump_w_ge +tabdump_w_lt +tabdump_w_le +tabdump_f_d +tabdump_d_nodehm +tabprune_h +tabprune_v +tabprune_a_eventlog +tabprune_V_a_eventlog +tabprune_i_auditlog +tabprune_V_n_auditlog +tabgrep_node +tabgrep_null +tabgrep_h +tabgrep_err +tabrestore_table +tabrestore_null +tabrestore_h +tabrestore_err +dumpxCATdb_h +dumpxCATdb_v +dumpxCATdb_p_nullskiptables +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_p_skiptables +dumpxCATdb_a_p_skiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_p_V +restorexCAT_h +restorexCATdb_v +restorexCATdb_p_V +restorexCATdb_a_p_V +restorexCATdb_wrongpath +regnotif_null +regnotif_o +regnotif_err +regnotif_h +regnotif_v +unregnotif_null +unregnotif_f +unregnotif_h +unregnotif_v +lsxcatd_null +lsxcatd_h +lsxcatd_d +lsxcatd_a +makedns_d_node +makedns_n +makedns +copycds_iso +copycds_n +copycds_a +copycds_n_a +copycds_a_err +copycds_n_err +xdsh_h +xdsh_V +xdsh_regular_command +xdsh_Q_command +xdsh_c_cn +xdsh_e_filename +xdsh_E +xdsh_i_linux +xdsh_t +xdsh_q +xdsh_T +xdsh_o +switchdiscover_range_default +switchdiscover_h +switchdiscover_range_s +switchdiscover_range_default_w +switchdiscover_range_r +switchdiscover_range_x +switchdiscover_range_z +switchdiscover_range_z_V +nodeset_shell +nodeset_cmdline +nodeset_runimg +xcatd_start_systemd +xcatd_stop_systemd +xcatd_restart_systemd +run_command_with_XCATBYPASS_systemd +disable_root_permission_in_policy_table_systemd +assign_certain_command_permission_systemd +xcatconfig_u_check_xcatsslversion_rhels_sles +sles_migration1 +sles_migration2 +reg_linux_statelite_installation_flat +SN_setup_case +reg_linux_diskfull_installation_hierarchy +reg_linux_diskless_installation_hierarchy +reg_linux_statelite_installation_hierarchy_by_ramdisk +reg_linux_statelite_installation_hierarchy_by_nfs +clean_up_env diff --git a/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle new file mode 100644 index 000000000..225f6cdad --- /dev/null +++ b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle @@ -0,0 +1,234 @@ +reg_linux_diskfull_installation_flat +go_xcat_local_repo_case7 +go_xcat_noinput +go_xcat_with_x +go_xcat_with_xcat-version-1 +go_xcat_online_repo_case6 +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +chdef_null +chdef_z +chdef_t_o_error +chtab_null +chtab_d +chtab_modify_node +chtab_modify_key +chtab_err_symble +chtab_err_table +chtab_h +chtab_v +packimage_o_p_a_m +packimage_imagename +packimage_h +packimage_v +pping_h +pping_v +pping_node +gettab_key_table +gettab_H +gettab_err +gettab_h +lsdef_null +lsdef_a +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t +lsdef_t_i_o +lsdef_t_w +lsdef_t_err +lslite_i +lslite_noderange +lslite_h +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +makedhcp_n +makedhcp_a +makedhcp_a_d +makedhcp_d +mkdef_null +mkdef_z +mkdef_t_o_error +nodeadd_noderange +nodeadd_err_symbol +nodeadd_null +nodeadd_noderange_nodetype +nodeadd_v +nodeadd_h +nodegrpch_v +nodegrpch_h +nodegrpch_groups +nodegrpch_err +nodech_noderange_table +nodech_noderange_table_comma +nodech_noderange_table_arrow +nodech_noderanage_table_at +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_v +nodech_noderange_table_include +nodech_noderange_table_uninclude +nodech_noderange_table_equal +nodech_noderange_table_unequal +nodech_noderange_shortname_groups +nodech_noderange_shortname_tags +nodech_noderange_shortname_mgt +nodels_null +nodels_H +nodels_noderange +nodels_err_symbol +nodels_err_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_tags +nodels_noderange_shortname_mgt +nodels_table_include +nodels_noderange_table_uninclude +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_b +nodels_S +nodels_noderange_table +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_noderange_tablecolumn +nodels_h +nodels_v +xcatstanzafile_normal +xcatstanzafile_colon +xcatstanzafile_attribute +xcatstanzafile_objtype +xcatstanzafile_tab +xcatstanzafile_multattr +xcatstanzafile_defaultvalue +xcatstanzafile_specificvalue +noderm_noderange +noderm_h +noderm_null +noderm_err_node +nodeset_stat +nodeset_noderange +nodestat_noderange +nodestat_err_node +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_err_noderange +rvitals_noderange_err +tabdump_table +tabdump_d +tabdump_v +tabdump_h +tabdump_help +tabdump_w_match +tabdump_w_equal +tabdump_w_ne +tabdump_w_notmatch +tabdump_w_gt +tabdump_w_ge +tabdump_w_lt +tabdump_w_le +tabdump_f_d +tabdump_d_nodehm +tabprune_h +tabprune_v +tabprune_a_eventlog +tabprune_V_a_eventlog +tabprune_i_auditlog +tabprune_V_n_auditlog +tabgrep_node +tabgrep_null +tabgrep_h +tabgrep_err +tabrestore_table +tabrestore_null +tabrestore_h +tabrestore_err +dumpxCATdb_h +dumpxCATdb_v +dumpxCATdb_p_nullskiptables +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_p_skiptables +dumpxCATdb_a_p_skiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_p_V +restorexCAT_h +restorexCATdb_v +restorexCATdb_p_V +restorexCATdb_a_p_V +restorexCATdb_wrongpath +regnotif_null +regnotif_o +regnotif_err +regnotif_h +regnotif_v +unregnotif_null +unregnotif_f +unregnotif_h +unregnotif_v +lsxcatd_null +lsxcatd_h +lsxcatd_d +lsxcatd_a +makedns_d_node +makedns_n +makedns +copycds_iso +copycds_n +copycds_a +copycds_n_a +copycds_a_err +copycds_n_err +xdsh_h +xdsh_V +xdsh_regular_command +xdsh_Q_command +xdsh_c_cn +xdsh_e_filename +xdsh_E +xdsh_i_linux +xdsh_t +xdsh_q +xdsh_T +xdsh_o +switchdiscover_range_default +switchdiscover_h +switchdiscover_range_s +switchdiscover_range_default_w +switchdiscover_range_r +switchdiscover_range_x +switchdiscover_range_z +switchdiscover_range_z_V +nodeset_shell +nodeset_cmdline +nodeset_runimg +nodeset_check_warninginfo +xcatd_start_systemd +xcatd_stop_systemd +xcatd_restart_systemd +run_command_with_XCATBYPASS_systemd +disable_root_permission_in_policy_table_systemd +assign_certain_command_permission_systemd +xcatconfig_u_check_xcatsslversion_rhels_sles +sles_migration1 +sles_migration2 +reg_linux_diskless_installation_flat +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_tar_c_pigz +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +reg_linux_statelite_installation_flat +SN_setup_case +reg_linux_diskfull_installation_hierarchy +reg_linux_diskless_installation_hierarchy +reg_linux_statelite_installation_hierarchy_by_ramdisk +reg_linux_statelite_installation_hierarchy_by_nfs +clean_up_env From 4897acedf787a5ffd93822cf39c7a71658e610e7 Mon Sep 17 00:00:00 2001 From: zet809 Date: Wed, 14 Dec 2016 17:35:55 +0800 Subject: [PATCH 021/217] Revert "[CUSTOMER] Use ntpdate in genesis kernel instead of starting the ntp daemon to reduce discovery time" --- xCAT-genesis-builder/install | 2 +- xCAT-genesis-scripts/bin/doxcat | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 137d7f008..67e6950fa 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -9,7 +9,7 @@ dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 -dracut_install poweroff ntpq ntpd ntpdate hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services +dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 12d4e3191..6a637fb91 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -260,10 +260,11 @@ fi openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" + ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' -logger -s -t $log_label -p local4.info "Attempting to sync the date with $XCATMASTER..." -ntpdate -b $XCATMASTER +logger -s -t $log_label -p local4.info "Starting ntpd..." +ntpd -g -x if [ -e "/dev/rtc" ]; then logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." @@ -271,6 +272,13 @@ if [ -e "/dev/rtc" ]; then disown fi +# rv 0 state does not work with the new ntp versions +logger -s -t $log_label -p local4.info "Checking ntpq for the offset values..." +while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do + sleep 1 +done +logger -s -t $log_label -p local4.info "Checking ntpq for the offset values... Done" + logger -s -t $log_label -p local4.info "Restarting syslog..." read -r RSYSLOG_PID /dev/null kill "$RSYSLOG_PID" 2>/dev/null From 27a35ff46c12d4b40480634cc68faa88e2538b05 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Dec 2016 08:19:09 -0500 Subject: [PATCH 022/217] modify makedhcp -q issue --- .../autotest/testcase/installation/Full_installation_flat_p8_le | 2 +- .../testcase/installation/reg_linux_SN_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../installation/reg_linux_diskfull_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- .../installation/reg_linux_diskless_installation_hierarchy | 2 +- .../testcase/installation/ubuntu_diskless_installation_vm | 2 +- .../autotest/testcase/installation/ubuntu_full_installation_vm | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index a058f5560..66aeb4c49 100644 --- a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -16,7 +16,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$CN cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index 0ff095d64..20a536aa7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -20,7 +20,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$SN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$SN cmd:chdef -t node $$SN groups=service,all diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index b9c7d65bf..4ec302dfd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -28,7 +28,7 @@ check:rc==0 cmd:makedhcp -a check:rc==0 cmd:sleep 10 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$CN cmd:copycds $$ISO diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index 355887076..b33db473e 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -23,7 +23,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:output=~$$CN check:rc==0 cmd:copycds $$ISO diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 32cd3a986..7ac0f0711 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -17,7 +17,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 43de73914..b0977c417 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -21,7 +21,7 @@ cmd:makedhcp -a check:rc==0 cmd:service dhcpd restart check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$CN diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index 568c3125f..d29e8cfae 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -15,7 +15,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$CN cmd:makeconservercf $$CN diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm index 274ad028f..3a6c2559b 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm @@ -10,7 +10,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done check:rc==0 check:output=~$$CN cmd:makeconservercf $$CN From 3266a819b475067ca6521885ceee8eedd0fc46af Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 15 Dec 2016 01:00:21 -0500 Subject: [PATCH 023/217] correct the doc on ubt upgrade --- docs/source/guides/install-guides/apt/update_xcat.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/install-guides/apt/update_xcat.rst b/docs/source/guides/install-guides/apt/update_xcat.rst index dfa08f6f5..bc1aa8cdf 100644 --- a/docs/source/guides/install-guides/apt/update_xcat.rst +++ b/docs/source/guides/install-guides/apt/update_xcat.rst @@ -3,6 +3,6 @@ Updating xCAT If at a later date you want to update xCAT, first, update the software repositories and then run: :: apt-get update - apt-get --only-upgrade install xcat* + apt-get -y --only-upgrade install *xcat* From ac2cb01097e1678b66231218e588c0e6721d5103 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 15 Dec 2016 04:47:20 -0500 Subject: [PATCH 024/217] modify ubuntu migration test for ubuntu migration hang issue --- xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 3e6d26560..1e473c166 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -104,7 +104,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 --only-upgrade install *xcat*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 7b7133c17..ad3bb7913 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -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 --only-upgrade install *xcat*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 25d1707cc..c30790aec 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -104,7 +104,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 --only-upgrade install *xcat*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index c8acb1318..f4cbc3f2b 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -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 --only-upgrade install *xcat*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 From 3c0f8e9e0cc373b47accc179a836ef28c8528267 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 15 Dec 2016 06:31:17 -0500 Subject: [PATCH 025/217] modify makedhcp -q issue --- .../testcase/installation/Full_installation_flat_p8_le | 3 +-- .../testcase/installation/reg_linux_SN_installation_hierarchy | 3 +-- .../testcase/installation/reg_linux_diskfull_installation_flat | 3 +-- .../installation/reg_linux_diskfull_installation_hierarchy | 3 +-- .../testcase/installation/reg_linux_diskless_installation_flat | 3 +-- .../installation/reg_linux_diskless_installation_hierarchy | 3 +-- .../testcase/installation/ubuntu_diskless_installation_vm | 3 +-- .../autotest/testcase/installation/ubuntu_full_installation_vm | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index 66aeb4c49..0b7779db2 100644 --- a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -16,9 +16,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:makedns -n check:rc==0 cmd:makeconservercf $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index 20a536aa7..f9d36a595 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -20,9 +20,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$SN);[ $? -ne 0 ] && exit 1;echo $output|grep $$SN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$SN cmd:chdef -t node $$SN groups=service,all check:rc==0 cmd:chdef -t group -o service profile=service primarynic=mac installnic=mac diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 4ec302dfd..c99eb4aa0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -28,9 +28,8 @@ check:rc==0 cmd:makedhcp -a check:rc==0 cmd:sleep 10 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:copycds $$ISO check:rc==0 cmd:chdef -t node -o $$CN postscripts=setupntp diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index b33db473e..5e3ce50c8 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -23,8 +23,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done -check:output=~$$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 7ac0f0711..9b3c04e60 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -17,9 +17,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index b0977c417..219d8cda9 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -21,9 +21,8 @@ cmd:makedhcp -a check:rc==0 cmd:service dhcpd restart check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index d29e8cfae..492a26820 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -15,9 +15,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:makeconservercf $$CN check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm index 3a6c2559b..951693ce7 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm @@ -10,9 +10,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true;do output=`makedhcp -q $$CN|grep $$CN`;if [ $? -gt 0 ]; then let a++;sleep 1; else exit 0;fi; if [ $a -gt 100 ]; then exit 1;fi done +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN From 3d3f367f69d18e09e849101d7110e16536cc2030 Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 15 Dec 2016 17:12:19 +0800 Subject: [PATCH 026/217] Fix DB error caused by alarm 'xCAT::MsgUtils->trace' will retrive data from xCAT site table, at this time timeout event happens and alarm signal received, current process will exit unexpectly. partial-bug: pmr 87739,077,724 --- xCAT-server/sbin/xcatd | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 2cffabf5c..a2122f4d8 100644 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1514,9 +1514,6 @@ until ($quit) { $$progname = "xcatd SSL: Instance for " . ($peername ? $peername . "@" . $peerhost : $peerhost) if $peerhost; service_connection($connection, $peername, $peerhost, $peerfqdn, $peerhostorg); - - $debugmsg = "xcatd: close connection with " . ($peername ? $peername . "@" . $peerhost : $peerhost) . "\n"; - xCAT::MsgUtils->trace(0, "D", "$debugmsg"); xexit(0); } if ($sslfudgefactor) { $sslfudgefactor -= 1; } @@ -2636,7 +2633,6 @@ sub service_connection { my $peerfqdn = shift; my $peerhostorg = shift; my $peerport = $sock->peerport; - my %tables = (); # some paranoid measures could reduce a third party abusing stage3 image to attempting to get USER/PASS for BMCs: # -Well, minimally, ignore requests if requesting node is not in spconfig mode (stage3) @@ -2873,12 +2869,10 @@ sub service_connection { cmdlog_submitlog(); # ----used for command log end--------- - + my $debugmsg = "xcatd: close connection with " . ($peername ? $peername . "@" . $peerhost : $peerhost) . "\n"; + xCAT::MsgUtils->trace(0, "D", "$debugmsg"); $SIG{ALRM} = sub { xCAT::MsgUtils->message("S", "$$ failed shutting down"); die; }; alarm(10); - foreach (keys %tables) { - $tables{$_}->commit; - } $sock->close(SSL_fast_shutdown => 1); if ($timedout == 1) { printf("Client timeout"); From 9939be28dbae686b6c322e4bc463482733719c80 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 15 Dec 2016 10:20:34 -0500 Subject: [PATCH 027/217] Modify usage for config switch scripts --- xCAT-server/share/xcat/scripts/configBNT | 17 +++++----- xCAT-server/share/xcat/scripts/configMellanox | 16 ++++++---- xCAT-server/share/xcat/scripts/configcumulus | 31 ++++++------------- 3 files changed, 28 insertions(+), 36 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configBNT b/xCAT-server/share/xcat/scripts/configBNT index 3dc4062bc..23e81e656 100755 --- a/xCAT-server/share/xcat/scripts/configBNT +++ b/xCAT-server/share/xcat/scripts/configBNT @@ -158,7 +158,7 @@ sub config_ip { # don't need to set if ip addresses are same if ($dip eq $static_ip) { print "static ip $static_ip and discovery ip $dip is same, will not process command for $switch\n"; - $cmd = "chdef $csw otherinterfaces="; + $cmd = "chdef $switch otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); next; } @@ -545,15 +545,16 @@ sub config_desc { sub usage { print "Usage: - configBNT [-?│-h│--help] - configBNT [--switches switchnames] [--all] - configBNT [--switches switchnames] [--ip] - configBNT [--switches switchnames] [--name ] - configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group] - configBNT [--switches switchnames] [--port port] [--vlan vlan] + configBNT -h│--help + configBNT --switches switchnames --ip + 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 ip address, hostname and config snmp: + configBNT --switches switchnames --all To set the description for a port on the switch: - configBNT --switches switchnames --port port --desc \"description\" \n"; } diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index f0a771488..2e6f1db34 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -329,12 +329,16 @@ sub run_rspconfig { sub usage { print "Usage: - configMellanox [-?│-h│--help] - configMellanox [--switches switchnames] [--all] - configMellanox [--switches switchnames] [--ip] - configMellanox [--switches switchnames] [--name] - configMellanox [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--auth snmp_auth] - configMellanox [--switches switchnames] [--config] + configMellanox -h│--help + configMellanox --switches switchnames --ip + configMellanox --switches switchnames --name + configMellanox --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--auth snmp_auth] + + To set the ip address, hostname, config snmp and run rspconfig command: + configMellanox --switches switchnames --all + + To run rspconfig command: + configMellanox --switches switchnames --config \n"; } diff --git a/xCAT-server/share/xcat/scripts/configcumulus b/xCAT-server/share/xcat/scripts/configcumulus index 7a6cbb55d..d367c2977 100755 --- a/xCAT-server/share/xcat/scripts/configcumulus +++ b/xCAT-server/share/xcat/scripts/configcumulus @@ -227,6 +227,7 @@ sub install_license { print "file = $license_file\n"; if (!(-e $license_file) ) { print "$license_file is not exist\n"; + return; } foreach my $switch (@nodes) { @@ -371,21 +372,6 @@ sub config_ntp { } -sub config_vlan { - if ($::PORT) { - $port = $::PORT; - } else { - &usage; - exit(1); - } - $vlan = $::VLAN; - print "Tagging VLAN=$vlan for $switches port $port\n"; - #create vlan, tagged vlan - #$cmd = `xdsh $switches --devicetype EthSwitch::BNT "enable;configure terminal;vlan $vlan;exit;interface port $port;switchport mode trunk;switchport trunk allowed vlan $vlan;write memory;exit;exit"`; - -} - - #--------------------------------------------------------- =head3 usage @@ -398,13 +384,14 @@ sub config_vlan { sub usage { print "Usage: - configBNT [-?│-h│--help] - configBNT [--switches switchnames] [--all] - configBNT [--switches switchnames] [--ssh] - configBNT [--switches switchnames] [--license filename ] - configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group] - configBNT [--switches switchnames] [--ntp] - configBNT [--switches switchnames] [--port port] [--vlan vlan] + configcumulus -h│--help + configcumulus --switches switchnames --ssh + configcumulus --switches switchnames --license filename + configcumulus --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group] + configcumulus --switches switchnames --ntp + + To set ssh, install license(license file: /root/license.txt), config snmp and ntp: + configcumulus --switches switchnames --all \n"; } From 1f113afdc837ecf11bdfc826304e466688663a12 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 15 Dec 2016 15:32:41 -0500 Subject: [PATCH 028/217] makeconservercf -d to remove all xCAT nodes --- .../admin-guides/references/man8/makeconservercf.8.rst | 10 ++++++---- xCAT-client/pods/man8/makeconservercf.8.pod | 10 ++++++---- xCAT-server/lib/xcat/plugins/conserver.pm | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst b/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst index 28221da31..19ae43ea6 100644 --- a/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **makeconservercf**\ [\ **-V|-**\ **-verbose**\ ] [\ **-d|-**\ **-delete**\ ] \ *noderange*\ +\ **makeconservercf**\ [\ **-V|-**\ **-verbose**\ ] [\ **-d|-**\ **-delete**\ ] [\ *noderange*\ ] \ **makeconservercf**\ [\ **-V|-**\ **-verbose**\ ] [\ **-l|-**\ **-local**\ ] [\ *noderange*\ ] @@ -36,14 +36,16 @@ DESCRIPTION The \ **makeconservercf**\ command will write out the /etc/conserver.cf, using information from the nodehm table -and related tables (e.g. mp, ipmi, ppc). Normally, \ **makeconservercf**\ will write all nodes to the conserver.cf -file. If a noderange is specified, it will write on those nodes to the file. In either case, if a node +and related tables (e.g. mp, ipmi, ppc). Normally, \ **makeconservercf**\ will write all nodes to the /etc/conserver.cf +file. If a \ *noderange*\ is specified, it will write only those nodes to the file. In either case, if a node does not have nodehm.cons set, it will not be written to the file. +If \ **-d**\ is specified, \ **makeconservercf**\ will remove specified nodes from /etc/conserver.cf file. If \ *noderange*\ is not specified, all xCAT nodes will be removed from /etc/conserver.cf file. + In the case of a hierarchical cluster (i.e. one with service nodes) \ **makeconservercf**\ will determine which nodes will have their consoles accessed from the management node and which from a service node (based on the nodehm.conserver attribute). The /etc/conserver.cf file will be created accordingly on -all relevant management/service nodes. If -l is specified, it will only create the local file. +all relevant management/service nodes. If \ **-l**\ is specified, it will only create the local file. ******* diff --git a/xCAT-client/pods/man8/makeconservercf.8.pod b/xCAT-client/pods/man8/makeconservercf.8.pod index 06ea193c6..5b4dad03d 100644 --- a/xCAT-client/pods/man8/makeconservercf.8.pod +++ b/xCAT-client/pods/man8/makeconservercf.8.pod @@ -4,7 +4,7 @@ B - creates the conserver configuration file from info in the x =head1 SYNOPSIS -B [B<-V|--verbose>] [B<-d|--delete>] I +B [B<-V|--verbose>] [B<-d|--delete>] [I] B [B<-V|--verbose>] [B<-l|--local>] [I] @@ -18,14 +18,16 @@ B [B<-h|--help|-v|--version>] =head1 DESCRIPTION The B command will write out the /etc/conserver.cf, using information from the nodehm table -and related tables (e.g. mp, ipmi, ppc). Normally, B will write all nodes to the conserver.cf -file. If a noderange is specified, it will write on those nodes to the file. In either case, if a node +and related tables (e.g. mp, ipmi, ppc). Normally, B will write all nodes to the /etc/conserver.cf +file. If a I is specified, it will write only those nodes to the file. In either case, if a node does not have nodehm.cons set, it will not be written to the file. +If B<-d> is specified, B will remove specified nodes from /etc/conserver.cf file. If I is not specified, all xCAT nodes will be removed from /etc/conserver.cf file. + In the case of a hierarchical cluster (i.e. one with service nodes) B will determine which nodes will have their consoles accessed from the management node and which from a service node (based on the nodehm.conserver attribute). The /etc/conserver.cf file will be created accordingly on -all relevant management/service nodes. If -l is specified, it will only create the local file. +all relevant management/service nodes. If B<-l> is specified, it will only create the local file. =head1 OPTIONS diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 8fdc5dfec..24336d186 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -428,7 +428,7 @@ sub makeconservercf { # Now add into the file all the node entries that we kept my $node; - if ($node = donodeent(\%cfgenthash, \@filecontent)) { + if ($node = donodeent(\%cfgenthash, \@filecontent, $delmode)) { # donodeent will return the 1st node in error #$cb->({node=>[{name=>$node,error=>"Bad configuration, check attributes under the nodehm category",errorcode=>1}]}); From 34ab88985c58bf52ac90cd50d8bb2e5f92ac281b Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Dec 2016 20:57:53 -0500 Subject: [PATCH 029/217] modified depending on comments --- xCAT-probe/lib/perl/LogParse.pm | 14 ++++----- xCAT-probe/lib/perl/probe_global_constant.pm | 4 +++ xCAT-probe/subcmds/discovery | 4 +-- xCAT-probe/subcmds/osdeploy | 32 ++++++++++---------- xCAT-probe/xcatprobe | 5 ++- 5 files changed, 33 insertions(+), 26 deletions(-) diff --git a/xCAT-probe/lib/perl/LogParse.pm b/xCAT-probe/lib/perl/LogParse.pm index 026c1adfe..3161703ac 100644 --- a/xCAT-probe/lib/perl/LogParse.pm +++ b/xCAT-probe/lib/perl/LogParse.pm @@ -23,6 +23,7 @@ use File::Basename; Arguments: Public attributes: $self->{verbose}:scalar, Offer verbose information, used for handling feature logic + $self->{load_type}:scalar, $::MONITOR or $::REPLAY, used for distinguishing monitor and replay. private attributes: $self->{log_open_info}: reference of a hash, used to save the log file operating information. $self->{current_ref_year}: scalar, the year information of current time. such as 2016. Used for log time parsing @@ -50,6 +51,7 @@ sub new { my $self = {}; my $class = shift; $self->{verbose} = shift; + $self->{load_type} = shift; my %log_open_info; $self->{log_open_info} = \%log_open_info; @@ -249,7 +251,7 @@ sub obtain_one_second_logs { while (<$fd>) { chomp; $self->debuglogger("[$loglabel]read: $_"); - my $log_content_ref = $self->obtain_log_content($self->{log_open_info}->{$loglabel}{filetype}, $_, 0); + my $log_content_ref = $self->obtain_log_content($self->{log_open_info}->{$loglabel}{filetype}, $_); #if read the log whoes time bigger than target time, stop to read $self->debuglogger("\t$log_content_ref->{time} $the_time_to_load"); @@ -472,7 +474,6 @@ sub obtain_log_content { my $self = shift; my $log_type = shift; my $original_log = shift; - my $is_monitor = shift; my %log_content = (); my @split_line = split(/\s+/, $original_log); @@ -480,7 +481,7 @@ sub obtain_log_content { if ($log_type == $::LOGTYPE_RSYSLOG) { if ($split_line[0] =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(.+)-(.+)/) { $log_content{time_record} = "$4:$5:$6"; - $log_content{time} = $self->convert_to_epoch_seconds($split_line[0], $is_monitor); + $log_content{time} = $self->convert_to_epoch_seconds($split_line[0]); if (!xCAT::NetworkUtils->isIpaddr($split_line[1])) { my @sender_tmp = split(/\./, $split_line[1]); $log_content{sender} = $sender_tmp[0]; @@ -508,7 +509,7 @@ sub obtain_log_content { } else { my $timestamp = join(" ", @split_line[ 0 .. 2 ]); $log_content{time_record} = $split_line[2]; - $log_content{time} = $self->convert_to_epoch_seconds($timestamp, $is_monitor); + $log_content{time} = $self->convert_to_epoch_seconds($timestamp); if (!xCAT::NetworkUtils->isIpaddr($split_line[3])) { my @sender_tmp = split(/\./, $split_line[3]); $log_content{sender} = $sender_tmp[0]; @@ -539,7 +540,7 @@ sub obtain_log_content { if ($split_line[3] =~ /(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+)/) { $log_content{time_record} = "$4:$5:$6"; } - $log_content{time} = $self->convert_to_epoch_seconds($split_line[3], $is_monitor); + $log_content{time} = $self->convert_to_epoch_seconds($split_line[3]); if (!xCAT::NetworkUtils->isIpaddr($split_line[0])) { my @sender_tmp = split(/\./, $split_line[0]); $log_content{sender} = $sender_tmp[0]; @@ -567,7 +568,6 @@ sub obtain_log_content { sub convert_to_epoch_seconds { my $self = shift; my $timestr = shift; - my $is_monitor = shift; my $yday; my $mday; @@ -588,7 +588,7 @@ sub convert_to_epoch_seconds { ($mday, $dday, $h, $m, $s) = ($1, $2, $3, $4, $5); $yday = $self->{current_ref_year}; $epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday); - if ($is_monitor) { + if ($self->{load_type} == $::MONITOR) { if ($epoch_seconds < $self->{current_ref_time}) { ++$yday; $epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday); diff --git a/xCAT-probe/lib/perl/probe_global_constant.pm b/xCAT-probe/lib/perl/probe_global_constant.pm index 44b683117..db83a833d 100644 --- a/xCAT-probe/lib/perl/probe_global_constant.pm +++ b/xCAT-probe/lib/perl/probe_global_constant.pm @@ -2,6 +2,10 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html package probe_global_constant; +#The type of load log +$::MONITOR = 0; +$::REPLAY = 1; + #The type of log $::LOGTYPE_RSYSLOG = 0; #rsyslog $::LOGTYPE_HTTP = 1; #apache log diff --git a/xCAT-probe/subcmds/discovery b/xCAT-probe/subcmds/discovery index 080d10ce0..258ab9829 100755 --- a/xCAT-probe/subcmds/discovery +++ b/xCAT-probe/subcmds/discovery @@ -914,7 +914,7 @@ sub do_monitor { my %fd_filetype_map; { #a very important brace to hold a code block - my $log_parse = LogParse->new($verbose); + my $log_parse = LogParse->new($verbose, $::MONITOR); my $candidate_log_ref = $log_parse->obtain_log_file_list(); #open candidate log file to obtain realtime log @@ -1071,7 +1071,7 @@ sub do_replay { print Dumper \%node_state; } - my $log_parse = LogParse->new($verbose); + my $log_parse = LogParse->new($verbose, $::REPLAY); my @candidate_mn_hostname_in_log = $log_parse->obtain_candidate_mn_hostname_in_log(); while ($start_time_of_replay < $end_time_of_replay) { diff --git a/xCAT-probe/subcmds/osdeploy b/xCAT-probe/subcmds/osdeploy index 4b64f67cd..b41ca4e1b 100755 --- a/xCAT-probe/subcmds/osdeploy +++ b/xCAT-probe/subcmds/osdeploy @@ -375,7 +375,7 @@ sub do_replay { print Dumper \%node_state; } - my $log_parse = LogParse->new($verbose); + my $log_parse = LogParse->new($verbose, $::REPLAY); my @candidate_mn_hostname_in_log = $log_parse->obtain_candidate_mn_hostname_in_log(); while ($start_time_of_replay < $end_time_of_replay) { @@ -455,7 +455,6 @@ sub conclusion_report { my $stop_stage = 0; my $start_rpower = 0; - my $power_on = 0; my $isntalling = 0; my $postbootscript = 0; @@ -468,12 +467,10 @@ sub conclusion_report { $postbootscript = 1 if ($_ == $::STATE_POSTBOOTSCRIPT); } - # Cover limited non-privision error - # 1 if xcatd receive reboot command to do provision (such like rpower, rnetboot, rinstall...) but the node status didn't change to "powering-on" - # that means reboot target node failed. - # 2 if power on target node successfully and there is 'running postbootscript' in node state history, but without "installing" state, + # Cover limited non-privision error + # 1 if power on target node successfully and there is 'running postbootscript' in node state history, but without "installing" state, # It is very possible to just do reboot process - # 3 There isn't reboot operation for target node during the rollback time window + # 2 When replay, if there isn't reboot operation for target node during the rollback time window # That means there isn't provision process happened if ($monitor) { @@ -491,11 +488,8 @@ sub conclusion_report { } } - if ($stop_stage != $::STATE_COMPLETED) { - $failed_node{$node}{provision_stop_point} = $stop_stage; - } - - if (@{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) { + # if not completed or completed but with postscript error, add node to failed_node hash + if ($stop_stage != $::STATE_COMPLETED or @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) { $failed_node{$node}{provision_stop_point} = $stop_stage; } } @@ -512,15 +506,19 @@ sub conclusion_report { if ($failed_node{$node}{non_provision_prediction}) { probe_utils->send_msg("stdout", "f", "$node : $failed_node{$node}{non_provision_prediction}"); } else { + my $node_length = length($node); + my $space_str = " " x ($length_node + 2); + # if stop at stage before postscript, means there is error at current stage, print error message probe_utils->send_msg("stdout", "f", "$node : stop at stage '$::STATE_DESC{$failed_node{$node}{provision_stop_point}}'"); if ($failed_node{$node}{provision_stop_point} < $::STATE_POSTSCRIPT) { foreach my $node_error (@{ $node_state_ref->{$node}{errors}{$failed_node{$node}{provision_stop_point}} }) { - probe_utils->send_msg("stdout", "d", "$node_error"); + probe_utils->send_msg("stdout", "d", "$space_str $node_error"); } } else { + # if stop at postscript or after postscript, check whether has error from postscript, if has print for (my $stage = $::STATE_POSTSCRIPT; $stage <= $::STATE_COMPLETED; $stage++) { foreach my $node_error (@{ $node_state_ref->{$node}{errors}{$stage} }) { - probe_utils->send_msg("stdout", "d", "$node_error"); + probe_utils->send_msg("stdout", "d", "$space_str $node_error"); } } } @@ -569,7 +567,7 @@ Start capturing every message during OS provision process.... my %fd_filetype_map; { #a very important brace to hold a code block - my $log_parse = LogParse->new($verbose); + my $log_parse = LogParse->new($verbose, $::MONITOR); my $candidate_log_ref = $log_parse->obtain_log_file_list(); #open candidate log file to obtain realtime log @@ -611,7 +609,7 @@ Start capturing every message during OS provision process.... foreach my $hdl (@hdls) { my $line = ""; chomp($line = <$hdl>); - my $log_content_ref = $log_parse->obtain_log_content($fd_filetype_map{$hdl}, $line, $monitor); + my $log_content_ref = $log_parse->obtain_log_content($fd_filetype_map{$hdl}, $line); dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state); } } @@ -986,6 +984,7 @@ sub handle_compute_msg { my $return_code = $2; if ($return_code != 0) { my $error_str = "postscript $script_name return with $return_code"; + # when monitor, will show 2 same messages, so filter to show only one unless (grep {$_ eq $error_str} @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) { push @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }, $error_str; } @@ -997,6 +996,7 @@ sub handle_compute_msg { my $return_code = $2; if ($return_code != 0) { my $error_str = "postbootscript $script_name return with $return_code"; + # when monitor, will show 2 same messages, so filter to show only one unless (grep {$_ eq $error_str} @{ $node_state_ref->{$node}{errors}{$::STATE_POSTBOOTSCRIPT} }) { push @{ $node_state_ref->{$node}{errors}{$::STATE_POSTBOOTSCRIPT} }, $error_str; } diff --git a/xCAT-probe/xcatprobe b/xCAT-probe/xcatprobe index dae96b42a..ef7d0bef1 100755 --- a/xCAT-probe/xcatprobe +++ b/xCAT-probe/xcatprobe @@ -141,7 +141,10 @@ sub format_cmd_output { if ($flag) { my $leftspace = $maxlen - length($finalmsg[$i]); - my $spacenum = (($leftspace >= $flaglen) ? ($leftspace - $flaglen) : ($screenwidth - length($finalmsg[$i]) + $maxlen - $flaglen)); + my $spacenum = 0; + if($flag !~ /debug/i) { + $spacenum = (($leftspace >= $flaglen) ? ($leftspace - $flaglen) : ($screenwidth - length($finalmsg[$i]) + $maxlen - $flaglen)); + } my $spacestr = " " x $spacenum; print "$finalmsg[$i]$spacestr"; From 5381dcc58146f3df937994e4126bdb5dea3ab5c0 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 16 Dec 2016 08:27:20 -0500 Subject: [PATCH 030/217] modify ubuntu migration case --- xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 1e473c166..c8fcfd50b 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -104,7 +104,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 --only-upgrade install *xcat*" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat*." check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index ad3bb7913..59747fd21 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -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 --only-upgrade install *xcat*" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat*." check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index c30790aec..78660bd3d 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -104,7 +104,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 --only-upgrade install *xcat*" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat*." check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index f4cbc3f2b..f964f4e72 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -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 --only-upgrade install *xcat*" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat*." check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 From 921213ea9e474b2be89d0149bf8e670bbe2cbfc3 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 16 Dec 2016 16:09:56 -0500 Subject: [PATCH 031/217] File /etc/sysconfig/ntpd doesn't exists in the SLES --- xCAT-server/lib/xcat/plugins/makentp.pm | 24 +++++++++++++++++++----- xCAT/postscripts/setupntp | 21 +++++++++++++++------ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/makentp.pm b/xCAT-server/lib/xcat/plugins/makentp.pm index 9f404ae1c..f60a73c55 100755 --- a/xCAT-server/lib/xcat/plugins/makentp.pm +++ b/xCAT-server/lib/xcat/plugins/makentp.pm @@ -309,11 +309,15 @@ sub process_request { } } + #for sles, /var/lib/ntp/drift is a dir if (xCAT::Utils->isAIX()) { print CFGFILE "driftfile /etc/ntp.drift\n"; print CFGFILE "tracefile /etc/ntp.trace\n"; print CFGFILE "disable auth\n"; print CFGFILE "broadcastclient\n"; + } elsif ($os =~ /sles/) { + print CFGFILE "driftfile /etc/ntp.drift\n"; + print CFGFILE "disable auth\n"; } else { print CFGFILE "driftfile /var/lib/ntp/drift\n"; print CFGFILE "disable auth\n"; @@ -384,14 +388,20 @@ sub process_request { #setup the RTC is UTC format, which will be used by os if ($os =~ /sles/) { - `sed -i 's/.*HWCLOCK.*/HWCLOCK="-u"/' /etc/sysconfig/clock`; + $grep_cmd = "grep -i HWCLOCK /etc/sysconfig/clock"; + $rc = xCAT::Utils->runcmd($grep_cmd, 0); + if ($::RUNCMD_RC == 0) { + `sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock`; + } else { + `echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock`; + } } elsif (-f "/etc/debian_version") { `sed -i "s/.*UTC.*/UTC=yes/" /etc/default/rcS`; } else { if (-f "/etc/sysconfig/clock") { $grep_cmd = "grep -i utc /etc/sysconfig/clock"; $rc = xCAT::Utils->runcmd($grep_cmd, 0); - if ($::RUNCMD_RC != 0) { + if ($::RUNCMD_RC == 0) { `sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock`; } else { `echo "UTC=yes" >> /etc/sysconfig/clock`; @@ -406,11 +416,15 @@ sub process_request { if (-f "/etc/sysconfig/ntpd") { $grep_cmd = "grep -i SYNC_HWCLOCK /etc/sysconfig/ntpd"; $rc = xCAT::Utils->runcmd($grep_cmd, 0); - if ($::RUNCMD_RC != 0) { - `sed -i "s/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=yes/" /etc/sysconfig/ntpd`; + if ($::RUNCMD_RC == 0) { + `sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=\"yes\"/' /etc/sysconfig/ntpd`; } else { - `echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd`; + `echo SYNC_HWCLOCK=\"yes\" >> /etc/sysconfig/ntpd`; } + } elsif (-f "/etc/sysconfig/ntp") { + `sed -i "s/.*SYNC_HWCLOCK.*/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=yes/" /etc/sysconfig/ntp`; + `sed -i "s/^NTPD_FORCE_SYNC_ON.*/NTPD_FORCE_SYNC_ON_STARTUP=yes/" /etc/sysconfig/ntp`; + `sed -i "s/.*RUN_CHROOTED.*/NTPD_RUN_CHROOTED=yes/" /etc/sysconfig/ntp`; } else { my $cron_file = "/etc/cron.daily/xcatsethwclock"; if (!-f "$cron_file") { diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index b45372705..8e6c71e9c 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -99,9 +99,13 @@ OS_TYPE=`uname` if [ $OS_TYPE = Linux ]; then mkdir -p /var/lib/ntp chown ntp /var/lib/ntp - echo "driftfile /var/lib/ntp/drift -disable auth -restrict 127.0.0.1" >>$conf_file + if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then + echo "driftfile /etc/ntp.drift" >>$conf_file + else + echo "driftfile /var/lib/ntp/drift" >>$conf_file + fi + echo "disable auth" >>$conf_file + echo "restrict 127.0.0.1" >>$conf_file #ntpdate/sntp conflict with ntpd, stop the service first checkservicestatus ntpserver @@ -140,7 +144,12 @@ restrict 127.0.0.1" >>$conf_file #setup the RTC is UTC format, which will be used by os if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then - sed -i 's/.*HWCLOCK.*/HWCLOCK="-u"/' /etc/sysconfig/clock + grep -i "HWCLOCK" /etc/sysconfig/clock + if [ $? -eq 0 ];then + sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock + else + echo "HWCLOCK=\"-u\"" >> /etc/sysconfig/clock + fi elif [ -f "/etc/debian_version" ];then sed -i 's/.*UTC.*/UTC=yes/' /etc/default/rcS else @@ -160,9 +169,9 @@ restrict 127.0.0.1" >>$conf_file if [ -f "/etc/sysconfig/ntpd" ];then grep -i "SYNC_HWCLOCK" /etc/sysconfig/ntpd if [ $? -eq 0 ];then - sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=yes/' /etc/sysconfig/ntpd + sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=\"yes\"/' /etc/sysconfig/ntpd else - echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd + echo "SYNC_HWCLOCK=\"yes\"" >> /etc/sysconfig/ntpd fi elif [ -f /etc/sysconfig/ntp ];then grep -i "NTPD_FORCE_SYNC_ON_STARTUP" /etc/sysconfig/ntp From f08b804e7490f6d238f8fd744c25df99fc4f0a9c Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 16 Dec 2016 16:44:21 -0500 Subject: [PATCH 032/217] modifed --- xCAT-server/lib/xcat/plugins/makentp.pm | 15 ++++++++------- xCAT/postscripts/setupntp | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/makentp.pm b/xCAT-server/lib/xcat/plugins/makentp.pm index f60a73c55..91afe08f8 100755 --- a/xCAT-server/lib/xcat/plugins/makentp.pm +++ b/xCAT-server/lib/xcat/plugins/makentp.pm @@ -309,6 +309,8 @@ sub process_request { } } + my $os = xCAT::Utils->osver("all"); + #for sles, /var/lib/ntp/drift is a dir if (xCAT::Utils->isAIX()) { print CFGFILE "driftfile /etc/ntp.drift\n"; @@ -329,7 +331,6 @@ sub process_request { close CFGFILE; - my $os = xCAT::Utils->osver("all"); my $ntp_service = "ntpserver"; #stop ntpd @@ -396,15 +397,15 @@ sub process_request { `echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock`; } } elsif (-f "/etc/debian_version") { - `sed -i "s/.*UTC.*/UTC=yes/" /etc/default/rcS`; + `sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/default/rcS`; } else { if (-f "/etc/sysconfig/clock") { $grep_cmd = "grep -i utc /etc/sysconfig/clock"; $rc = xCAT::Utils->runcmd($grep_cmd, 0); if ($::RUNCMD_RC == 0) { - `sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock`; + `sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/sysconfig/clock`; } else { - `echo "UTC=yes" >> /etc/sysconfig/clock`; + `echo UTC=\"yes\" >> /etc/sysconfig/clock`; } } else { `type -P timedatectl >/dev/null 2>&1`; @@ -422,9 +423,9 @@ sub process_request { `echo SYNC_HWCLOCK=\"yes\" >> /etc/sysconfig/ntpd`; } } elsif (-f "/etc/sysconfig/ntp") { - `sed -i "s/.*SYNC_HWCLOCK.*/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=yes/" /etc/sysconfig/ntp`; - `sed -i "s/^NTPD_FORCE_SYNC_ON.*/NTPD_FORCE_SYNC_ON_STARTUP=yes/" /etc/sysconfig/ntp`; - `sed -i "s/.*RUN_CHROOTED.*/NTPD_RUN_CHROOTED=yes/" /etc/sysconfig/ntp`; + `sed -i 's/.*SYNC_HWCLOCK.*/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp`; + `sed -i 's/^NTPD_FORCE_SYNC_ON.*/NTPD_FORCE_SYNC_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp`; + `sed -i 's/.*RUN_CHROOTED.*/NTPD_RUN_CHROOTED=\"yes\"/' /etc/sysconfig/ntp`; } else { my $cron_file = "/etc/cron.daily/xcatsethwclock"; if (!-f "$cron_file") { diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index 8e6c71e9c..f2a95994e 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -148,17 +148,17 @@ if [ $OS_TYPE = Linux ]; then if [ $? -eq 0 ];then sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock else - echo "HWCLOCK=\"-u\"" >> /etc/sysconfig/clock + echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock fi elif [ -f "/etc/debian_version" ];then - sed -i 's/.*UTC.*/UTC=yes/' /etc/default/rcS + sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/default/rcS else if [ -f "/etc/sysconfig/clock" ];then grep -i "utc" /etc/sysconfig/clock if [ $? -eq 0 ];then - sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock + sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/sysconfig/clock else - echo "UTC=yes" >> /etc/sysconfig/clock + echo UTC=\"yes\" >> /etc/sysconfig/clock fi elif type -P timedatectl >/dev/null 2>&1 ;then timedatectl set-local-rtc 0 @@ -176,11 +176,11 @@ if [ $OS_TYPE = Linux ]; then elif [ -f /etc/sysconfig/ntp ];then grep -i "NTPD_FORCE_SYNC_ON_STARTUP" /etc/sysconfig/ntp if [ $? -eq 0 ];then - sed -i 's/NTPD_FORCE_SYNC_ON_STARTUP="no"/NTPD_FORCE_SYNC_ON_STARTUP="yes"/' /etc/sysconfig/ntp + sed -i 's/NTPD_FORCE_SYNC_ON_STARTUP=\"no\"/NTPD_FORCE_SYNC_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp fi grep -i "NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP" /etc/sysconfig/ntp if [ $? -eq 0 ];then - sed -i 's/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP="no"/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP="yes"/' /etc/sysconfig/ntp + sed -i 's/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"no\"/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp fi else cron_file="/etc/cron.daily/xcatsethwclock" From 3e09b29f506fa74519b21d8d756b628dd3d5ed94 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Mon, 19 Dec 2016 01:53:32 -0500 Subject: [PATCH 033/217] modify ubuntu migration case --- xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index c8fcfd50b..02d5d9d36 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -104,7 +104,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 --only-upgrade install .*xcat*." +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 59747fd21..3c4e3aadc 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -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 --only-upgrade install .*xcat*." +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 78660bd3d..810adb134 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -104,7 +104,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 --only-upgrade install .*xcat*." +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index f964f4e72..866073f27 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -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 --only-upgrade install .*xcat*." +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 From ad9f2e4869043eefa3180b839c0e3c770de2a397 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Mon, 19 Dec 2016 02:28:42 -0500 Subject: [PATCH 034/217] modify ubuntu update xcat doc --- docs/source/guides/install-guides/apt/update_xcat.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/install-guides/apt/update_xcat.rst b/docs/source/guides/install-guides/apt/update_xcat.rst index bc1aa8cdf..650a03f8e 100644 --- a/docs/source/guides/install-guides/apt/update_xcat.rst +++ b/docs/source/guides/install-guides/apt/update_xcat.rst @@ -3,6 +3,6 @@ Updating xCAT If at a later date you want to update xCAT, first, update the software repositories and then run: :: apt-get update - apt-get -y --only-upgrade install *xcat* + apt-get -y --only-upgrade install .*xcat.* From 4a0c49769798ba0a3b0cab42c5e300e321c476a6 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 16 Dec 2016 03:28:21 -0500 Subject: [PATCH 035/217] enhance http service checking, offer more error message --- xCAT-probe/lib/perl/probe_utils.pm | 51 ++++++++++++++++++++++++++---- xCAT-probe/subcmds/xcatmn | 5 +-- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index db96fdc24..c6f1d3722 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -257,6 +257,7 @@ sub is_firewall_open { Test if http service is ready to use in current operating system Arguments: ip: http server's ip + errormsg_ref: (output attribute) if there is something wrong for HTTP service, this attribute save the possible reason. Returns: 1 : yes 0 : no @@ -266,20 +267,56 @@ sub is_firewall_open { sub is_http_ready { my $mnip = shift; $mnip = shift if (($mnip) && ($mnip =~ /probe_utils/)); + my $errormsg_ref = shift; + + my $http = "http://$mnip/install/postscripts/syslog"; + my %httperror = ( + "400" => "The request $http could not be understood by the server due to malformed syntax", + "401" => "The request requires user authentication.", + "403" => "The server understood the request, but is refusing to fulfill it.", + "404" => "The server has not found anything matching the test Request-URI $http.", + "405" => "The method specified in the Request-Line $http is not allowe.", + "406" => "The method specified in the Request-Line $http is not acceptable.", + "408" => "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.", + "409" => "The request could not be completed due to a conflict with the current state of the resource.", + "410" => "The requested resource $http is no longer available at the server and no forwarding address is known.", + "411" => "The server refuses to accept the request without a defined Content- Length.", + "412" => "The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.", + "413" => "The server is refusing to process a request because the request entity is larger than the server is willing or able to process.", + "414" => "The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.", + "415" => "The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.", + "416" => "Requested Range Not Satisfiable", + "417" => "The expectation given in an Expect request-header field could not be met by this server", + "500" => "The server encountered an unexpected condition which prevented it from fulfilling the request.", + "501" => "The server does not recognize the request method and is not capable of supporting it for any resource.", + "502" => "The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the reques.", + "503" => "The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.", + "504" => "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI or some other auxiliary server it needed to access in attempting to complete the request.", + "505" => "The server does not support, or refuses to support, the HTTP protocol version that was used in the request message."); - my $http = "http://$mnip/install/postscripts/syslog"; rename("./syslog", "./syslog.org") if (-e "./syslog"); - - my $outputtmp = `wget $http 2>&1`; + my @outputtmp = `wget $http 2>&1`; my $rst = $?; - if (($outputtmp =~ /200 OK/) && (!$rst) && (-e "./syslog")) { + $rst = $rst >> 8; + + if ((!$rst) && (-e "./syslog")) { unlink("./syslog"); rename("./syslog.org", "./syslog") if (-e "./syslog.org"); return 1; - } else { - rename("./syslog.org", "./syslog") if (-e "./syslog.org"); - return 0; + } elsif ($rst == 4) { + $$errormsg_ref = "Network failure, the server refuse connection. Please check if httpd service is running first."; + } elsif ($rst == 5) { + $$errormsg_ref = "SSL verification failure, the server refuse connection"; + } elsif ($rst == 6) { + $$errormsg_ref = "Username/password authentication failure, the server refuse connection"; + } elsif ($rst == 8) { + my $returncode = $outputtmp[2]; + chomp($returncode); + $returncode =~ s/.+(\d\d\d).+/$1/g; + $$errormsg_ref = $httperror{$returncode}; } + rename("./syslog.org", "./syslog") if (-e "./syslog.org"); + return 0; } #------------------------------------------ diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 199262d19..540d2f543 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -566,8 +566,9 @@ sub check_http_service { push @$error_ref, "HTTP check need 'wget' tool, please install 'wget' tool and try again"; $rst = 1; } else { - if (!probe_utils->is_http_ready("$serverip")) { - push @$error_ref, "HTTP service isn't ready on $serverip"; + my $errormsg; + if (!probe_utils->is_http_ready("$serverip", \$errormsg)) { + push @$error_ref, "$errormsg"; $rst = 1; } } From 41f8c31ba12d3613abdd177c856e5d9503835f66 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 19 Dec 2016 01:23:42 -0500 Subject: [PATCH 036/217] add xcatprobe discovery time info when monitor --- xCAT-probe/subcmds/discovery | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/xCAT-probe/subcmds/discovery b/xCAT-probe/subcmds/discovery index 258ab9829..bd57ead93 100755 --- a/xCAT-probe/subcmds/discovery +++ b/xCAT-probe/subcmds/discovery @@ -1188,11 +1188,11 @@ sub handle_dhcp_msg { my $nic = $2; if ($3 =~ /no free leases/) { - probe_utils->send_msg("stdout", "d", "[$mac] Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor); return 0; } my $record = "Received DHCPDISCOVER from $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); } elsif ($log_ref->{msg} =~ /DHCPOFFER\s+on\s+(.+)\s+to\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/i) { my $ip = $1; @@ -1200,7 +1200,7 @@ sub handle_dhcp_msg { my $nic = $3; my $record = "Sent DHCPOFFER on $ip back to $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); } elsif ($log_ref->{msg} =~ /DHCPREQUEST\s+for\s+(.+)\s+[\(\)0-9\.]*\s*from\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) { my $ip = $1; @@ -1208,7 +1208,7 @@ sub handle_dhcp_msg { my $nic = $3; my $record = "Received DHCPREQUEST from $mac for $ip via $nic"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); } elsif ($log_ref->{msg} =~ /DHCPACK\s+on\s+(.+)\s+to\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) { my $ip = $1; @@ -1216,7 +1216,7 @@ sub handle_dhcp_msg { my $nic = $3; my $record = "Sent DHCPACK on $ip back to $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); $ipmacmap{$ip} = $mac; $node_state_ref->{$mac}{type} = "mac"; @@ -1225,11 +1225,11 @@ sub handle_dhcp_msg { my $mac = $1; my $nic = $2; if ($3 =~ /no dynamic leases/) { - probe_utils->send_msg("stdout", "d", "Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor); return 0; } my $record = "Received BOOTREQUEST from $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); } elsif ($log_ref->{msg} =~ /BOOTREPLY\s+for\s+(.+)\s+to\s+.+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) { my $ip = $1; @@ -1237,7 +1237,7 @@ sub handle_dhcp_msg { my $nic = $3; my $record = "Sent BOOTREPLY on $ip back to $mac via $nic"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); $ipmacmap{$ip} = $mac; $node_state_ref->{$mac}{type} = "mac"; @@ -1269,7 +1269,7 @@ sub handle_tftp_msg { if (exists($node_state_ref->{$mac})) { my $record = "Via TFTP $ip download $file"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); if ($file =~ /\/pxelinux.cfg\//i or $file =~ /\/xcat\/xnba\/nets\//i) { @@ -1309,7 +1309,7 @@ sub handle_http_msg { if ($file =~ /\/install\//i) { return; } - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); if ($file =~ /\/pxelinux.cfg\//i or $file =~ /\/xcat\/xnba\/nets\//i) { @@ -1349,13 +1349,13 @@ sub handle_cluster_msg { $node_state_ref->{$node}{id} = $mac; $node_state_ref->{$node}{discoverytype} = $type; my $record = "Start to update node information, discovery type is $type"; - probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor); set_node_state($node_state_ref, $mac, $::STATE_DISCOVER_UPDATE); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); } elsif ($log_ref->{msg} =~ /xcat.discovery.$discovery_type: \((.+)\) Warning: Could not find any nodes using (.+) discovery/i) { my $mac = $1; my $type = $2; - probe_utils->send_msg("stdout", "w", "[$mac] Could not find any nodes using $type discovery") if ($monitor); + probe_utils->send_msg("stdout", "w", "[$mac] $log_ref->{time_record} Could not find any nodes using $type discovery") if ($monitor); set_node_state($node_state_ref, $mac, $::STATE_DISCOVER_FAILED); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); } @@ -1381,7 +1381,7 @@ sub handle_compute_msg { my $mac = $ipmacmap{$ip}; if (exists $node_state_ref->{$mac}) { - probe_utils->send_msg("stdout", "d", "[$mac] ($ip) $log_ref->{msg}") if ($monitor); + probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} ($ip) $log_ref->{msg}") if ($monitor); push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug); if ($log_ref->{label} == $::LOGLABEL_DOXCAT) { @@ -1403,7 +1403,7 @@ sub handle_compute_msg { } if ($node ne "") { $node_state_ref->{$node}{done} = 1; - probe_utils->send_msg("stdout", "o", "[$mac] node $node discovery completed") if ($monitor); + probe_utils->send_msg("stdout", "o", "[$mac] $log_ref->{time_record} node $node discovery completed") if ($monitor); set_node_state($node_state_ref, $mac, $::STATE_DISCOVER_COMPLETED); } } From 375e43fcc58aa239ce33b4b5fa08407cbcc5866d Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 19 Dec 2016 02:56:26 -0500 Subject: [PATCH 037/217] update installation version --- xCAT-test/autotest/testcase/go-xcat/case1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/go-xcat/case1 b/xCAT-test/autotest/testcase/go-xcat/case1 index 2d2791199..157f249fe 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case1 +++ b/xCAT-test/autotest/testcase/go-xcat/case1 @@ -47,10 +47,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION1_VERSION -y install" +cmd:xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION2_VERSION -y install" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" -check:output=~Version $$MIGRATION1_VERSION +check:output=~Version $$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running From 0ec39c2a57987aac871b22dc8f8c38d4329fc70d Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 20 Dec 2016 12:11:27 +0800 Subject: [PATCH 038/217] Fix the code of waiting for ntpd to synchronize in genessis --- xCAT-genesis-scripts/bin/doxcat | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 6a637fb91..0f39e1e89 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -266,18 +266,18 @@ ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6| logger -s -t $log_label -p local4.info "Starting ntpd..." ntpd -g -x -if [ -e "/dev/rtc" ]; then - logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." - ( sleep 8 ; hwclock --systohc ) /dev/null 2>&1 & - disown +logger -s -t $log_label -p local4.info "Waiting for ntpd to synchronize..." +ntp-wait -n 1999 -s 1 -v +if [ $? -ne 0 ] +then + logger -s -t $log_label -p local4.info "... ntpd did not synchronize." fi -# rv 0 state does not work with the new ntp versions -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values..." -while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do - sleep 1 -done -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values... Done" +if [ -e "/dev/rtc" ]; then + logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." + ( hwclock --systohc ) /dev/null 2>&1 & + disown +fi logger -s -t $log_label -p local4.info "Restarting syslog..." read -r RSYSLOG_PID /dev/null From 0044749f338965dbbc100519754cdcafdd5b0bbd Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 20 Dec 2016 12:54:15 +0800 Subject: [PATCH 039/217] Add command ntp-wait into package xCAT-genesis-base --- xCAT-genesis-builder/install | 2 +- xCAT-genesis-builder/install.ubuntu | 2 +- xCAT-genesis-builder/xCAT-genesis-base.spec | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 67e6950fa..2f1d0507f 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -9,7 +9,7 @@ dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 -dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services +dracut_install poweroff ntpq ntpd ntp-wait hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si diff --git a/xCAT-genesis-builder/install.ubuntu b/xCAT-genesis-builder/install.ubuntu index 9ae3f5af2..f073efff0 100755 --- a/xCAT-genesis-builder/install.ubuntu +++ b/xCAT-genesis-builder/install.ubuntu @@ -10,7 +10,7 @@ dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad dracut_install lldptool -dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterms /etc/nsswitch.conf /etc/services +dracut_install poweroff ntpq ntp-wait ntpd hwclock date /usr/share/terminfo/x/xterms /etc/nsswitch.conf /etc/services dracut_install /usr/sbin/rsyslogd /etc/protocols umount /usr/bin/dpkg /usr/bin/rpm /usr/lib/rpm/rpmrc if [ -n $version12 ];then dracut_install /lib/x86_64-linux-gnu/libnss_dns-2.15.so /lib/x86_64-linux-gnu/libnss_dns.so.2 diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 989980591..9d8c7907f 100755 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -31,6 +31,7 @@ URL: http://xcat.org Source1: xCAT-genesis-base-%{tarch}.tar.bz2 Buildroot: %{_localstatedir}/tmp/xCAT-genesis +BuildRequires: /usr/sbin/ntp-wait Packager: IBM Corp. %Description From e3cfd47466166056b65afff2cb52316cd8262f06 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 21 Dec 2016 02:09:02 -0500 Subject: [PATCH 040/217] add ntp check and modify http part depending on gongjie's comment --- xCAT-probe/lib/perl/probe_utils.pm | 84 +++++++++++++++++++++++++++--- xCAT-probe/subcmds/xcatmn | 26 +++++++++ 2 files changed, 103 insertions(+), 7 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index c6f1d3722..e97264796 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -277,6 +277,7 @@ sub is_http_ready { "404" => "The server has not found anything matching the test Request-URI $http.", "405" => "The method specified in the Request-Line $http is not allowe.", "406" => "The method specified in the Request-Line $http is not acceptable.", + "407" => "The wget client must first authenticate itself with the proxy.", "408" => "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.", "409" => "The request could not be completed due to a conflict with the current state of the resource.", "410" => "The requested resource $http is no longer available at the server and no forwarding address is known.", @@ -294,14 +295,16 @@ sub is_http_ready { "504" => "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI or some other auxiliary server it needed to access in attempting to complete the request.", "505" => "The server does not support, or refuses to support, the HTTP protocol version that was used in the request message."); - rename("./syslog", "./syslog.org") if (-e "./syslog"); - my @outputtmp = `wget $http 2>&1`; + my $suffix = time(); + my $tmpdir = "/tmp/xcatprobe$suffix/"; + mkpath("$tmpdir"); + my @outputtmp = `cd $tmpdir && wget $http 2>&1`; my $rst = $?; $rst = $rst >> 8; - if ((!$rst) && (-e "./syslog")) { - unlink("./syslog"); - rename("./syslog.org", "./syslog") if (-e "./syslog.org"); + if ((!$rst) && (-e "$tmpdir/syslog")) { + unlink("$tmpdir/syslog"); + rmdir ("$tmpdir"); return 1; } elsif ($rst == 4) { $$errormsg_ref = "Network failure, the server refuse connection. Please check if httpd service is running first."; @@ -313,9 +316,14 @@ sub is_http_ready { my $returncode = $outputtmp[2]; chomp($returncode); $returncode =~ s/.+(\d\d\d).+/$1/g; - $$errormsg_ref = $httperror{$returncode}; + if(exists($httperror{$returncode})){ + $$errormsg_ref = $httperror{$returncode}; + }else{ + #should not hit this block normally + $$errormsg_ref = "Unexpected return code of wget <$returncode>."; + } } - rename("./syslog.org", "./syslog") if (-e "./syslog.org"); + rmdir ("$tmpdir"); return 0; } @@ -473,4 +481,66 @@ sub parse_node_range { chomp @nodeslist; return @nodeslist; } + +#------------------------------------------ + +=head3 + Description: + Test if ntp service is ready to use in current operating system + Arguments: + errormsg_ref: (output attribute) if there is something wrong for ntp service, this attribute save the possible reason. + Returns: + 1 : yes + 0 : no +=cut + +#------------------------------------------ +sub is_ntp_ready{ + my $errormsg_ref = shift; + $errormsg_ref= shift if (($errormsg_ref) && ($errormsg_ref =~ /probe_utils/)); + + my $cmd = 'ntpq -c "rv 0"'; + $| = 1; + + #wait 5 seconds for ntpd synchronize at most + for (my $i = 0; $i < 5; ++$i) { + if(!open(NTP, $cmd." 2>&1 |")){ + $$errormsg_ref = "Can't start ntpq: $!"; + return 0; + }else{ + while() { + chomp; + if (/^associd=0 status=(\S{4}) (\S+),/) { + my $leap=$2; + + last if ($leap =~ /(sync|leap)_alarm/); + + if ($leap =~ /leap_(none|((add|del)_sec))/){ + close(NTP); + return 1; + } + + #should not hit below 3 lines normally + $$errormsg_ref = "Unexpected ntpq output ('leap' status <$leap>), please contact xCAT team"; + close(NTP); + return 0; + }elsif(/Connection refused/) { + $$errormsg_ref = "ntpd service is not running! Please setup ntp in current node"; + close(NTP); + return 0; + }else{ + #should not hit this block normally + $$errormsg_ref = "Unexpected ntpq output <$_>, please contact xCAT team"; + close(NTP); + return 0; + } + } + } + close(NTP); + sleep 1; + } + $$errormsg_ref = "ntpd did not synchronize."; + return 0; +} + 1; diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 540d2f543..9a1c212e5 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -125,6 +125,12 @@ sub do_main_job { print_check_result($checkpoint, "f", $rst, \@error); $rc |= $rst; + #check NTP service + $checkpoint = "NTP service works well"; + $rst = check_ntp_service(\@error); + print_check_result($checkpoint, "f", $rst, \@error); + $rc |= $rst; + #Below are the 'warning` level check points #check if firewall is close @@ -612,6 +618,26 @@ sub check_tftp_service { return $rst; } +sub check_ntp_service{ + my $error_ref = shift; + my $rst = 0; + @$error_ref = (); + + `which ntpq > /dev/null 2>&1`; + if($?){ + push @$error_ref, "ntp service check need 'ntpq' tool, please install 'ntpq' toll and try again"; + $rst = 1; + }else{ + my $error; + if(!probe_utils->is_ntp_ready(\$error)){ + push @$error_ref, "$error"; + $rst = 1; + } + } + + return $rst; +} + sub check_dns_service { my $sitetable_ref = shift; my $serverip = shift; From 3dfc10f1c5aab5371efaba4b076bbe4a9659cbd4 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 21 Dec 2016 02:57:21 -0500 Subject: [PATCH 041/217] fix bug #2232, support ntp in statelite --- xCAT-test/autotest/testcase/installation/litefile_sles.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/litefile_sles.csv b/xCAT-test/autotest/testcase/installation/litefile_sles.csv index 09c02b082..e4a30153b 100644 --- a/xCAT-test/autotest/testcase/installation/litefile_sles.csv +++ b/xCAT-test/autotest/testcase/installation/litefile_sles.csv @@ -14,3 +14,5 @@ "ALL","/opt/xcat/","tmpfs",, "ALL","/xcatpost/","tmpfs",, "ALL","/root/.ssh/","tmpfs",, +"ALL","/etc/init.d/rc3.d/","tmpfs",, +"ALL","/etc/init.d/rc5.d/","tmpfs",, From 0d3beb67c97eca67effb28a620183a1b8d08c527 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 21 Dec 2016 03:07:46 -0500 Subject: [PATCH 042/217] modify depending on gongjie'comment --- xCAT-probe/lib/perl/probe_utils.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index e97264796..b4df1e5f4 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -295,10 +295,12 @@ sub is_http_ready { "504" => "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI or some other auxiliary server it needed to access in attempting to complete the request.", "505" => "The server does not support, or refuses to support, the HTTP protocol version that was used in the request message."); - my $suffix = time(); - my $tmpdir = "/tmp/xcatprobe$suffix/"; - mkpath("$tmpdir"); - my @outputtmp = `cd $tmpdir && wget $http 2>&1`; + my $tmpdir = "/tmp/xcatprobe$$/"; + if(! mkpath("$tmpdir")){ + $$errormsg_ref = "Prepare test environment error: $!"; + return 0; + } + my @outputtmp = `wget -O $tmpdir/syslog $http 2>&1`; my $rst = $?; $rst = $rst >> 8; @@ -320,10 +322,13 @@ sub is_http_ready { $$errormsg_ref = $httperror{$returncode}; }else{ #should not hit this block normally - $$errormsg_ref = "Unexpected return code of wget <$returncode>."; + $$errormsg_ref = "Unknown return code of wget <$returncode>."; } } - rmdir ("$tmpdir"); + unlink("$tmpdir/syslog"); + if(! rmdir ("$tmpdir")){ + $$errormsg_ref .= " Clean test environment error(rmdir $tmpdir): $!"; + } return 0; } From 4a1247fbe95e8bb2ceaa111efaf58eb299703d81 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 21 Dec 2016 03:36:22 -0500 Subject: [PATCH 043/217] fix [FVT]set xcatdebugmode=1 does not work after xcatdebugmode is set to 2 #2337; use symbol links instead of hard link while creating grub.cfg.xxxx --- xCAT-server/lib/xcat/plugins/grub2.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 34ddd9d8a..1d4abda32 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -185,8 +185,8 @@ sub setstate { my $cref = $chainhash{$node}->[0]; #$chaintab->getNodeAttribs($node,['currstate']); - # remove the old boot configuration file and create a new one, but only if not offline directive - unlink($tftpdir . "/boot/grub2/" . $node); + # remove the old boot configuration files and create a new one, but only if not offline directive + system("find . -inum \$(stat --printf \%i $tftpdir/boot/grub2/$node 2>/dev/null) -exec rm -f {} \\; 2>/dev/null"); if ($cref and $cref->{currstate} ne "offline") { open($pcfg, '>', $tftpdir . "/boot/grub2/" . $node); print $pcfg "#" . $cref->{currstate} . "\n"; @@ -334,7 +334,6 @@ sub setstate { } - if (! $nodemac and $macstring) { $nodemac = xCAT::Utils->parseMacTabEntry($macstring, $node); } From a1d590f85f8d61707deaf2bfcf4ffa025f0e9c67 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 21 Dec 2016 03:32:20 -0500 Subject: [PATCH 044/217] fix issue 2296, get correct mtms for B&S --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 54d7ce8b7..18e3a09e2 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -910,19 +910,16 @@ sub bmcdiscovery_ipmi { if (($::RUNCMD_RC eq 0) && @fru_output_array) { my $fru_output = join(" ", @fru_output_array); - if ($fru_cmd_num == 0) { - if (($fru_output =~ /Product Part Number :\s*(\S*).*Product Serial :\s*(\S*)/)) { - $mtm = $1; - $serial = $2; - last; - } + if (($fru_output =~ /Chassis Part Number\s*:\s*(\S*).*Chassis Serial\s*:\s*(\S*)/)) { + $mtm = $1; + $serial = $2; + last; } - else { - if (($fru_output =~ /Chassis Part Number\s*:\s*(\S*).*Chassis Serial\s*:\s*(\S*)/)) { - $mtm = $1; - $serial = $2; - last; - } + + if (($fru_output =~ /Product Part Number :\s*(\S*).*Product Serial :\s*(\S*)/)) { + $mtm = $1; + $serial = $2; + last; } } } From 804fd4c4e581b469864d6b01c447c2687dd30d9d Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 21 Dec 2016 02:58:53 -0500 Subject: [PATCH 045/217] fix issue 2336, get correct mac address --- xCAT-probe/subcmds/osdeploy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-probe/subcmds/osdeploy b/xCAT-probe/subcmds/osdeploy index b41ca4e1b..16a33f75c 100755 --- a/xCAT-probe/subcmds/osdeploy +++ b/xCAT-probe/subcmds/osdeploy @@ -293,6 +293,17 @@ sub check_noderange { $mac =~ s/\!\*NOIP\*//g; $macmap{$mac}{"ip"} = "NOIP"; $macmap{$mac}{"node"} = $node; + } elsif ($mac =~ /(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})\!(.+)/) { + $mac = $1; + my $tmp_node = $2; + $macmap{$mac}{"node"} = $node; + my $tmp_ip = xCAT::NetworkUtils->getipaddr($tmp_node); + if ($tmp_ip) { + $macmap{$mac}{"ip"} = $tmp_ip; + $ipnodemap{ $nodecheckrst{$node}{"ip"} } = $node; + } else { + $macmap{$mac}{"ip"} = "NOIP"; + } } else { $macmap{$mac}{"node"} = $node; $macmap{$mac}{"ip"} = $nodecheckrst{$node}{"ip"}; From 8be7f480801007cc342831f66114031e91c9abba Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 22 Dec 2016 07:30:26 -0500 Subject: [PATCH 046/217] set up vm environment --- .../Diskless_installation_flat_p8_le | 6 ------ .../testcase/installation/SN_setup_case | 6 ------ .../reg_linux_SN_installation_hierarchy | 4 ---- .../reg_linux_diskfull_installation_flat | 3 --- .../autotest/testcase/installation/setup_vm | 20 +++++++++++++++++++ .../ubuntu_full_installation_vm_docker | 5 ----- 6 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 xCAT-test/autotest/testcase/installation/setup_vm diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index 0c4459990..51d18d4ad 100644 --- a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -3,12 +3,6 @@ os:Linux cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -#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 cmd:makedhcp -n diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 9b6ea5490..0593d88ea 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -7,12 +7,6 @@ check:rc==0 cmd:chtab key=nameservers site.value="" check:rc==0 -#cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p && mkvm $$SN; else rmvm $$SN -f -p && mkvm $$SN -s 20G; fi;fi -#Add for debug rmvm issue -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p ;mkvm $$SN; else rmvm $$SN -f -p;mkvm $$SN;rmvm $$SN -f -p;mkvm $$SN -s 20G; fi;fi -check:rc==0 cmd:makedns -n check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index f9d36a595..8cb7b89d1 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -3,10 +3,6 @@ os:Linux cmd:chtab key=nameservers site.value="" check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata; fi -check:rc==0 -#cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rmvm $$SN -f -p && mkvm $$SN -s 40G; fi -cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p; mkvm $$SN; else rmvm $$SN -f -p;mkvm $$SN;rmvm $$SN -f -p;mkvm $$SN -s 40G; fi;fi cmd:makedns -n check:rc==0 cmd:makeconservercf diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index c99eb4aa0..130503f00 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -5,9 +5,6 @@ cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 -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 cmd:makeconservercf diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm new file mode 100644 index 000000000..743f801e9 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -0,0 +1,20 @@ +start:setup_vm +description:set up vm environment +cmd:var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$CN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$CN ; rmvm $$CN -f -p ; mkvm $$CN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" -o "$var" = "nfs" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi +check:rc==0 +cmd:rpower $$CN on +check:rc==0 +cmd:rpower $$CN stat +check:output=~on +cmd:var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then rmvm $$SN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$SN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$SN ; rmvm $$SN -f -p ; mkvm $$SN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" -o "$var" = "nfs" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi +check:rc==0 +cmd:rpower $$SN on +check:rc==0 +cmd:rpower $$SN stat +check:output=~on +#Add for debug rmvm issue +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then tabdump -w node==$$CN kvm_nodedata; fi +check:rc==0 +cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ]; then tabdump -w node==$$SN kvm_nodedata; fi +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker index e6d948e68..4ce2ba2f6 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -2,11 +2,6 @@ start:Full_installation_flat_docker os:Linux 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 -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 cmd:makeconservercf From 97f9d4da8fbbd22a100e62b54c5d7648f7263315 Mon Sep 17 00:00:00 2001 From: chenglch Date: Fri, 23 Dec 2016 13:45:20 +0800 Subject: [PATCH 047/217] Do not update bootparams table when running nodeset With the nytprof tool, the buttleneck is the time to update the bootparams table.To optimize the performance on large scale nodes, this patch tranfer the bootparams hash through variable reference. posible impact: getdestiny can not get the information about bootparams. partial-issue: #2024 --- xCAT-server/lib/xcat/plugins/anaconda.pm | 45 +++++------------ xCAT-server/lib/xcat/plugins/debian.pm | 28 +++-------- xCAT-server/lib/xcat/plugins/destiny.pm | 16 +++--- xCAT-server/lib/xcat/plugins/grub2.pm | 9 ++-- xCAT-server/lib/xcat/plugins/petitboot.pm | 9 ++-- xCAT-server/lib/xcat/plugins/pxe.pm | 7 +-- xCAT-server/lib/xcat/plugins/sles.pm | 60 +++++++---------------- xCAT-server/lib/xcat/plugins/vsmppxe.pm | 7 +-- xCAT-server/lib/xcat/plugins/xnba.pm | 10 ++-- 9 files changed, 69 insertions(+), 122 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 6decce701..513cedb15 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -172,6 +172,7 @@ sub mknetboot if ($req->{command}->[0] =~ 'mkstatelite') { $statelite = "true"; } + my $bootparams = ${$req->{bootparams}}; my $globaltftpdir = "/tftpboot"; my $nodes = @{ $req->{node} }; my @args = @{ $req->{arg} } if (exists($req->{arg})); @@ -232,7 +233,6 @@ sub mknetboot my %donetftp = (); my %oents = %{ $ostab->getNodesAttribs(\@nodes, [qw(os arch profile provmethod)]) }; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); @@ -249,8 +249,6 @@ sub mknetboot $stateHash = $statetab->getNodesAttribs(\@nodes, ['statemnt']); } - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); # Warning message for nodeset install/netboot/statelite foreach my $knode (keys %oents) @@ -950,15 +948,9 @@ sub mknetboot $kcmdline .= " MNTOPTS=$mntoptions"; } } - - $bptab->setNodeAttribs( - $node, - { - kernel => $kernstr, - initrd => $initrdstr, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernstr; + $bootparams->{$node}->[0]->{initrd} = $initrdstr; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } } @@ -971,6 +963,7 @@ sub mkinstall my @nodes = @{ $request->{node} }; my $noupdateinitrd = $request->{'noupdateinitrd'}; my $ignorekernelchk = $request->{'ignorekernelchk'}; + my $bootparams = ${$request->{bootparams}}; #my $sitetab = xCAT::Table->new('site'); my $linuximagetab; @@ -1023,7 +1016,6 @@ sub mkinstall my $ostab = xCAT::Table->new('nodetype'); my %donetftp; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); my %osents = %{ $ostab->getNodesAttribs(\@nodes, [ 'profile', 'os', 'arch', 'provmethod' ]) }; @@ -1033,8 +1025,6 @@ sub mkinstall [ 'serialport', 'serialspeed', 'serialflow' ]) }; my %macents = %{ $mactab->getNodesAttribs(\@nodes, ['mac']) }; - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); require xCAT::Template; # Warning message for nodeset install/netboot/statelite @@ -1668,14 +1658,9 @@ sub mkinstall xCAT::MsgUtils->trace($verbose_on_off, "d", "anaconda->mkinstall: kcmdline=$kcmdline kernal=$k initrd=$i"); - $bptab->setNodeAttribs( - $node, - { - kernel => $k, - initrd => $i, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $k; + $bootparams->{$node}->[0]->{initrd} = $i; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { @@ -1701,6 +1686,7 @@ sub mksysclone my $callback = shift; my $doreq = shift; my @nodes = @{ $request->{node} }; + my $bootparams = ${$request->{bootparams}}; my $linuximagetab; my $osimagetab; my %img_hash = (); @@ -1727,7 +1713,6 @@ sub mksysclone my $ostab = xCAT::Table->new('nodetype'); my %donetftp; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); @@ -2064,15 +2049,9 @@ sub mksysclone $k = "xcat/$kernpath"; $i = "xcat/$initrdpath"; - - $bptab->setNodeAttribs( - $node, - { - kernel => $k, - initrd => $i, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $k; + $bootparams->{$node}->[0]->{initrd} = $i; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 89c405cbf..823e80b36 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -445,6 +445,7 @@ sub mkinstall { my $callback = shift; my $doreq = shift; my @nodes = @{ $request->{node} }; + my $bootparams = ${$request->{bootparams}}; my $sitetab = xCAT::Table->new('site'); my $linuximagetab; my $osimagetab; @@ -490,7 +491,6 @@ sub mkinstall { my $ostab = xCAT::Table->new('nodetype'); my %donetftp; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); my %osents = %{ $ostab->getNodesAttribs(\@nodes, [ 'profile', 'os', 'arch', 'provmethod' ]) }; @@ -502,8 +502,6 @@ sub mkinstall { [ 'serialport', 'serialspeed', 'serialflow' ]) }; my %macents = %{ $mactab->getNodesAttribs(\@nodes, ['mac']) }; - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); require xCAT::Template; # Warning message for nodeset install/netboot/statelite @@ -923,10 +921,9 @@ sub mkinstall { } xCAT::MsgUtils->trace($verbose_on_off, "d", "debian->mkinstall: kcmdline=$kcmdline kernal=$rtftppath/vmlinuz initrd=$rtftppath/initrd.img"); - - $bptab->setNodeAttribs($node, { kernel => "$rtftppath/vmlinuz", - initrd => "$rtftppath/initrd.img", - kcmdline => $kcmdline }); + $bootparams->{$node}->[0]->{kernel} = "$rtftppath/vmlinuz"; + $bootparams->{$node}->[0]->{initrd} = "$rtftppath/initrd.img"; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { $callback->({ error => ["Install image not found in $installroot/$os/$arch"], @@ -945,6 +942,7 @@ sub mknetboot if ($req->{command}->[0] =~ 'mkstatelite') { $statelite = "true"; } + my $bootparams = ${$request->{bootparams}}; my $tftpdir = "/tftpboot"; my $nodes = @{ $req->{node} }; my @args = @{ $req->{arg} }; @@ -991,7 +989,6 @@ sub mknetboot my %donetftp = (); my %oents = %{ $ostab->getNodesAttribs(\@nodes, [qw(os arch profile provmethod)]) }; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); @@ -1008,9 +1005,6 @@ sub mknetboot $stateHash = $statetab->getNodesAttribs(\@nodes, ['statemnt']); } - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); - # Warning message for nodeset install/netboot/statelite foreach my $knode (keys %oents) { my $ent = $oents{$knode}->[0]; @@ -1589,15 +1583,9 @@ sub mknetboot $kcmdline .= " MNTOPTS=$mntoptions"; } } - - $bptab->setNodeAttribs( - $node, - { - kernel => "$kernstr", - initrd => "$initrdstr", - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernstr; + $bootparams->{$node}->[0]->{initrd} = $initrdstr; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } #my $rc = xCAT::TableUtils->create_postscripts_tar(); diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index d2eb6b26d..f43449209 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -26,7 +26,6 @@ my $errored = 0; #DESTINY SCOPED GLOBALS my $chaintab; my $iscsitab; -my $bptab; my $typetab; my $restab; @@ -94,6 +93,7 @@ sub setdestiny { my $noupdate = shift; $chaintab = xCAT::Table->new('chain', -create => 1); my @nodes = @{ $req->{node} }; + my $bphash = $req->{bootparams}; @ARGV = @{ $req->{arg} }; my $noupdateinitrd; @@ -157,7 +157,6 @@ sub setdestiny { unless ($iscsitab) { $callback->({ error => "Unable to open iscsi table to get iscsiboot parameters", errorcode => [1] }); } - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $nodetype = xCAT::Table->new('nodetype'); my $ntents = $nodetype->getNodesAttribs($req->{node}, [qw(os arch profile)]); my $ients = $iscsitab->getNodesAttribs($req->{node}, [qw(kernel kcmdline initrd)]); @@ -168,11 +167,9 @@ sub setdestiny { unless ($ntent and $ntent->{arch} =~ /x86/ and -f ("$tftpdir/undionly.kpxe" or -f "$tftpdir/xcat/xnba.kpxe")) { $callback->({ error => "$_: No iscsi boot data available", errorcode => [1] }); } #If x86 node and undionly.kpxe exists, presume they know what they are doing next; } - my $hash; - $hash->{kernel} = $ient->{kernel}; - if ($ient->{initrd}) { $hash->{initrd} = $ient->{initrd} } - if ($ient->{kcmdline}) { $hash->{kcmdline} = $ient->{kcmdline} } - $bptab->setNodeAttribs($_, $hash); + $bphash->{kernel} = $ient->{kernel}; + if ($ient->{initrd}) { $bphash->{initrd} = $ient->{initrd} } + if ($ient->{kcmdline}) { $bphash->{kcmdline} = $ient->{kcmdline} } } } elsif ($state =~ /^install[=\$]/ or $state eq 'install' or $state =~ /^netboot[=\$]/ or $state eq 'netboot' or $state eq "image" or $state eq "winshell" or $state =~ /^osimage/ or $state =~ /^statelite/) { my %state_hash; @@ -389,7 +386,8 @@ sub setdestiny { $subreq->({ command => ["mk$tempstate"], node => $samestatenodes, noupdateinitrd => $noupdateinitrd, - ignorekernelchk => $ignorekernelchk, }, \&relay_response); + ignorekernelchk => $ignorekernelchk, + bootparams => \$bphash}, \&relay_response); if ($errored) { my @myself = xCAT::NetworkUtils->determinehostname(); my $myname = $myself[ (scalar @myself) - 1 ]; @@ -746,7 +744,7 @@ sub getdestiny { my $chaintab = xCAT::Table->new('chain'); my $chainents = $chaintab->getNodesAttribs(\@nodes, [qw(currstate chain)]); my $nrents = $restab->getNodesAttribs(\@nodes, [qw(tftpserver xcatmaster)]); - $bptab = xCAT::Table->new('bootparams', -create => 1); + my $bptab = xCAT::Table->new('bootparams', -create => 1); my $bpents = $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline xcatmaster)]); #my $sitetab= xCAT::Table->new('site'); diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 34ddd9d8a..e5a03620d 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -571,17 +571,18 @@ sub process_request { if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash + }, \&pass_along); } if ($errored) { return; } - my $bptab = xCAT::Table->new('bootparams', -create => 1); - my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); my $noderestab = xCAT::Table->new('noderes', -create => 1); @@ -618,7 +619,7 @@ sub process_request { $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); } - ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); + ($rc, $errstr) = setstate($_, \%bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); if ($rc) { $response{node}->[0]->{errorcode}->[0] = $rc; $response{node}->[0]->{errorc}->[0] = $errstr; diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index 3d3d7fa6d..cea7eeaea 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -460,12 +460,15 @@ sub process_request { if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash}, + \&pass_along); } if ($errored) { return; } @@ -476,8 +479,6 @@ sub process_request { arg => ['default'] }); xCAT::MsgUtils->message("S", "xCAT: petitboot netboot: clear node(s): @nodes boot device setting."); } - my $bptab = xCAT::Table->new('bootparams', -create => 1); - my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); my $noderestab = xCAT::Table->new('noderes', -create => 1); @@ -510,7 +511,7 @@ sub process_request { my $linuximghash = $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); - ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nodereshash, $linuximghash); + ($rc, $errstr) = setstate($_, \%bphash, $chainhash, $machash, $tftpdir, $nodereshash, $linuximghash); if ($rc) { $response{node}->[0]->{errorcode}->[0] = $rc; $response{node}->[0]->{errorc}->[0] = $errstr; diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 4b0d937dc..f35afae12 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -497,6 +497,7 @@ sub process_request { $errored = 0; + my %bphash; my $inittime = 0; if (exists($::PXE_request->{inittime})) { $inittime = $::PXE_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } @@ -505,19 +506,19 @@ sub process_request { $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash + }, \&pass_along); } if ($errored) { return; } #Time to actually configure the nodes, first extract database data with the scalable calls - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $chaintab = xCAT::Table->new('chain'); my $mactab = xCAT::Table->new('mac'); #to get all the hostnames my $typetab = xCAT::Table->new('nodetype'); my $restab = xCAT::Table->new('noderes'); my $linuximgtab = xCAT::Table->new('linuximage', -create => 1); my %nrhash = %{ $restab->getNodesAttribs(\@nodes, [qw(tftpdir)]) }; - my %bphash = %{ $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline addkcmdline)]) }; my %chainhash = %{ $chaintab->getNodesAttribs(\@nodes, [qw(currstate)]) }; my %machash = %{ $mactab->getNodesAttribs(\@nodes, [qw(mac)]) }; my %nthash = %{ $typetab->getNodesAttribs(\@nodes, [qw(os provmethod)]) }; diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 0d14e4080..dcccc895b 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -54,6 +54,7 @@ sub mknetboot if ($req->{command}->[0] =~ 'mkstatelite') { $statelite = "true"; } + my $bootparams = ${$req->{bootparams}}; my $globaltftpdir = "/tftpboot"; my $nodes = @{ $req->{node} }; @@ -445,7 +446,6 @@ sub mknetboot } # TODO: move the table operations out of the foreach loop - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $sent = $hmtab->getNodeAttribs($node, @@ -720,13 +720,9 @@ sub mknetboot $kcmdline .= "MNTOPTS=\'$mntoptions\'"; } } - $bptab->setNodeAttribs( - $node, - { - kernel => "$rtftppath/kernel", - initrd => $initrdstr, - kcmdline => $kcmdline - }); + $bootparams->{$node}->[0]->{kernel} = "$rtftppath/kernel"; + $bootparams->{$node}->[0]->{initrd} = $initrdstr; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } } @@ -770,6 +766,7 @@ sub mkinstall my $noupdateinitrd = $request->{'noupdateinitrd'}; my $ignorekernelchk = $request->{'ignorekernelchk'}; + my $bootparams = ${$request->{bootparams}}; my @nodes = @{ $request->{node} }; my $node; my $ostab = xCAT::Table->new('nodetype'); @@ -799,7 +796,6 @@ sub mkinstall my $installroot; $installroot = "/install"; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $resents = $restab->getNodesAttribs( @@ -1365,14 +1361,9 @@ sub mkinstall $kernelpath = "$rtftppath/linux"; $initrdpath = "$rtftppath/initrd"; xCAT::MsgUtils->trace($verbose_on_off, "d", "sles->mkinstall: kcmdline=$kcmdline kernal=$kernelpath initrd=$initrdpath"); - $bptab->setNodeAttribs( - $node, - { - kernel => $kernelpath, - initrd => $initrdpath, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernelpath; + $bootparams->{$node}->[0]->{initrd} = $initrdpath; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } elsif ($arch eq "ppc64") { @@ -1384,14 +1375,9 @@ sub mkinstall $kernelpath = "$rtftppath/linux64"; $initrdpath = "$rtftppath/initrd64"; xCAT::MsgUtils->trace($verbose_on_off, "d", "sles->mkinstall: kcmdline=$kcmdline kernal=$kernelpath initrd=$initrdpath"); - $bptab->setNodeAttribs( - $node, - { - kernel => $kernelpath, - initrd => $initrdpath, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernelpath; + $bootparams->{$node}->[0]->{initrd} = $initrdpath; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } elsif (-r "$tftppath/inst64") { @@ -1399,14 +1385,9 @@ sub mkinstall #suseboot/inst64 can not be run on Power8 BE $kernelpath = "$rtftppath/inst64"; xCAT::MsgUtils->trace($verbose_on_off, "d", "sles->mkinstall: kcmdline=$kcmdline kernal=$kernelpath initrd="); - $bptab->setNodeAttribs( - $node, - { - kernel => $kernelpath, - initrd => "", - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernelpath; + $bootparams->{$node}->[0]->{initrd} = ""; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } } } @@ -1436,6 +1417,7 @@ sub mksysclone my $callback = shift; my $doreq = shift; my @nodes = @{ $request->{node} }; + my $bootparams = ${$request->{bootparams}}; my $osimagetab; my %img_hash = (); @@ -1460,7 +1442,6 @@ sub mksysclone my $node; my $ostab = xCAT::Table->new('nodetype'); my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my %osents = %{ $ostab->getNodesAttribs(\@nodes, [ 'os', 'arch', 'provmethod' ]) }; my %rents = @@ -1645,14 +1626,9 @@ sub mksysclone if (-r "$tftpdir/xcat/genesis.fs.$arch.lzma") { $i = "xcat/genesis.fs.$arch.lzma"; } - $bptab->setNodeAttribs( - $node, - { - kernel => "xcat/genesis.kernel.$arch", - initrd => $i, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = "xcat/genesis.kernel.$arch"; + $bootparams->{$node}->[0]->{initrd} = $i; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { diff --git a/xCAT-server/lib/xcat/plugins/vsmppxe.pm b/xCAT-server/lib/xcat/plugins/vsmppxe.pm index 60e0cab30..aa22a24ed 100644 --- a/xCAT-server/lib/xcat/plugins/vsmppxe.pm +++ b/xCAT-server/lib/xcat/plugins/vsmppxe.pm @@ -402,6 +402,7 @@ sub process_request { $errored = 0; + my %bphash; my $inittime = 0; if (exists($::VSMPPXE_request->{inittime})) { $inittime = $::VSMPPXE_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } @@ -409,15 +410,15 @@ sub process_request { $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => [ $args[0] ] }, \&pass_along); + arg => [ $args[0] ], + bootparams => \%bphash + }, \&pass_along); } if ($errored) { return; } #Time to actually configure the nodes, first extract database data with the scalable calls - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $chaintab = xCAT::Table->new('chain'); my $mactab = xCAT::Table->new('mac'); #to get all the hostnames - my %bphash = %{ $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline addkcmdline)]) }; my %chainhash = %{ $chaintab->getNodesAttribs(\@nodes, [qw(currstate)]) }; my %machash = %{ $mactab->getNodesAttribs(\@nodes, [qw(mac)]) }; foreach (@nodes) { diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index bdf93d294..fc485dd4e 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -108,7 +108,7 @@ sub setstate { my $linuximghashref = shift; if (ref $linuximghashref) { %linuximghash = %{$linuximghashref}; } my $imgaddkcmdline = ($linuximghash{'boottarget'}) ? undef : $linuximghash{'addkcmdline'}; - my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); + my $kern = $bphash{$node}->[0]; unless ($::XNBA_addkcmdlinehandled->{$node}) { #Tag to let us know the plugin had a special syntax implemented for addkcmdline if ($kern->{addkcmdline} or ($imgaddkcmdline)) { @@ -520,22 +520,24 @@ sub process_request { if (exists($::XNBA_request->{inittime})) { $inittime = $::XNBA_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args , + bootparams => \%bphash}, + \&pass_along); } + if ($errored) { return; } #Time to actually configure the nodes, first extract database data with the scalable calls - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $chaintab = xCAT::Table->new('chain'); my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories my $mactab = xCAT::Table->new('mac'); #to get all the hostnames my %nrhash = %{ $noderestab->getNodesAttribs(\@nodes, [qw(tftpdir)]) }; - my %bphash = %{ $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline addkcmdline)]) }; my %chainhash = %{ $chaintab->getNodesAttribs(\@nodes, [qw(currstate)]) }; my %iscsihash; my $iscsitab = xCAT::Table->new('iscsi'); From 5882a134c809f930a68da0679c6a7650e3c1dfef Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 23 Dec 2016 03:00:54 -0500 Subject: [PATCH 048/217] modify releating vm setup bundle and testcases --- xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle | 1 + xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle | 1 + xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle | 1 + xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle | 1 + xCAT-test/autotest/bundle/sles11.4_x86_64.bundle | 1 + xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/sles12.1_x86_64.bundle | 1 + xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/sles12.2_x86_64.bundle | 1 + xCAT-test/autotest/bundle/sles12_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/sles12_x86_64.bundle | 1 + xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle | 1 + xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle | 1 + xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle | 1 + xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle | 1 + xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle | 1 + .../autotest/testcase/get_install_disk/fresh_install_disk | 4 ---- xCAT-test/autotest/testcase/get_install_disk/reinstall_disk | 2 -- xCAT-test/autotest/testcase/installation/setup_vm | 4 ++-- xCAT-test/autotest/testcase/migration/redhat_migration | 6 ------ xCAT-test/autotest/testcase/migration/sles_migration | 6 ------ .../testcase/xcatdebugmode/rhels_xcatdebugmode_diskful | 6 ------ .../testcase/xcatdebugmode/sles_xcatdebugmode_diskful | 4 ---- 28 files changed, 23 insertions(+), 30 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle index 49377b612..a7b7767d1 100644 --- a/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat makehosts_h makehosts_help diff --git a/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle index 15676669e..1efa04506 100644 --- a/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput diff --git a/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle index bfbec794d..b59fd61ce 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle b/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle index e5ff83cf1..60987c4ba 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput diff --git a/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle index 27578b5ea..e5b2e18bf 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle b/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle index f858555ad..b06475ed0 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput diff --git a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle index c4dbf5754..b0129f2f0 100644 --- a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput diff --git a/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle index 469a3527c..8eba88837 100644 --- a/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle b/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle index 225f6cdad..3efef26d7 100644 --- a/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput diff --git a/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle index 469a3527c..8eba88837 100644 --- a/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle index 225f6cdad..3efef26d7 100644 --- a/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput diff --git a/xCAT-test/autotest/bundle/sles12_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12_ppc64le.bundle index e362196b8..31b05bf80 100644 --- a/xCAT-test/autotest/bundle/sles12_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/sles12_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le makehosts_h diff --git a/xCAT-test/autotest/bundle/sles12_x86_64.bundle b/xCAT-test/autotest/bundle/sles12_x86_64.bundle index 241612a0e..91afe00d7 100644 --- a/xCAT-test/autotest/bundle/sles12_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles12_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat makehosts_h makehosts_help diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle index 4c1d1b7bd..9aecea63a 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le makehosts_h diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle index 2bfb17f88..b714108f4 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm makehosts_h diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle index c49e45be8..714b7c4a4 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle index 9c4309d93..a260e16b7 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle index 09b1af592..154fb92c9 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle index 5caa4de79..bbbfa0091 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle index 6a8bad79a..db2beed03 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle index ec034a3af..07491602a 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk index b79bab100..fd5726b35 100644 --- a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk +++ b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk @@ -3,10 +3,6 @@ os:Linux description:check fresh install disk, usded for x86 multi disk only, and not check RH7.2 for RH os wwn isue. cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100" -cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858" -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata |grep -i $$CN; 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 -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf diff --git a/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk b/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk index b9fb12825..e3772b453 100644 --- a/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk +++ b/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk @@ -4,8 +4,6 @@ description:check reinstall disk, usded for x86 multi disk only, and not check R cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100" cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858" -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 -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index 743f801e9..7e02d8fb4 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -1,12 +1,12 @@ start:setup_vm description:set up vm environment -cmd:var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$CN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$CN ; rmvm $$CN -f -p ; mkvm $$CN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" -o "$var" = "nfs" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi +cmd:var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$CN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$CN ; rmvm $$CN -f -p ; mkvm $$CN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi check:rc==0 cmd:rpower $$CN on check:rc==0 cmd:rpower $$CN stat check:output=~on -cmd:var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then rmvm $$SN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$SN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$SN ; rmvm $$SN -f -p ; mkvm $$SN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" -o "$var" = "nfs" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi +cmd:var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then rmvm $$SN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$SN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$SN ; rmvm $$SN -f -p ; mkvm $$SN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi check:rc==0 cmd:rpower $$SN on check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index a5fad7718..58ffdfd42 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -5,9 +5,6 @@ description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #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;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -116,9 +113,6 @@ stop:yes #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #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;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a41e56828..1117af3a0 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -5,9 +5,6 @@ description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #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;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -118,9 +115,6 @@ description:update xCAT from $$MIGRATION22VERSION to $$LATEST_VERSION, these two #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #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;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful b/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful index 9e5bd01d9..5bd9dcfaf 100644 --- a/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful +++ b/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful @@ -4,8 +4,6 @@ description:site.xcatdebugmode value is 0, the following logs will be shown and cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -68,8 +66,6 @@ check:rc==0 cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -161,8 +157,6 @@ check:rc==0 cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf diff --git a/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful b/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful index 3ba3a5bca..91607411a 100644 --- a/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful +++ b/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful @@ -5,8 +5,6 @@ description:site.xcatdebugmode value is 0, the following logs will be shown and cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -78,8 +76,6 @@ check:rc==0 cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf From bb0161da610607cea9701752eca1227e06d0c151 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 23 Dec 2016 05:07:39 -0500 Subject: [PATCH 049/217] mistake for delete during update vm testcases --- xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk index fd5726b35..7252bf97f 100644 --- a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk +++ b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk @@ -3,6 +3,7 @@ os:Linux description:check fresh install disk, usded for x86 multi disk only, and not check RH7.2 for RH os wwn isue. cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100" +cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858" cmd:makedns -n check:rc==0 cmd:makeconservercf From 4f771e3dc3441bd763614987d8f873265667f390 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 10 Nov 2016 22:34:56 -0500 Subject: [PATCH 050/217] refine the cumulus support doc --- .../edgecore_switches/edgecore_switches.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst b/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst index db9a3cc11..63b60c24c 100644 --- a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst +++ b/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst @@ -1,7 +1,18 @@ Edgecore Switch =============== -The Edgecore switch from Mellanox is 1Gb top-of-rack switch. It's coming with ONIE installer. Open Network Install Environment (ONIE)is an open source initiative that defines an open "install environment" for bare metal network switches. For more information, see http://onie.opencompute.org/. Mellanox will ship the switch with Cumulus Network OS and along with a license file installed. In some case, user may get whitebox without OS and licenses. Since edgecore switch has different configuration than other switches that xCAT supports, xCAT handles edgecore switch differently. +The Edgecore switch from Mellanox is 1Gb top-of-rack switch. Usually, Mellanox ships the switch with Cumulus Network OS(https://cumulusnetworks.com) and along with a license file installed. In some case, user may get whitebox switch hardware without OS and license installed. Since edgecore switch is different from other traditional switches that xCAT supports, xCAT supports edgecore switch in a different way. Currently, the features provided by xCAT includes: :: + + 1) Cumulus Network OS provision + 2) switch discovery + 3) switch configuration: + (a) enable root-passwordless ssh + (b) install licence file + (c) enable snmp + 4) distribute files with ``xdcp`` + 5) invoke commands or scripts remotely with `xdsh`` + 6) + ONIE Mode From 2e1e2732670de8c8ad50981d6331d68ed82b8f42 Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 15 Nov 2016 02:27:58 -0500 Subject: [PATCH 051/217] refine cumulus support doc --- .../edgecore_switches/edgecore_switches.rst | 20 +++++++++++++++---- .../objects/node/cumulusswitch.stanza | 6 +++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst b/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst index 63b60c24c..31e1bd238 100644 --- a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst +++ b/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst @@ -1,7 +1,9 @@ Edgecore Switch =============== -The Edgecore switch from Mellanox is 1Gb top-of-rack switch. Usually, Mellanox ships the switch with Cumulus Network OS(https://cumulusnetworks.com) and along with a license file installed. In some case, user may get whitebox switch hardware without OS and license installed. Since edgecore switch is different from other traditional switches that xCAT supports, xCAT supports edgecore switch in a different way. Currently, the features provided by xCAT includes: :: +The Edgecore switch from Mellanox is 1Gb top-of-rack switch. Usually, Mellanox ships the switch with Cumulus Network OS(https://cumulusnetworks.com) and along with a license file installed. In some case, user may get whitebox switch hardware without OS and license installed. + +Since edgecore switch is different from other traditional switches that xCAT supports, xCAT supports edgecore switch in a different way. Currently, the features provided by xCAT include: :: 1) Cumulus Network OS provision 2) switch discovery @@ -9,11 +11,21 @@ The Edgecore switch from Mellanox is 1Gb top-of-rack switch. Usually, Mellanox s (a) enable root-passwordless ssh (b) install licence file (c) enable snmp - 4) distribute files with ``xdcp`` - 5) invoke commands or scripts remotely with `xdsh`` - 6) + 4) distribute files to switches with ``xdcp`` + 5) invoke remote commands or scripts on switches with `xdsh`` + 6) configure switches with ``updatenode`` + +This documentation presents a typical workflow on how to setup a edgecore switch from white box, then configure and manage the switch with xCAT. +Create a edgecore switch object +------------------------------- + +If you have the information of the ip and mac information of the switch, the edgecore switch object definition can be created with the "cumulusswitch" template shipped in xCAT : :: + + mkdef edgecoresw1 --template cumulusswitch arch=armv71 ip=192.168.5.191 mac=8C:EA:1B:12:CA:40 + +Discover the switch ONIE Mode --------- diff --git a/xCAT/templates/objects/node/cumulusswitch.stanza b/xCAT/templates/objects/node/cumulusswitch.stanza index 48575c911..cff7d05ac 100644 --- a/xCAT/templates/objects/node/cumulusswitch.stanza +++ b/xCAT/templates/objects/node/cumulusswitch.stanza @@ -4,11 +4,11 @@ cumulusswitch: objtype=node arch="OPTIONAL: the arch of the switch management service processor, such as armv71" groups=switch - ip="MANDATORY:the ip address of the management interface" - mac="MANDATORY:the mac of the management interface" + ip="OPTIONAL:the ip address of the management interface" + mac="OPTIONAL:the mac of the management interface" mgt=switch netboot=onie nodetype=switch - switchtype="OPTIONAL: the manufacturer of switch" + switchtype=edgecore provmethod="OPTIONAL: the full path of the cumulus installer" usercomment="the template for cumulus switch definition" From 8ec1af2f0c07e09cad8644708b04a18d9c099e5d Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 23 Dec 2016 03:26:48 -0500 Subject: [PATCH 052/217] remove setupntp for sles12.1 ntpd doesn't synchronize to local clock anymore in version 4.2.8p4. see#2248 --- .../testcase/installation/Full_installation_flat_p8_le | 3 ++- .../testcase/installation/reg_linux_diskfull_installation_flat | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index 0b7779db2..107da18b7 100644 --- a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -24,7 +24,8 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:chdef -t node -o $$CN postscripts=setupntp +cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles12.1" ];then chdef -t node -o $$CN postscripts=setupntp; fi +cmd:lsdef -l $$CN check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 130503f00..0800aa5d7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -29,7 +29,8 @@ cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? check:rc==0 cmd:copycds $$ISO check:rc==0 -cmd:chdef -t node -o $$CN postscripts=setupntp +cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles12.1" ];then chdef -t node -o $$CN postscripts=setupntp; fi +cmd:lsdef -l $$CN check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 From 1ff745dbfef7ce7ed6a367ef08b3b50bf975e416 Mon Sep 17 00:00:00 2001 From: ypbj Date: Wed, 14 Dec 2016 02:48:10 -0500 Subject: [PATCH 053/217] fix copycds can't auto copycd centos iso --- xCAT-server/lib/xcat/plugins/anaconda.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 6decce701..4cdf82c10 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2266,6 +2266,20 @@ sub copycd } close($dinfo); } + elsif ($desc =~ /^[\d\.]+$/) + { + open($dinfo, $mntpath . "/.treeinfo"); + while (<$dinfo>) { + chomp($_); + s/\s+$//; #remove trailing spaces + next if /^\s*$/; #-- skip empty lines + if ($_ =~ /family\s*=\s*CentOS/i) { + $distname = "centos" . $desc; + last; + } + } + close($dinfo); + } else { print "INFO - Could not auto-detect operating system.\n"; From a8522a97316871ef177362ab1a181186ae034dd8 Mon Sep 17 00:00:00 2001 From: ypbj Date: Mon, 26 Dec 2016 21:24:01 -0500 Subject: [PATCH 054/217] update man page for copycds --- docs/source/guides/admin-guides/references/man8/copycds.8.rst | 2 +- xCAT-client/pods/man8/copycds.8.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/copycds.8.rst b/docs/source/guides/admin-guides/references/man8/copycds.8.rst index a5ba210ec..37c399113 100644 --- a/docs/source/guides/admin-guides/references/man8/copycds.8.rst +++ b/docs/source/guides/admin-guides/references/man8/copycds.8.rst @@ -35,7 +35,7 @@ The \ **copycds**\ command copies all contents of Distribution DVDs/ISOs or Ser You can specify \ **-i**\ or \ **-**\ **-inspection**\ option to check whether the DVDs/ISOs can be recognized by xCAT. If recognized, the distribution name, architecture and the disc no (the disc sequence number of DVDs/ISOs in multi-disk distribution) of the DVD/ISO is displayed. If xCAT doesn't recognize the DVD/ISO, you must manually specify the distro name and architecture using the \ **-n**\ and \ **-a**\ options. This is sometimes the case for distros that have very recently been released, and the xCAT code hasn't been updated for it yet. -You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm and reloading xcatd (\ **service xcatd reload**\ ). +You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm (the key of the hash is the first line of .discinfo) and reloading xcatd (\ **service xcatd reload**\ ). ******* diff --git a/xCAT-client/pods/man8/copycds.8.pod b/xCAT-client/pods/man8/copycds.8.pod index 234c1e375..23a6af93e 100644 --- a/xCAT-client/pods/man8/copycds.8.pod +++ b/xCAT-client/pods/man8/copycds.8.pod @@ -16,7 +16,7 @@ The B command copies all contents of Distribution DVDs/ISOs or Service You can specify B<-i> or B<--inspection> option to check whether the DVDs/ISOs can be recognized by xCAT. If recognized, the distribution name, architecture and the disc no (the disc sequence number of DVDs/ISOs in multi-disk distribution) of the DVD/ISO is displayed. If xCAT doesn't recognize the DVD/ISO, you must manually specify the distro name and architecture using the B<-n> and B<-a> options. This is sometimes the case for distros that have very recently been released, and the xCAT code hasn't been updated for it yet. -You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm and reloading xcatd (B). +You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm (the key of the hash is the first line of .discinfo) and reloading xcatd (B). =head1 OPTIONS From addeeee5da7a29682e0b54ac480d8c16c83b5c2c Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 29 Dec 2016 02:15:08 -0500 Subject: [PATCH 055/217] add makentp case to synchronize time with external ntp server --- xCAT-test/autotest/testcase/makentp/cases0 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index b47ff3316..ec4c5dc2a 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -100,3 +100,25 @@ check:rc==0 cmd:rm -rf /tmp/postscript end + +start:makentp_initialize +descriptiop:start ntp service on management node and synchronize time with external ntp server +cmd:chtab key=extntpservers site.value="$$extntpserversip" +check:rc==0 +cmd:makentp -V +check:rc==0 +check:output=~configuring management node: $$MN +check:output=~checking if nptd is installed +check:output=~backing up the ntp configuration file /etc/ntp.conf +check:output=~ntp servers are: $$extntpserversip +check:output=~stopping ntpserver +check:output=~starting ntpserver +check:output=~enabling ntpserver +cmd:if [ -f "/usr/sbin/ntp-wait" ];then ntp-wait; else sleep 1200; fi +check:rc==0 +cmd:ntpq -p +check:output=~*$$extntpserversip +cmd:grep $$extntpserversip /etc/ntpd.conf +check:rc==0 +end + From 043806485b2de7433350bd9bfc3002dfccfad175 Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 30 Dec 2016 02:36:59 -0500 Subject: [PATCH 056/217] add statelite document --- .../manage_clusters/ppc64le/index.rst | 1 + .../ppc64le/statelite/advanced_features.rst | 266 +++++++++++++ .../ppc64le/statelite/config_statelite.rst | 160 ++++++++ .../ppc64le/statelite/hierarchy_support.rst | 43 +++ .../ppc64le/statelite/index.rst | 12 + .../ppc64le/statelite/overview.rst | 38 ++ .../ppc64le/statelite/provision_statelite.rst | 360 ++++++++++++++++++ 7 files changed, 880 insertions(+) create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/overview.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst index 882086fa2..8744168df 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -13,6 +13,7 @@ These are machines use the IBM Power Architecture and is **IPMI** managed. management.rst diskful/index.rst diskless/index.rst + statelite/index.rst updatenode.rst parallel_cmd.rst virtual_machines/index.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst new file mode 100644 index 000000000..6ab6c89b2 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst @@ -0,0 +1,266 @@ +Advanced Statelite features +=========================== + +Both directory and its child items coexist in litefile table +------------------------------------------------------------ + +As described in the above chapters, we can add the files/directories to litefile table. Sometimes, it is necessary to put one directory and also its child item(s) into the litefile table. Due to the implementation of the statelite on Linux, some scenarios works, but some doesn't work. + +Here are some examples of both directory and its child items coexisting: + + Both the parent directory and the child file coexist: :: + + "ALL","/root/testblank/",,, + "ALL","/root/testblank/tempfschild","tempfs",, + + One more complex example: :: + + "ALL","/root/",,, + "ALL","/root/testblank/tempfschild","tempfs",, + + Another more complex example, but we don't intend to support such one scenario: :: + + "ALL","/root/",,, + "ALL","/root/testblank/",,, + "ALL","/root/testblank/tempfschild","tempfs",, + +For example, in scenario 1, the parent is ``/root/testblank/``, and the child is ``/root/testblank/tempfschild``. +In scenario 2, the parent is ``/root/``, and the child is ``/root/testblank/tempfschild``. + +In order to describe the hierarchy scenarios we can use , ``P`` to denote parent, and ``C`` to denote child. + ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| Option | Example | Remarks | ++==============+=====================================================+=================================================+ +| P:tmpfs | "ALL","/root/testblank/",,, | Both the parent and the child are mounted to | +| | "ALL","/root/testblanktempfschild","tempfs",, | tmpfs on the booted node following their | +| | | respective options. Only the parent are mounted | +| | | to the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs | "ALL","/root/testblank/",,, | Both parent and child are mounted to tmpfs | +| C:persistent | "ALL","/root/testblank/testpersfile","persistent",, | on the booted node following their respective | +| | | options. Only the parent is mounted to the local| +| | | file | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:persistent | "ALL","/root/testblank/","persistent",, | Not permitted now. But plan to support it. | +| C:tmpfs | "ALL","/root/testblank/tempfschild",,, | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:persistent | "ALL","/root/testblank/","persistent",, | Both parent and child are mounted to tmpfs | +| C:persistent | "ALL","/root/testblank/testpersfile","persistent",, | on the booted node following their respective | +| | | options. Only the parent is mounted to local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:ro C:any | | Not permitted | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs C:ro | | Both parent and child are mounted to tmpfs | +| | | on the booted node following their respective | +| | | options. Only the parent is mounted to local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs | | Both parent and child are mounted to tmpfs | +| C:con | | on the booted node following their respective | +| | | options. Only the parent is mounted to local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | "ALL","/root/testlink/","link",, | Both parent and child are created in tmpfs | +| C:link | "ALL","/root/testlink/testlinkchild","link",, | on the booted node following their respective | +| | | options; there's only one symbolic link of | +| | | the parent is created in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P: link C: | "ALL","/root/testlinkpers/","link",, | Both parent and child are created in tmpfs | +| link, | "ALL","/root/testlink/testlinkchild", | on the booted node following their respective | +| persistent | ,"link,persistent" | options; there's only one symbolic link of | +| | | the parent is created in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | "ALL","/root/testlinkpers/","link,persistent",, | NOT permitted | +| persistent | | | +| C: link | "ALL","/root/testlink/testlinkchild","link" | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | "ALL","/root/testlinkpers/","link,persistent",, | Both parent and child are created in tmpfs | +| persistent | "ALL","/root/testlink | on the booted node following "link,persistent" | +| C:link, | | way; there's only one symbolic link of the | +| persistent | | parent is created in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | "ALL","/root/testlink/","link",, | Both parent and child are created in tmpfs | +| C:link,ro | "ALL","/root/testlink/testlinkro","link,ro",, | on the booted node, there's only one symbolic | +| | | link of the parent is created in the local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | "ALL","/root/testlink/","link",, | Both parent and child are created in tmpfs | +| C:link,con | "ALL","/root/testlink/testlinkconchild","link,con",,| on the booted node, there's only one symbolic | +| | | link of the parent in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | | NOT Permitted | +| persistent | | | +| C:link,ro | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | | NOT Permitted | +| persistent | | | +| C:link,con | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs | | NOT Permitted | +| C:link | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | | NOT Permitted | +| C:persistent | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ + +litetree table +-------------- + +The litetree table controls where the initial content of the files in the litefile table come from, and the long term content of the ``ro`` files. When a node boots up in statelite mode, it will by default copy all of its tmpfs files from the ``/.default`` directory of the root image, so there is not requirement to setup a litetree table. If you decide that you want some of the files pulled from different locations that are different per node, you can use this table. + +See litetree man page for description of attributes. + +For example, a user may have two directories with a different ``/etc/motd`` that should be used for nodes in two locations: :: + + 10.0.0.1:/syncdirs/newyork-590Madison/rhels5.4/x86_64/compute/etc/motd + 10.0.0.1:/syncdirs/shanghai-11foo/rhels5.4/x86_64/compute/etc/motd + +You can specify this in one row in the litetree table: :: + + 1,,10.0.0.1:/syncdirs/$nodepos.room/$nodetype.os/$nodetype.arch/$nodetype.profile + +When each statelite node boots, the variables in the litetree table will be substituted with the values for that node to locate the correct directory to use. Assuming that ``/etc/motd`` was specified in the litefile table, it will be searched for in all of the directories specified in the litetree table and found in this one. + +You may also want to look by default into directories containing the node name first: :: + + $noderes.nfsserver:/syncdirs/$node + +The litetree prioritizes where node files are found. The first field is the priority. The second field is the image name (ALL for all images) and the final field is the mount point. + +Our example is as follows: :: + + 1,,$noderes.nfsserver:/statelite/$node + 2,,cnfs:/gpfs/dallas/ + +The two directories ``/statelite/$node`` on the node's $noderes.nfsserver and the ``/gpfs/dallas`` on the node cnfs contain root tree structures that are sparsely populated with files that we want to place in those nodes. If files are not found in the first directory, it goes to the next directory. If none of the files can be found in the litetree hierarchy, then they are searched for in ``/.default`` on the local image. + +Installing a new Kernel in the statelite image +---------------------------------------------- + +Obtain you new kernel and kernel modules on the MN, for example here we have a new SLES kernel. + +#. Copy the kernel into /boot : :: + + cp **vmlinux-2.6.32.10-0.5-ppc64**/boot + +#. Copy the kernel modules into ``/lib/modules/`` :: + + /lib/modules # ls -al + total 16 + drwxr-xr-x 4 root root 4096 Apr 19 10:39 . + drwxr-xr-x 17 root root 4096 Apr 13 08:39 .. + drwxr-xr-x 3 root root 4096 Apr 13 08:51 2.6.32.10-0.4-ppc64 + **drwxr-xr-x 4 root root 4096 Apr 19 10:12 2.6.32.10-0.5-ppc64** + +#. Run genimage to update the statelite image with the new kernel :: + + genimage -k 2.6.32.10-0.5-ppc64 + +#. Then after a nodeset command and netbooti, shows the new kernel:: + + uname -a + +Enabling the localdisk Option +----------------------------- + +``Note``: You can skip this section if not using the ``localdisk`` option in your litefile table. + +Several things need to be done to enable the 'localdisk' support: + +Define how to partition the local disk +`````````````````````````````````````` + +When a node is deployed, the local hard disk needs to be partitioned and formatted before it can be used. This section explains how provide a configuration file that tells xCAT to partition a local disk and make it ready to use for the directories listed in the litefile table with the ``localdisk`` option. + +The configuration file needs to be specified in the ``partitionfile`` attribute of the osimage definition. The configuration file includes several parts: + + * Global parameters to control enabling or disabling the function + * [disk] part to control the partitioning of the disk + * [localspace] part to control which partition will be used to store the localdisk directories listed in the litefile table + * [swapspace] part to control the enablement of the swap space for the node. + +An example localdisk configuration file: :: + + enable=yes + enablepart=no + + [disk] + dev=/dev/sdb + clear=yes + parts=100M-200M,1G-2G + + [disk] + dev=/dev/sda + clear=yes + parts=10,20,30 + + [disk] + dev=/dev/sdc + clear=yes + parts=10,20,30 + + [localspace] + dev=/dev/sda1 + fstype=ext3 + + [swapspace] + dev=/dev/sda2 + +The two global parameters ``enable`` and ``enablepart`` can be used to control the enabling/disabling of the functions: + + * enable: The localdisk feature only works when ``enable`` is set to *yes*. If it is set to *no*, the localdisk configuration will not be run. + * enablepart: The partition action (refer to the ``[disk]`` section) will be run only when ``enablepart=yes``. + +The ``[disk]`` section is used to configure how to partition a hard disk: + + * dev: The path of the device file. + * clear: If set to ``yes`` it will clear all the existing partitions on this disk. + * fstype: The file system type for the new created partitions. ``ext3`` is the default value if not set. + * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If you set it to ``50``, that means 50% of the disk space will be assigned to that partition. + +The ``[localspace]`` section is used to specify which partition will be used as local storage for the node. + + * dev: The path of the partition. + * fstype: The file system type on the partition. + +the ``[swapspace]`` section is used to configure the swap space for the statelite node. + + * dev: The path of the partition file which will be used as the swap space. + +To enable the local disk capability, create the configuration file (for example in ``/install/custom``) and set the path in the partitionfile attribute for the osimage: :: + + chdef -t osimage partitionfile=/install/custom/cfglocaldisk + +Now all nodes that use this osimage (i.e. have their provmethod attribute set to this osimage definition name), will have its local disk configured. + +Configure the files in the litefile table +````````````````````````````````````````` + +For the files/directories that you would like xCAT to store on the local disk, add an entry in the litefile table like this: :: + + "ALL","/tmp/","localdisk",, + +``Note``: you do not need to specify the swap space in the litefile table. Just putting it in the partitionfile config file is enough. + +Add an entry in policy table to permit the running of the ``getpartitioin`` command from the node :: + + chtab priority=7.1 policy.commands=getpartition policy.rule=allow + +If Using the RAMdisk-based Image +```````````````````````````````` + +If you want to use the local disk option with a RAMdisk-based image, remember to follow the instructions in :ref:`Switch to the RAMdisk based solution`. + +If your reason for using a RAMdisk image is to avoid compute node runtime dependencies on the service node or management node, then the only entries you should have in the litefile table should be files/dirs that use the localdisk option. + +Debugging techniques +-------------------- + + When a node boots up in statelite mode, there is a script that runs called statelite that is in the root directory of ``$imageroot/etc/init.d/statelite``. This script is not run as part of the rc scripts, but as part of the pre-switch root environment. Thus, all the linking is done in this script. There is a ``set x`` near the top of the file. You can uncomment it and see what the script runs. You will then see lots of mkdirs and links on the console. + + You can also set the machine to shell. Just add the word ``shell`` on the end of the pxeboot file of the node in the append line. This will make the init script in the initramfs pause 3 times before doing a switch_root. + + When all the files are linked they are logged in ``/.statelite/statelite.log`` on the node. You can get into the node after it has booted and look in the ``/.statelite`` directory. + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst new file mode 100644 index 000000000..3309bd4b1 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst @@ -0,0 +1,160 @@ +Configure Statelite +=================== + +Getting started with statelite provisioning requires that you have xCAT set up and running. Before continuing with the rest of this document, the xCAT management node must be set up, and the nodes' hardware control, resource, and type attributes must be defined correctly. + +The operating system image files and the statelite files can be put on the service nodes or the management node, or any external NFS server. + +Statelite uses the following tables in xCAT: + +litefile table +-------------- + +The litefile table specifies the directories and files on the statelite nodes that should be read/write, persistent, or read-only overlay. All other files in the statelite nodes come from the read-only statelite image. + +#. The first column in the litefile table is the image name this row applies to. It can be an exact osimage definition name, an osimage group (set in the groups attribute of osimages), or the keyword ``ALL``. + +#. The second column in the litefile table is the full path of the directory or file on the node that you are setting options for. + +#. The third column in the litefile table specifies options for the directory or file: :: + + 1. tmpfs - It provides a file or directory for the node to use when booting, its permission will be the same as the original version on the server. In most cases, it is read-write; however, on the next statelite boot, the original version of the file or directory on the server will be used, it means it is non-persistent. This option can be performed on files and directories. + 2. rw - Same as Above.Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. + 3. persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted on the local file or directory. Anything written to that file or directory is preserved. It means, if the file/directory does not exist at first, it will be copied to the persistent location. Next time the file/directory in the persistent location will be used. The file/directory will be persistent across reboots. Its permission will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. This option can be performed on files and directories. + 3. con - The contents of the pathname are concatenated to the contents of the existing file. For this directive the searching in the litetree hierarchy does not stop when the first match is found. All files found in the hierarchy will be concatenated to the file when found. The permission of the file will be "-rw-r--r--", which means it is read-write for the root user, but readonly for the others. It is non-persistent, when the node reboots, all changes to the file will be lost. It can only be performed on files. Do not use it for one directory. + 4. ro - The file/directory will be overmounted read-only on the local file/directory. It will be located in the directory hierarchy specified in the litetree table. Changes made to this file or directory on the server will be immediately seen in this file/directory on the node. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. This option can be performed on files and directories. + 5. tmpfs,rw - Only for compatibility it is used as the default option if you leave the options column blank. It has the same semantics with the link option, so when adding new items into the _litefile table, the link option is recommended. + 6. link - It provides one file/directory for the node to use when booting, it is copied from the server, and will be placed in tmpfs on the booted node. In the local file system of the booted node, it is one symbolic link to one file/directory in tmpfs. And the permission of the symbolic link is "lrwxrwxrwx", which is not the real permission of the file/directory on the node. So for some application sensitive to file permissions, it will be one issue to use "link" as its option, for example, "/root/.ssh/", which is used for SSH, should NOT use "link" as its option. It is non-persistent, when the node is rebooted, all changes to the file/directory will be lost. This option can be performed on files and directories. + 7. link,ro - The file is readonly, and will be placed in tmpfs on the booted node. In the local file system of the booted node, it is one symbolic link to the tmpfs. It is non-persistent, when the node is rebooted, all changes to the file/directory will be lost. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. The option can be performed on files and directories. + 8. link,con - It works similar to the "con" option. All the files found in the litetree hierarchy will be concatenated to the file when found. The final file will be put to the tmpfs on the booted node. In the local file system of the booted node, it is one symbolic link to the file/directory in tmpfs. It is non-persistent, when the node is rebooted, all changes to the file will be lost. The option can only be performed on files. + + 9. link,persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted to the tmpfs on the booted node, and finally the symbolic link in the local file system will be linked to the over-mounted tmpfs file/directory on the booted node. The file/directory will be persistent across reboots. The permission of the file/directory where the symbolic link points to will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. The option can be performed on files and directories. + + 10. localdisk - The file or directory will be stored in the local disk of the statelite node. Refer to the section To enable the localdisk option to enable the 'localdisk' support. + +Currently, we don't handle the relative links very well. The relative links are commonly used by the system libraries, for example, under ``/lib/`` directory, there will be one relative link matching one ``.so`` file. So, when you add one relative link to the litefile table (We don't recommend ), make sure the real file also be included, or you can put its directory name into the litefile table. However, most of the users will not put the relative links in the litefile table. + +``Note``: It is recommended that you specify at least the entries listed below in the litefile table, because most of these files need to be writeable for the node to boot up successfully. When any changes are made to their options, make sure they won't affect the whole system. + +Sample Data for a RedHat statelite setup +```````````````````````````````````````` + +This is the minimal list of files needed, you can add additional files to the litefile table. + +Notice that all files are in tmpfs, the default for the options field. This gives you an NFS root solution with no persistent storage. :: + + #image,file,options,comments,disable + "ALL","/etc/adjtime","tmpfs",, + "ALL","/etc/fstab","tmpfs",, + "ALL","/etc/lvm/","tmpfs",, + "ALL","/etc/syslog.conf","tmpfs",, + "ALL","/etc/syslog.conf.XCATORIG","tmpfs",, + "ALL","/etc/ntp.conf","tmpfs",, + "ALL","/etc/ntp.conf.predhclient","tmpfs",, + "ALL","/etc/resolv.conf","tmpfs",, + "ALL","/etc/resolv.conf.predhclient","tmpfs",, + "ALL","/etc/ssh/","tmpfs",, + "ALL","/etc/sysconfig/","tmpfs",, + "ALL","/etc/inittab","tmpfs",, + "ALL","/tmp/","tmpfs",, + "ALL","/var/","tmpfs",, + "ALL","/opt/xcat/","tmpfs",, + "ALL","/xcatpost/","tmpfs",, + "ALL","/root/.ssh/","tmpfs",, + +Sample Data for Redhat6/7 statelite setup +````````````````````````````````````````` + +This is the minimal list of files needed, you can add additional files to the litefile table. :: + + #image,file,options,comments,disable + "ALL","/etc/adjtime","tmpfs",, + "ALL","/etc/securetty","tmpfs",, + "ALL","/etc/lvm/","tmpfs",, + "ALL","/etc/ntp.conf","tmpfs",, + "ALL","/etc/rsyslog.conf","tmpfs",, + "ALL","/etc/rsyslog.conf.XCATORIG","tmpfs",, + "ALL","/etc/udev/","tmpfs",, + "ALL","/etc/ntp.conf.predhclient","tmpfs",, + "ALL","/etc/resolv.conf","tmpfs",, + "ALL","/etc/yp.conf","tmpfs",, + "ALL","/etc/resolv.conf.predhclient","tmpfs",, + "ALL","/etc/sysconfig/","tmpfs",, + "ALL","/etc/ssh/","tmpfs",, + "ALL","/etc/inittab","tmpfs",, + "ALL","/tmp/","tmpfs",, + "ALL","/var/","tmpfs",, + "ALL","/opt/xcat/","tmpfs",, + "ALL","/xcatpost/","tmpfs",, + "ALL","/etc/systemd/system/multi-user.target.wants/","tmpfs",, + "ALL","/root/.ssh/","tmpfs",, + "ALL","/etc/rc3.d/","tmpfs",, + "ALL","/etc/rc2.d/","tmpfs",, + "ALL","/etc/rc4.d/","tmpfs",, + "ALL","/etc/rc5.d/","tmpfs",, + +Sample Data for SLES11 statelite setup +`````````````````````````````````````` + +This is the minimal list of files needed, you can add additional files to the litefile table. :: + + #image,file,options,comments,disable + "ALL","/etc/lvm/","tmpfs",, + "ALL","/etc/ntp.conf","tmpfs",, + "ALL","/etc/ntp.conf.org","tmpfs",, + "ALL","/etc/resolv.conf","tmpfs",, + "ALL","/etc/ssh/","tmpfs",, + "ALL","/etc/sysconfig/","tmpfs",, + "ALL","/etc/syslog-ng/","tmpfs",, + "ALL","/etc/inittab","tmpfs",, + "ALL","/tmp/","tmpfs",, + "ALL","/etc/init.d/rc3.d/","tmpfs",, + "ALL","/etc/init.d/rc5.d/","tmpfs",, + "ALL","/var/","tmpfs",, + "ALL","/etc/yp.conf","tmpfs",, + "ALL","/etc/fstab","tmpfs",, + "ALL","/opt/xcat/","tmpfs",, + "ALL","/xcatpost/","tmpfs",, + "ALL","/root/.ssh/","tmpfs",, + +``Note``: Sample Data for Fedora13/14 statelite setup refer to the setup of Redhat6. + +litetree table +-------------- + +The litetree table controls where the initial content of the files in the litefile table come from, and the long term content of the ``ro`` files. When a node boots up in statelite mode, it will by default copy all of its tmpfs files from the ``/.default`` directory of the root image, so there is not required to set up a litetree table. If you decide that you want some of the files pulled from different locations that are different per node, you can use this table. See Advanced Statelite features. + +You can choose to use the defaults and not set up a litetree table. + +statelite table +--------------- + +You may want some files in the image to be stored permanently, to survive reboots. This is done by entering the information into the statelite table. + +See the statelite man page for description of the attributes. + +``Note``: In the statelite table, the node or nodegroups in the table must be unique; that is a node or group should appear only once in the first column table. This makes sure that only one statelite image can be assigned to a node. + +An example would be: :: + + "compute",,":/gpfs/state",, + +Any nodes in the compute node group will have their state stored in the ``/gpfs/state`` directory on the machine with ```` as its IP address. The image attribute should be left blank - currently it is not used. + +When the node boots up, then the value of the statemnt attribute will be mounted to ``/.statelite/persistent``. The code will then create the following subdirectory ``/.statelite/persistent/`` if there are persistent files that have been added in the litefile table. This directory will be the root of the image for this node's persistent files. By default, xCAT will do a hard NFS mount of the directory. You can change the mount options by setting the mntopts attribute in the statelite table. + +Also, to set the statemnt attribute, you can use variables from xCAT database. It follows the same grammar as the litetree table. For example: :: + + #node,image,statemnt,mntopts,comments,disable + "cn1",,"$noderes.nfsserver:/lite/state/$nodetype.profile","soft,timeo=30",, + +``Note``: Do not name your persistent storage directory with the node name, as the node name will be added in the directory automatically. If you do, then a directory named ``/state/cn1`` will have its state tree inside ``/state/cn1/cn1``. + +Policy +------ + +Ensure policies are set up correctly in the Policy Table. When a node boots up, it queries the xCAT database to get the litefile and litetree table information. In order for this to work, the commands (of the same name) must be set in the policy table to allow nodes to request it. This should happen automatically when xCAT is installed, but you may want to verify that the following lines are in the policy table: :: + + chdef -t policy -o 4.7 commands=litefile rule=allow + chdef -t policy -o 4.8 commands=litetree rule=allow + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst new file mode 100644 index 000000000..6591018d7 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst @@ -0,0 +1,43 @@ +Hierarchy Support +----------------- + +In the ``statelite`` environment, the service node needs to provide NFS service for the compute node with ``statelite``, the service nodes must to be setup with diskfull installation. + +Setup the diskfull service node +``````````````````````````````` + +#. Setup one diskfull service node at first. + +#. Since statelite is a kind of NFS-hybrid method, you should remove the installloc attribute in the site table. This makes sure that the service node does not mount the ``/install`` directory from the management node on the service node. + +Generate the statelite image +```````````````````````````` + +To generate the statelite image for your own profile follow instructions in `Customize your statelite osimage`_. + +``NOTE``: if the NFS directories defined in the litetree table are on the service node, it is better to setup the NFS directories in the service node following the chapter. + +Sync the ``/install`` directory +``````````````````````````````` + +The command prsync is used to sync the ``/install`` directory to the service nodes. + +Run the following: :: + + cd / + prsync install :/ + +```` is the hostname of the service node you defined. + +Since the ``prsync`` command will sync all the contents in the ``/install`` directory to the service nodes, the first time will take a long time. But after the first time, it will take very short time to sync. + +``NOTE``: if you make any changes in the ``/install`` directory on the management node, and the changes can affect the statelite image, you need to sync the ``/install`` directory to the service node again. + +Set the boot state to statelite +``````````````````````````````` + +You can now deploy the node: :: + + rinstall osimage=rhel5.3-x86_64-statelite-compute + +This will create the necessary files in ``/tftpboot`` for the node to boot correctly. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst new file mode 100644 index 000000000..8a91a2a82 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst @@ -0,0 +1,12 @@ +Statelite Installation +====================== + +.. toctree:: + :maxdepth: 3 + + overview.rst + config_statelite.rst + provision_statelite.rst + update_nodes.rst + hierarchy_support.rst + advanced_features.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/overview.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/overview.rst new file mode 100644 index 000000000..0a0139c37 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/overview.rst @@ -0,0 +1,38 @@ +Overview +======== + +This document details the design and setup for the statelite solution of xCAT. ``Statelite`` is an intermediate mode between ``stateful`` and ``stateless``. + +Statelite provides two kinds of efficient and flexible solutions, most of the OS image can be NFS mounted read-only, or the OS image can be in the ramdisk with tmpfs type. Different from the stateless solution, statelite provides a configurable list of directories and files that can be read-write. These read-write directories and files can either be persistent across reboots, or volatile (which means restoring to the original state after reboot). + +Solutions +--------- + +There are two solutions, ``NFSROOT-based`` and ``RAMdisk-based``. + +There is an attribute named rootfstype in the osimage xCAT data objects. If it is set to ``ramdisk``, the ``RAMdisk-based`` statelite solution will be enabled. If it is left as blank, or set to ``nfs``, the ``NFSROOT-base`` statelite solution will be enabled. + +The default solution is ``NFSROOT-based``. In the ``NFSROOT-based`` solution, the ROOTFS is NFS mounted read-only. + +In the ``RAMdisk-based`` statelite solution, one image file will be downloaded when the node is booting up, and the file will be extracted to the ramdisk, and used as the ROOTFS. + +Advantages +---------- + +``Statelite`` offers the following advantages over xCAT's stateless (RAMdisk) implementation: + +#. Some files can be made persistent over reboot. This is useful for license files or database servers where some state is needed. However, you still get the advantage of only having to manage a single image. +#. Changes to hundreds of machines can take place instantly, and automatically, by updating one main image. In most cases, machines do not need to reboot for these changes to take affect. This is only for the ``NFSROOT-based`` solution. +#. Ease of administration by being able to lock down an image. Many parts of the image can be read-only, so no modifications can transpire without updating the central image. +#. Files can be managed in a hierarchical manner. For example: Suppose you have a machine that is in one lab in Tokyo and another in London. You could set table values for those machines in the xCAT database to allow machines to sync from different places based on their attributes. This allows you to have one base image with multiple sources of file overlay. +#. Ideal for virtualization. In a virtual environment, you may not want a disk image (neither stateless nor stateful) on every virtual node as it consumes memory and disk. Virtualizing with the statelite approach allows for images to be smaller, easier to manage, use less disk, less memory, and more flexible. + +Disadvantages +------------- + +However, there're still several disadvantages, especially for the ``NFSROOT-based`` solution. + +#. NFS Root requires more network traffic to run as the majority of the disk image runs over NFS. This may depend on your workload, but can be minimized. Since the bulk of the image is read-only, NFS caching on the server helps minimize the disk access on the server, and NFS caching on the client helps reduce the network traffic. +#. NFS Root can be complex to set up. As more files are created in different places, there are greater chances for failures. This flexibility is also one of the great virtues of Statelite. The image can work in nearly any environment. + +Only one statelite image may be defined for a node or noderange. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst new file mode 100644 index 000000000..e87e5bb0c --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst @@ -0,0 +1,360 @@ +Provision statelite +=================== + +Show current provmethod +----------------------- + +To determine the current provmethod of your node, run: :: + + lsdef | provmethod + +If an osimage name is specified for the provmethod, the osimage attribute settings stored in the osimage and linuximage table are used to locate the files for ``templates``, ``*pkglists``, ``syncfiles``, etc. + +``Note``: syncfiles is not currently supported for statelite nodes. + +See attributes in the osimage, linuximage and nimimage tables. For example: :: + + tabdump -d osimage + tabdump -d linuximage + tabdump -d nimimage + +For a hierarchical cluster, the files must be placed under the site table installdir attribute path, usually ``/install`` directory, so they will be available when mounted on the service nodes. The site table installdir directory, is mounted or copied to the service nodes during the hierarchical install of compute nodes from the service nodes. + +Generate default statelite image from distoro media +--------------------------------------------------- + +For our example, we are going to create a new compute node test osimage for ``rhels7.3`` on ``ppc64le``. This works fine for other archtectures ( e.g. ``x86_64``). Just substitute your architecture in the paths ( e.g. ``x86_64`` ). We will set up a test directory structure that we can use to create our image. Later we can just move that into production. + +Use the copycds command to copy the appropriate iso image into the ``/install`` directory for xCAT. The copycds commands will copy the contents to ``/install/rhels7.3/``. For example: :: + + mkdir /iso + cd /iso + copycds RHEL-7.3-20161019.0-Server-ppc64le-dvd1.iso + +The contents are copied into ``/install/rhels7.3/ppc64le/`` + +When copycds runs, it will automatically create default osimage names and paths in the osimage table and the linuximage table based on the os and architecture you are using. You can use these defaults as a starting point to create your own osimage definitions, or you can create your own image definition. We are going to use the statelite generated image for our example. + +The configuration files pointed to by the attributes are the defaults shipped with xCAT. We will want to copy them to the ``/install`` directory, in our example the ``/install/test`` directory and modify them as needed. :: + + lsdef -t osimage -o rhels7.3-ppc64le-statelite-compute + Object name: rhels7.3-ppc64le-statelite-compute + exlist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist + imagetype=linux + osarch=ppc64le + osdistroname=rhels7.3-ppc64le + osname=Linux + osvers=rhels7.3 + otherpkgdir=/install/post/otherpkgs/rhels7.3/ppc64le + permission=755 + pkgdir=/install/rhels7.3/ppc64le + pkglist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist + postinstall=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + profile=compute + provmethod=statelite + rootimgdir=/install/netboot/rhels7.3/ppc64le/compute + synclists=/install/custom/netboot/rh/compute.synclist + +Customize your statelite osimage +-------------------------------- + +Create the osimage definition +````````````````````````````` + +Setup your osimage/linuximage tables with new test image name, osvers,osarch, and paths to all the files for building and installing the node. So using the above generated ``rhels7.3-ppc64le-statelite-compute`` as an example, I am going to create my own image. The value for the provmethod attribute is osimage in my example.:: + + mkdef -t osimage -o redhat7img \ + profile=compute imagetype=linux provmethod=statelite osarch=ppc64le osname=linux osvers=rhels7.3 + +Check your setup: :: + + lsdef -t osimage redhat7img + Object name: redhat7img + imagetype=linux + osarch=ppc64le + osname=linux + osvers=rhels7.3 + profile=compute + provmethod=statelite + +Add the paths to your ``pkglist``, ``syncfile``, etc to the osimage definition, that you require. ``Note``, if you modify the files on the ``/opt/xcat/share/...`` path then copy to the appropriate ``/install/custom/...`` path. Remember all files must be under ``/install`` if using hierarchy (service nodes). + +Copy the sample ``*list`` files and modify as needed: :: + + mkdir -p /install/test/netboot/rh + cp -p /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist \ + /install/test/netboot/rh/compute.pkglist + cp -p /opt/xcat/share/xcat/netboot/rh/compute.exlist \ + /install/test/netboot/rh/compute.exlist + + chdef -t osimage -o redhat7img \ + pkgdir=/install/rhels7.3/ppc64le \ + pkglist=/install/test/netboot/rh/compute.pkglist \ + exlist=/install/test/netboot/rh/compute.exlist \ + rootimgdir=/install/test/netboot/rh/ppc64le/compute + +Check your setup: :: + + lsdef -t osimage -o redhat7img + Object name: redhat7img + exlist=/install/test/netboot/rh/compute.exlist + imagetype=linux + osarch=ppc64 + osname=linux + osvers=rhels7.3 + pkgdir=/install/rhels7.3/ppc64le + pkglist=/install/test/netboot/rh/compute.pkglist + profile=compute + provmethod=statelite + rootimgdir=/install/test/netboot/rh/ppc64le/compute + +Setup pkglists +`````````````` + +In the above example, you have defined your pkglist to be in ``/install/test/netboot/rh/compute.pkglist``. + +Edit compute.pkglist and compute.exlist as needed. :: + + cd /install/test/netboot/rh/ + vi compute.pkglist compute.exlist + +For example to add vi to be installed on the node, add the name of the vi rpm to compute.pkglist. Make sure nothing is excluded in compute.exlist that you need. + +Install other specific packages +``````````````````````````````` + +Make the directory to hold additional rpms to install on the compute node. :: + + mkdir -p /install/test/post/otherpkgs/rh/ppc64le + +Now copy all the additional OS rpms you want to install into ``/install/test/post/otherpkgs/rh/ppc64le``. + +At first you need to create one text file which contains the complete list of files to include in the repository. The name of the text file is rpms.list and must be in ``/install/test/post/otherpkgs/rh/ppc64le`` directory. Create rpms.list: :: + + cd /install/test/post/otherpkgs/rh/ppc64le + ls *.rpm > rpms.list + +Then, run the following command to create the repodata for the newly-added packages: :: + + createrepo -i rpms.list /install/test/post/otherpkgs/rh/ppc64le + +The ``createrepo`` command with -i rpms.list option will create the repository for the rpm packages listed in the rpms.list file. It won't destroy or affect the rpm packages that are in the same directory, but have been included into another repository. + +Or, if you create a sub-directory to contain the rpm packages, for example, named other in ``/install/test/post/otherpkgs/rh/ppc64le``. Run the following command to create repodata for the directory ``/install/test/post/otherpkgs/rh/ppc64le``. :: + + createrepo /install/post/otherpkgs///**other** + +``Note``: Replace other with your real directory name. + +Define the location of of your otherpkgs in your osimage: :: + + chdef -t osimage -o redhat7img \ + otherpkgdir=/install/test/post/otherpkgs/rh/ppc64le \ + otherpkglist=/install/test/netboot/rh/compute.otherpkgs.pkglist + +There are examples under ``/opt/xcat/share/xcat/netboot/`` of typical ``*otherpkgs.pkglist`` files that can used as an example of the format. + +Set up Post install scripts for statelite +````````````````````````````````````````` + +The rules to create post install scripts for statelite image is the same as the rules for stateless/diskless install images. + +There're two kinds of postscripts for statelite (also for stateless/diskless). + +The first kind of postscript is executed at genimage time, it is executed again the image itself on the MN . It was setup in The postinstall file section before the image was generated. + +The second kind of postscript is the script that runs on the node during node deployment time. During init.d timeframe, ``/etc/init.d/gettyset`` calls ``/opt/xcat/xcatdsklspost`` that is in the image. This script uses wget to get all the postscripts under ``mn:/install/postscripts`` and copy them to the ``/xcatpost`` directory on the node. It uses openssl or stunnel to connect to the xcatd on the mn to get all the postscript names for the node from the postscripts table. It then runs the postscripts for the node. + +Setting up postinstall files (optional) +``````````````````````````````````````` + +Using postinstall files is optional. There are some examples shipped in ``/opt/xcat/share/xcat/netboot/``. + +If you define a postinstall file to be used by genimage, then :: + + chdef -t osimage -o redhat7img postinstall=. + +Setting up Files to be synchronized on the nodes +```````````````````````````````````````````````` + +Setup the node to use your osimage +`````````````````````````````````` +:: + chdef -t node -o node1 provmethod=redhat7img + lsdef node1 | grep provmethod + provmethod=redhat7img + +Generate the image +------------------ + +Run the following command to generate the image based on your osimage named redhat6img. Adjust your genimage parameters to your architecture and network settings. See man genimage. :: + + genimage redhat7img + +The genimage will create a default ``/etc/fstab`` in the image, for example: :: + + devpts /dev/pts devpts gid=5,mode=620 0 0 + tmpfs /dev/shm tmpfs defaults 0 0 + proc /proc proc defaults 0 0 + sysfs /sys sysfs defaults 0 0 + tmpfs /tmp tmpfs defaults,size=10m 0 2 + tmpfs /var/tmp tmpfs defaults,size=10m 0 2 + compute_x86_64 / tmpfs rw 0 1 + +If you want to change the defaults, on the management node, edit fstab in the image: :: + + cd /install/netboot/rhels6/x86_64/compute/rootimg/etc + cp fstab fstab.ORIG + vi fstab + +Change these settings: :: + + proc /proc proc rw 0 0 + sysfs /sys sysfs rw 0 0 + devpts /dev/pts devpts rw,gid=5,mode=620 0 0 + #tmpfs /dev/shm tmpfs rw 0 0 + compute_x86_64 / tmpfs rw 0 1 + none /tmp tmpfs defaults,size=10m 0 2 + none /var/tmp tmpfs defaults,size=10m 0 2 + +``Note``: adding ``/tmp`` and ``/var/tmp`` to ``/etc/fstab`` is optional, most installations can simply use ``/``. It was documented her to show that you can restrict the size of filesystems, if you need to. The indicated values are just and example, and you may need much bigger filessystems, if running applications like OpenMPI. + +Pack the image +-------------- +:: + liteimg redhat7img + +Boot the node +------------- +:: + rinstall node1 osimage=redhat7img + +Switch to the RAMdisk based solution +------------------------------------ + +It is optional, if you want to use RAMdisk-based solution, follow this section. + +Set rootfstype +`````````````` + +If you want the node to boot with a RAMdisk-based image instead of the NFS-base image, set the rootfstype attribute for the osimage to ``ramdisk``. For example: :: + + chdef -t osimage -o rhels6-ppc64-statelite-compute rootfstype=ramdisk + +Run liteimg command +``````````````````` + +The ``liteimg`` command will modify your statelite image (the image that ``genimage`` just created) by creating a series of links. Once you are satisfied with your image contains what you want it to, run ``liteimg ``: :: + + liteimg rhels6-ppc64-statelite-compute + +For files with link options, the ``liteimg`` command creates two levels of indirection, so that files can be modified while in their image state as well as during runtime. For example, a file like ``$imageroot/etc/ntp.conf`` with link option in the litefile table, will have the following operations done to it: + +In our case ``$imageroot`` is ``/install/netboot/rhels5.3/x86_64/compute/rootimg`` + +The ``liteimg`` script, for example, does the following to create the two levels of indirection. :: + + mkdir -p $imageroot/.default/etc + mkdir -p $imageroot/.statelite/tmpfs/etc + mv $imgroot/etc/ntp.conf $imgroot/.default/etc + cd $imgroot/.statelite/tmpfs/etc + ln -sf ../../../.default/etc/ntp.conf . + cd $imgroot/etc + ln -sf ../.statelite/tmpfs/etc/ntp.conf . + +When finished, the original file will reside in ``$imgroot/.default/etc/ntp.conf``. ``$imgroot/etc/ntp.conf`` will link to ``$imgroot/.statelite/tmpfs/etc/ntp.conf`` which will in turn link to ``$imgroot/.default/etc/ntp.conf``. + +But for files without link options, the ``liteimg`` command only creates clones in ``$imageroot/.default/`` directory, when the node is booting up, the mount command with ``--bind`` option will get the corresponding files from the ``litetree`` places or ``.default`` directory to the sysroot directory. + +``Note``: If you make any changes to your litefile table after running ``liteimg`` then you will need to rerun ``liteimg`` again. This is because files and directories need to have the two levels of redirects created. + +Boot the node +````````````` + +Make sure you have set up all the attributes in your node definitions correctly following the node installation instructions corresponding to your hardware: + +You can now deploy the node by running the following commmands: :: + + rinstall + +This will create the necessary files in ``/tftpboot/etc`` for the node to boot correctly. +You can then use ``rcons`` or ``wcons`` to watch the node boot up. + +Commands +-------- + +The following commands are in ``/opt/xcat/bin``: :: + + litefile : Shows all the statelite files that are not to be taken from the base of the image. + + litetree : Shows the NFS mount points for a node. + + liteimg : Creates a series of symbolic links in an image that is compatible with statelite booting. + + lslite -i : Displays a summary of the statelite information defined for . + + lslite : Displays a summary of the statelite information defined for the + +Statelite Directory Structure +----------------------------- + +Each statelite image will have the following directories: :: + + /.statelite/tmpfs/ + /.default/ + /etc/init.d/statelite + +All files with link options, which are symbolic links, will link to ``/.statelite/tmpfs``. + +tmpfs files that are persistent link to ``/.statelite/persistent//``, ``/.statelite/persistent/`` is the directory where the node's individual storage will be mounted to. + +``/.default`` is where default files will be copied to from the image to tmpfs if the files are not found in the litetree hierarchy. + +The noderes Table +````````````````` +``noderes.nfsserver`` attribute can be set for the NFSroot server. If this is not set, then the defaul is the Management Node. + +``noderes.nfsdir`` can be set. If this is not set, the the default is ``/install`` + +Adding/updating software and files for the running nodes +-------------------------------------------------------- + +Make changes to the files which configured in the litefile table +```````````````````````````````````````````````````````````````` + +During the preparation or booting of node against statelite mode, there are specific processes to handle the files which configured in the litefile table. The following operations need to be done after made changes to the statelite files. + +#. Run ``liteimg`` against the osimage and reboot the node : Added, removed or changed the entries in the litefile table. + +#. Reboot the node : + + * Changed the location directory in the litetree table. + * Changed the location directory in the statelite table. + * Changed, removed the original files in the location of litetree or statelite table. + +``Note``: Thing should not do: + + * When there are node running on the nfs-based statelite osimage, do not run the packimage against this osimage. + +Make changes to the common files +```````````````````````````````` + +Because most of system files for the nodes are NFS mounted on the Management Node with read-only option, installing or updating software and files should be done to the image. The image is located under ``/install/netboot////rootimg`` directory. + +To install or update an rpm, do the following: + + * Install the rpm package into rootimg :: + + rpm --root /install/netboot////rootimg -ivh rpm_name + + * Restart the software application on the nodes :: + + xdsh + +It is recommended to follow the section (Adding third party softeware) to add the new rpm to the otherpkgs.pkglist file, so that the rpm will get installed into the new image next time the image is rebuilt. + +``Note``: The newly added rpms are not shown when running ``rpm -qa`` on the nodes although the rpm is installed. It will shown next time the node is rebooted. + +To create or update a file for the nodes, just modify the file in the image and restart any application that uses the file. + +For the ramdisk-based node, you need to reboot the node to take the changes. From 15926176cc51d22db9c1565b6441d6bde6981451 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 23 Dec 2016 03:26:48 -0500 Subject: [PATCH 057/217] remove setupntp for sles12.1 ntpd doesn't synchronize to local clock anymore in version 4.2.8p4. see#2248 --- .../testcase/installation/Full_installation_flat_p8_le | 3 ++- .../testcase/installation/reg_linux_diskfull_installation_flat | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index a058f5560..447f4a4fa 100644 --- a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -25,7 +25,8 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:chdef -t node -o $$CN postscripts=setupntp +cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles12.1" ];then chdef -t node -o $$CN postscripts=setupntp; fi +cmd:lsdef -l $$CN check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index b9c7d65bf..dfbab0873 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -33,7 +33,8 @@ check:rc==0 check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:chdef -t node -o $$CN postscripts=setupntp +cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles12.1" ];then chdef -t node -o $$CN postscripts=setupntp; fi +cmd:lsdef -l $$CN check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 From 65c29118882236ae56fdb5b1aa95dc64dae92d93 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 23 Nov 2016 16:48:07 +0800 Subject: [PATCH 058/217] Make all the rpm packages have the exactly same version and release numbers --- Release | 1 + buildcore.sh | 117 +++++++++--------- perl-xCAT/perl-xCAT.spec | 4 +- xCAT-IBMhpc/xCAT-IBMhpc.spec | 8 +- .../xCAT-OpenStack-baremetal.spec | 2 +- xCAT-OpenStack/xCAT-OpenStack.spec | 12 +- xCAT-SoftLayer/xCAT-SoftLayer.spec | 2 +- xCAT-UI/xCAT-UI.spec | 6 +- xCAT-buildkit/xCAT-buildkit.spec | 13 +- xCAT-client/xCAT-client.spec | 9 +- xCAT-confluent/xCAT-confluent.spec | 2 +- xCAT-csm/xCAT-csm.spec | 2 +- xCAT-genesis-builder/xCAT-genesis-base.spec | 4 +- .../xCAT-genesis-builder.spec | 4 +- .../xCAT-genesis-scripts.spec | 13 +- xCAT-probe/xCAT-probe.spec | 8 +- xCAT-rmc/xCAT-rmc.spec | 31 ++--- xCAT-server/xCAT-server.spec | 23 ++-- xCAT-test/xCAT-test.spec | 4 +- xCAT-vlan/xCAT-vlan.spec | 14 +-- xCAT/xCAT.spec | 24 ++-- xCATsn/xCATsn.spec | 31 ++--- 22 files changed, 145 insertions(+), 189 deletions(-) create mode 100644 Release diff --git a/Release b/Release new file mode 100644 index 000000000..a33a0ed75 --- /dev/null +++ b/Release @@ -0,0 +1 @@ +snap000000000000 diff --git a/buildcore.sh b/buildcore.sh index 0343d0376..da51c3884 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -8,7 +8,7 @@ # - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ : # apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't # conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI, -# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib. +# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib. # Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html # - Run this script from the xcat-core directory. It will create the other directories that are needed. # @@ -24,7 +24,7 @@ # (but the tarball file name will be like a released tarball, not a snap build). When you are ready to # release this build, use PROMOTE=1 without PREGA # BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release. -# UP=0 or UP=1 - override the default upload behavior +# UP=0 or UP=1 - override the default upload behavior # GITUP= - control which rpms get built by specifying a coregitup file # EMBED= - the environment for which a minimal version of xcat should be built, e.g. zvm or flex # VERBOSE=1 - to see lots of verbose output @@ -39,10 +39,10 @@ UPLOADUSER=litingt USER=xcat SERVER=xcat.org FILES_PATH="files" -FRS=/var/www/${SERVER}/${FILES_PATH} +FRS="/var/www/${SERVER}/${FILES_PATH}" RELEASE=github.com/xcat2/xcat-core/releases -YUMDIR=$FRS +YUMDIR="${FRS}" YUMREPOURL="http://${SERVER}/${FILES_PATH}/xcat/repos/yum" if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then @@ -71,8 +71,8 @@ ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn ZVMBUILD="perl-xCAT xCAT-server xCAT-UI" ZVMLINK="xCAT-client xCAT xCATsn" # xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat -# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON) -# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON) +# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON) +# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON) PCMBUILD="xCAT xCAT-server xCAT-client xCATsn" PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan xCAT-probe" # Note: for FSM, the FlexCAT rpm is built separately from gsa/git @@ -103,7 +103,7 @@ OSNAME=$(uname) if [ "$OSNAME" != "AIX" ]; then GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux - + if [ "$(id -u)" == "0" ]; then # Get a lock, so can not do 2 builds at once exec 8>/var/lock/xcatbld-$REL.lock @@ -186,10 +186,11 @@ function setversionvars { BUILD_TIME=`date` BUILD_MACHINE=`hostname` COMMIT_ID=`git rev-parse --short HEAD` + XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')" + echo "$XCAT_RELEASE" >Release } - -if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting +if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting ### @LINE460 ### # we are doing a snap build CORE="core-snap" if [ "$OSNAME" = "AIX" ]; then @@ -217,14 +218,14 @@ else #echo "source=$source" fi -# -# If no pre-defined update file is provided, do a "git pull" to try and detect +# +# If no pre-defined update file is provided, do a "git pull" to try and detect # if anything has changed in the source directories -# +# SOMETHINGCHANGED=0 if [ "$GIT" = "1" ]; then - # - # To enable local sandbox build, GITPULL is disabled by default. + # + # To enable local sandbox build, GITPULL is disabled by default. # if [ "$GITPULL" = "1" ] || [ ${PWD} == *"autobuild"* ]; then # TODO: This is really not necessary since the autobuild scripts @@ -339,7 +340,7 @@ if [ "$OSNAME" != "AIX" ]; then fi # Build the xCAT and xCATsn rpms for all platforms -for rpmname in xCAT xCATsn; do +for rpmname in xCAT xCATsn; do if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then UPLOAD=1 @@ -402,48 +403,49 @@ fi # Prepare the RPMs for pkging and upload WGET_CMD="wget" -if [ ! -z ${LOG} ]; then +if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" fi # get gpg keys in place if [ "$OSNAME" != "AIX" ]; then if [ -z "$RPMSIGN" -o "$RPMSIGN" == "1" ]; then - mkdir -p $HOME/.gnupg - for i in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then - rm -f $HOME/.gnupg/$i - ${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i - chmod 600 $HOME/.gnupg/$i + mkdir -p $HOME/.gnupg + for i in pubring.gpg secring.gpg trustdb.gpg; do + if [ ! -f $HOME/.gnupg/$i ] || + [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then + rm -f $HOME/.gnupg/$i + ${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i + chmod 600 $HOME/.gnupg/$i + fi + done + # tell rpm to use gpg to sign + MACROS=$HOME/.rpmmacros + if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then + echo '%_signature gpg' >> $MACROS fi - done - # tell rpm to use gpg to sign - MACROS=$HOME/.rpmmacros - if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then - echo '%_signature gpg' >> $MACROS + if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then + echo '%_gpg_name xCAT Security Key' >> $MACROS + fi + echo "Signing RPMs..." + build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' + build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' + createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5 + createrepo --checksum sha $SRCDIR + rm -f $SRCDIR/repodata/repomd.xml.asc + rm -f $DESTDIR/repodata/repomd.xml.asc + gpg -a --detach-sign $DESTDIR/repodata/repomd.xml + gpg -a --detach-sign $SRCDIR/repodata/repomd.xml + if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then + ${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key + fi + if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then + ${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key + fi + else + createrepo --checksum sha $DESTDIR + createrepo --checksum sha $SRCDIR fi - if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then - echo '%_gpg_name xCAT Security Key' >> $MACROS - fi - echo "Signing RPMs..." - build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' - build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' - createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5 - createrepo --checksum sha $SRCDIR - rm -f $SRCDIR/repodata/repomd.xml.asc - rm -f $DESTDIR/repodata/repomd.xml.asc - gpg -a --detach-sign $DESTDIR/repodata/repomd.xml - gpg -a --detach-sign $SRCDIR/repodata/repomd.xml - if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then - ${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key - fi - if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then - ${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key - fi - else - createrepo --checksum sha $DESTDIR - createrepo --checksum sha $SRCDIR - fi fi # set group and permissions correctly on the built rpms @@ -455,7 +457,7 @@ chmod -R g+w $DESTDIR chgrp -R $SYSGRP $SRCDIR chmod -R g+w $SRCDIR -else # end of very long if-not-promote +else # end of very long if-not-promote ### @LINE193 ### # we are only promoting (not building) setversionvars setbranch @@ -490,7 +492,7 @@ EOF #!/bin/sh cd `dirname $0` REPOFILE=`basename xCAT-*.repo` -if [[ $REPOFILE == "xCAT-*.repo" ]]; then +if [ $REPOFILE = "xCAT-*.repo" ]; then echo "ERROR: For xcat-dep, please execute $0 in the correct / subdirectory" exit 1 fi @@ -498,10 +500,10 @@ fi # default to RHEL yum, if doesn't exist try Zypper # DIRECTORY="/etc/yum.repos.d" -if [[ ! -d ${DIRECTORY} ]]; then - DIRECTORY="/etc/zypp/repos.d" +if [ ! -d "$DIRECTORY" ]; then + DIRECTORY="/etc/zypp/repos.d" fi -sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > ${DIRECTORY}/$REPOFILE +sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > "$DIRECTORY/$REPOFILE" cd - EOF2 chmod 775 mklocalrepo.sh @@ -521,6 +523,7 @@ fi # BUILDINFO=$XCATCORE/buildinfo echo "VERSION=$VER" > $BUILDINFO +echo "RELEASE=$XCAT_RELEASE" >> $BUILDINFO echo "BUILD_TIME=$BUILD_TIME" >> $BUILDINFO echo "BUILD_MACHINE=$BUILD_MACHINE" >> $BUILDINFO echo "COMMIT_ID=$COMMIT_ID" >> $BUILDINFO @@ -545,7 +548,7 @@ if [ -n "$UP" ] && [ "$UP" == 0 ]; then fi #else we will continue -# Upload the individual RPMs to xcat.org +# Upload the individual RPMs to xcat.org if [ "$OSNAME" = "AIX" ]; then YUM=aix else @@ -561,13 +564,13 @@ if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then do : ; done fi -# Upload the individual source RPMs to xcat.org +# Upload the individual source RPMs to xcat.org i=0 echo "Uploading src RPMs from $SRCD to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..." while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $USER@$SERVER:$YUMDIR/$YUM/$REL$EMBEDDIR/ do : ; done -# Upload the tarball to xcat.org +# Upload the tarball to xcat.org if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then # upload tarball to FRS area i=0 diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec index b1bb44274..86c15f41a 100644 --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -1,7 +1,7 @@ Summary: xCAT perl libraries Name: perl-xCAT Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: System Environment/Libraries @@ -17,8 +17,6 @@ BuildArch: noarch #Requires: perl-SOAP-Lite %endif -Provides: perl-xCAT = %{epoch}:%{version} - %description Provides perl xCAT libraries for core functionality. Required for all xCAT installations. Includes xCAT::Table, xCAT::NodeRange, among others. diff --git a/xCAT-IBMhpc/xCAT-IBMhpc.spec b/xCAT-IBMhpc/xCAT-IBMhpc.spec index 32ed7f3d8..52bddba3e 100644 --- a/xCAT-IBMhpc/xCAT-IBMhpc.spec +++ b/xCAT-IBMhpc/xCAT-IBMhpc.spec @@ -1,7 +1,7 @@ Summary: Install and configuration utilities for IBM HPC products in an xCAT cluster Name: xCAT-IBMhpc Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -20,7 +20,7 @@ AutoReqProv: no # also need to fix Requires for AIX %ifos linux BuildArch: noarch -#Requires: +#Requires: %endif Requires: perl-xCAT >= %{epoch}:%{version} @@ -85,7 +85,3 @@ fi %post %preun - - - - diff --git a/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec b/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec index c82d9b36e..ff45e5bd6 100644 --- a/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec +++ b/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec @@ -1,7 +1,7 @@ Summary: Executables and data of the xCAT baremetal driver for OpenStack Name: xCAT-OpenStack-baremetal Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: IBM Group: Applications/System diff --git a/xCAT-OpenStack/xCAT-OpenStack.spec b/xCAT-OpenStack/xCAT-OpenStack.spec index b1fae31be..a502b20d5 100644 --- a/xCAT-OpenStack/xCAT-OpenStack.spec +++ b/xCAT-OpenStack/xCAT-OpenStack.spec @@ -1,7 +1,7 @@ -Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack +Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack Name: xCAT-OpenStack Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} License: EPL Group: Applications/System Vendor: IBM Corp. @@ -16,8 +16,8 @@ Provides: xCAT-OpenStack = %{version} Requires: xCAT %description -xCAT-OpenStack is an xCAT management node package intended for at-scale -management with OpenStack, including hardware management and software +xCAT-OpenStack is an xCAT management node package intended for at-scale +management with OpenStack, including hardware management and software management. %prep @@ -28,7 +28,6 @@ management. # Then convert the pods to man pages and html pages. ./db2man - %install mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin @@ -89,9 +88,8 @@ rm -rf $RPM_BUILD_ROOT %ifos linux if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then - /etc/init.d/xcatd restart + /etc/init.d/xcatd restart fi fi %endif exit 0 - diff --git a/xCAT-SoftLayer/xCAT-SoftLayer.spec b/xCAT-SoftLayer/xCAT-SoftLayer.spec index 7166d1e9d..683b98ea8 100644 --- a/xCAT-SoftLayer/xCAT-SoftLayer.spec +++ b/xCAT-SoftLayer/xCAT-SoftLayer.spec @@ -1,7 +1,7 @@ Summary: Utilities to make xCAT work in a SoftLayer environment Name: xCAT-SoftLayer Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System diff --git a/xCAT-UI/xCAT-UI.spec b/xCAT-UI/xCAT-UI.spec index 0881b8f8a..15b714315 100644 --- a/xCAT-UI/xCAT-UI.spec +++ b/xCAT-UI/xCAT-UI.spec @@ -1,12 +1,12 @@ Summary: Web Client for xCAT 2 Name: xCAT-UI Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} License: EPL Group: Applications/System -URL: http://xcat.org +URL: https://xcat.org/ Packager: IBM -Vendor: IBM +Vendor: IBM Corp. Source: xCAT-UI-%{version}.tar.gz BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root diff --git a/xCAT-buildkit/xCAT-buildkit.spec b/xCAT-buildkit/xCAT-buildkit.spec index 6809507c7..0d91f6d07 100644 --- a/xCAT-buildkit/xCAT-buildkit.spec +++ b/xCAT-buildkit/xCAT-buildkit.spec @@ -1,7 +1,7 @@ Summary: xCAT buildkit tools and sample kit Name: xCAT-buildkit Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -20,15 +20,13 @@ AutoReqProv: no # also need to fix Requires for AIX %ifos linux BuildArch: noarch -#Requires: +#Requires: %endif # No dependencies on any other xCAT rpms # so that this rpm can be installed in a separate build server Requires: /usr/bin/rpmbuild -Provides: xCAT-buildkit = %{epoch}:%{version} - %description xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit. @@ -41,8 +39,6 @@ mkdir -p share/doc/man1 pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1 pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html - - %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits @@ -57,7 +53,6 @@ chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/* cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/* - %ifos linux cp -aR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/ #chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/* @@ -110,7 +105,3 @@ fi %post %preun - - - - diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index d44961f2a..44235d213 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -1,7 +1,7 @@ Summary: Core executables and data of the xCAT management project Name: xCAT-client Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -21,15 +21,13 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif -Provides: xCAT-client = %{epoch}:%{version} - -Requires: perl-xCAT >= %{epoch}:%{version} +Requires: perl-xCAT = 4:%{version}-%{release} # fping or nmap is needed by pping (in case xCAT-client is installed by itself on a remote client) %ifos linux Requires: nmap perl-XML-Simple perl-XML-Parser %else -Requires: expat +Requires: expat %endif %description @@ -355,4 +353,3 @@ if [ $1 == 0 ]; then #This means only on -e rm -f /etc/profile.d/xcat.* fi %endif - diff --git a/xCAT-confluent/xCAT-confluent.spec b/xCAT-confluent/xCAT-confluent.spec index 44111fb73..8b3dc9e1f 100644 --- a/xCAT-confluent/xCAT-confluent.spec +++ b/xCAT-confluent/xCAT-confluent.spec @@ -1,7 +1,7 @@ Summary: xCAT integration with confluent systems management server Name: xCAT-confluent Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System diff --git a/xCAT-csm/xCAT-csm.spec b/xCAT-csm/xCAT-csm.spec index e0d993026..b173e3043 100644 --- a/xCAT-csm/xCAT-csm.spec +++ b/xCAT-csm/xCAT-csm.spec @@ -1,7 +1,7 @@ Summary: Packages for installation of CSM nodes Name: xCAT-csm Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: IBM Group: Applications/System diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 989980591..d891671bd 100755 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -1,6 +1,6 @@ %define version %%REPLACE_CURRENT_VERSION%% Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} %ifarch i386 i586 i686 x86 %define tarch x86 %endif @@ -27,7 +27,7 @@ Group: System/Utilities License: Various (see individual packages for details) Vendor: IBM Corp. Summary: xCAT Genesis netboot image -URL: http://xcat.org +URL: https://xcat.org/ Source1: xCAT-genesis-base-%{tarch}.tar.bz2 Buildroot: %{_localstatedir}/tmp/xCAT-genesis diff --git a/xCAT-genesis-builder/xCAT-genesis-builder.spec b/xCAT-genesis-builder/xCAT-genesis-builder.spec index 91d301d44..4f85cde25 100644 --- a/xCAT-genesis-builder/xCAT-genesis-builder.spec +++ b/xCAT-genesis-builder/xCAT-genesis-builder.spec @@ -1,7 +1,7 @@ BuildArch: noarch %define name xCAT-genesis-builder Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 1 AutoReq: false Requires: ipmitool screen btrfs-progs lldpad rpm-build compat-libstdc++-33 mstflint xfsprogs nc reiserfs-utils @@ -15,7 +15,7 @@ Group: System/Utilities License: EPL Vendor: IBM Corp. Summary: Tooling to create xCAT's discovery/maintenance/debugging environment -URL: http://xcat.org +URL: https://xcat.org/ Source1: xCAT-genesis-builder.tar.bz2 Buildroot: %{_localstatedir}/tmp/xCAT-genesis-builder diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index 2dcd33925..e0e7c7f0e 100755 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -13,8 +13,8 @@ BuildArch: noarch %define __spec_install_post : %define debug_package %{nil} %define __prelink_undo_cmd %{nil} -Version: %{?version:%{version}}%{!?version:%{version}} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Version: %{?version:%{version}}%{!?version:%(cat Version)} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 1 AutoReq: false Prefix: /opt/xcat @@ -22,14 +22,12 @@ AutoProv: false Obsoletes: xCAT-genesis-%{tarch} Provides: xCAT-genesis-%{tarch} - - Name: %{name} Group: System/Utilities License: EPL Vendor: IBM Corp Summary: xCAT Genesis netboot image - Core content -URL: http://xcat.org +URL: https://xcat.org/ Source1: xCAT-genesis-scripts.tar.bz2 Requires: xCAT-genesis-base-%{tarch} >= 2:2.13.0 @@ -41,7 +39,6 @@ xCAT genesis (Genesis Enhanced Netboot Environment for System Information and Se This package reperesents the EPL content that is more tightly bound to specific xcat-core versions %Prep - %Build %Install @@ -55,7 +52,6 @@ rm opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/*.spec rm opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/LICENSE.html cd - - # Since this rpm is being installed/updated, we need to run mknb to combine it with # xCAT-genesis-base-x86_64, but mknb will not work during an initial install of xcat # until the xCAT meta pkg has run xcatconfig or xCATsn has started xcatd. Use of a trigger @@ -72,7 +68,6 @@ echo "If you are installing/updating xCAT-genesis-base separately, not as part o mkdir -p /etc/xcat touch /etc/xcat/genesis-scripts-updated - %Files %defattr(-,root,root) #%dir %attr(-,root,root) %{rpminstallroot} @@ -103,5 +98,5 @@ touch /etc/xcat/genesis-scripts-updated %{rpminstallroot}/etc/udev/rules.d/99-imm.rules %{rpminstallroot}/etc/udev/rules.d/98-mlx.rules %{rpminstallroot}/sbin/setupimmnic -%{rpminstallroot}/sbin/loadmlxeth +%{rpminstallroot}/sbin/loadmlxeth %exclude %{rpminstallroot}/debian/* diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index 26e5d5404..8a1fda11b 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -1,7 +1,7 @@ -Summary: xCAT diagnostic tool +Summary: xCAT diagnostic tool Name: xCAT-probe Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -17,14 +17,12 @@ BuildArch: noarch %endif %ifos linux -#Below tools are required by sub-command 'xcatmn' +#Below tools are required by sub-command 'xcatmn' Requires: /usr/bin/nslookup Requires: /usr/bin/tftp Requires: /usr/bin/wget %endif -Provides: xCAT-probe = %{version} - %description xCAT-probe provides a toolkits to probe potential issues with the xCAT cluster. diff --git a/xCAT-rmc/xCAT-rmc.spec b/xCAT-rmc/xCAT-rmc.spec index 56f57d6fd..235d0d2da 100644 --- a/xCAT-rmc/xCAT-rmc.spec +++ b/xCAT-rmc/xCAT-rmc.spec @@ -1,7 +1,7 @@ Summary: RMC monitoring plug-in for xCAT Name: xCAT-rmc Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: System Environment/Libraries @@ -15,10 +15,8 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif -Requires: perl-xCAT >= %{epoch}:%{version} -Requires: xCAT-server >= %{epoch}:%{version} - -Provides: xCAT-rmc = %{version} +Requires: perl-xCAT = 4:%{version}-%{release} +Requires: xCAT-server = 4:%{version}-%{release} %description Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors. @@ -42,7 +40,6 @@ chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon/* cp lib/perl/TEAL/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL - %clean rm -rf $RPM_BUILD_ROOT @@ -82,7 +79,7 @@ else needCopyFiles=1; fi fi - + if [ $needCopyFiles -eq 1 ]; then echo "Copying files to /install/postscripts directory..." mkdir -p /install/postscripts @@ -90,23 +87,23 @@ if [ $needCopyFiles -eq 1 ]; then mkdir -p /install/postscripts/rmcmon/scripts cp $RPM_INSTALL_PREFIX0/sbin/rmcmon/configrmcnode /install/postscripts chmod 755 /install/postscripts/configrmcnode - - FILES_TO_COPY=`cat $RPM_INSTALL_PREFIX0/sbin/rmcmon/scripts_to_node|tr '\n' ' '` + + FILES_TO_COPY=`cat $RPM_INSTALL_PREFIX0/sbin/rmcmon/scripts_to_node|tr '\n' ' '` for file in $FILES_TO_COPY do #echo "file=$file" cp $RPM_INSTALL_PREFIX0/sbin/rmcmon/$file /install/postscripts/rmcmon/scripts done chmod 755 /install/postscripts/rmcmon/scripts/* - + cp -r $RPM_INSTALL_PREFIX0/lib/perl/xCAT_monitoring/rmc/resources/node/* /install/postscripts/rmcmon/resources/node -fi - +fi + %ifos linux if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then - /etc/init.d/xcatd restart + /etc/init.d/xcatd restart fi fi %else @@ -117,13 +114,7 @@ fi echo "Do not restartxcatd in not running system" else XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r - fi + fi fi %endif exit 0 - - - - - - diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index a3670db9d..f4fb5acb9 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -1,7 +1,7 @@ Summary: Server and configuration utilities of the xCAT management project Name: xCAT-server Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -47,11 +47,8 @@ Requires: perl-IO-Tty perl-Crypt-SSLeay make %endif %endif - -Requires: perl-xCAT >= %{epoch}:%{version} -Requires: xCAT-client >= %{epoch}:%{version} - -Provides: xCAT-server = %{epoch}:%{version} +Requires: perl-xCAT = 4:%{version}-%{release} +Requires: xCAT-client = 4:%{version}-%{release} %description xCAT-server provides the core server and configuration management components of xCAT. This package should be installed on your management server @@ -349,8 +346,8 @@ echo "ScriptAlias /xcatws %{prefix}/ws/xcatws.cgi" >> $RPM_BUILD_ROOT/etc/xcat/c cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache22 >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache24 >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache24 #install lower version(<2.4) apache/httpd conf files by default -cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf -cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf +cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf +cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf %endif @@ -401,7 +398,7 @@ fi %endif # The Juniper directory is switched to Jun and a sylink is created -if [ -d $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper ]; then +if [ -d $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper ]; then # need to remove the old directory otherwise the symlink won't get creatd correctly rm -rf $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper fi @@ -428,17 +425,16 @@ fi %else if [ "$1" -gt "1" ]; then #only on upgrade for AIX... #migration issue for monitoring - XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab filename=monitorctrl.pm notification -d + XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab filename=monitorctrl.pm notification -d -fi +fi %endif - #Apply the correct httpd/apache configuration file according to the httpd/apache version if [ -n "$(httpd -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] then rm -rf /etc/httpd/conf.d/xcat-ws.conf - cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/httpd/conf.d/xcat-ws.conf + cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/httpd/conf.d/xcat-ws.conf fi if [ -n "$(apachectl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] @@ -453,7 +449,6 @@ then cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/apache2/conf.d/xcat-ws.conf fi - exit 0 %preun diff --git a/xCAT-test/xCAT-test.spec b/xCAT-test/xCAT-test.spec index f5aca2460..6906896da 100644 --- a/xCAT-test/xCAT-test.spec +++ b/xCAT-test/xCAT-test.spec @@ -1,7 +1,7 @@ Summary: xCAT automated test tool Name: xCAT-test Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -17,8 +17,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif -Provides: xCAT-test = %{version} - %description Provides automated test tool and buckets to help test xCAT commands automatically. diff --git a/xCAT-vlan/xCAT-vlan.spec b/xCAT-vlan/xCAT-vlan.spec index 6e46f2ebe..487dbcb12 100755 --- a/xCAT-vlan/xCAT-vlan.spec +++ b/xCAT-vlan/xCAT-vlan.spec @@ -1,7 +1,7 @@ Summary: Executables and data of the xCAT vlan management project Name: xCAT-vlan Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: IBM Group: Applications/System @@ -16,11 +16,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif - -Provides: xCAT-vlan = %{epoch}:%{version} - - -Requires: xCAT-client +Requires: xCAT-client = 4:%{version}-%{release} %description xCAT-vlan provides the xCAT vlan confiuration. @@ -45,14 +41,12 @@ mkdir -p $RPM_BUILD_ROOT/install/postscripts mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1 mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 - set +x cp xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT cp -R xCAT_plugin/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin cp install/postscripts/* $RPM_BUILD_ROOT/install/postscripts - # These were built dynamically in the build phase cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1 chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/* @@ -68,7 +62,6 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmvlan ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsvlan ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chvlanports - %clean # This step does not happen until *after* the %files packaging below rm -rf $RPM_BUILD_ROOT @@ -80,7 +73,6 @@ rm -rf $RPM_BUILD_ROOT %{prefix} /install/postscripts - %changelog %post @@ -104,5 +96,3 @@ rm -rf $RPM_BUILD_ROOT exit 0 %preun - - diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index d1d935e3f..7944f6108 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -1,9 +1,10 @@ Summary: Meta-package for a common, default xCAT setup Name: xCAT Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} License: EPL Group: Applications/System +URL: https://xcat.org/ Vendor: IBM Corp. Packager: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} @@ -13,7 +14,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root Source1: xcat.conf Source2: postscripts.tar.gz Source3: templates.tar.gz -Source5: xCATMN +Source5: xCATMN %ifos linux Source4: prescripts.tar.gz @@ -25,7 +26,12 @@ Source7: xcat.conf.apach24 Provides: xCAT = %{version} Conflicts: xCATsn -Requires: xCAT-server xCAT-client perl-DBD-SQLite xCAT-probe >= 2.12.1 xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 +Requires: perl-DBD-SQLite +Requires: xCAT-client = 4:%{version}-%{release} +Requires: xCAT-server = 4:%{version}-%{release} +Requires: xCAT-probe = 4:%{version}-%{release} +Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} +Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} %define pcm %(if [ "$pcm" = "1" ];then echo 1; else echo 0; fi) %define notpcm %(if [ "$pcm" = "1" ];then echo 0; else echo 1; fi) @@ -34,7 +40,7 @@ Requires: xCAT-server xCAT-client perl-DBD-SQLite xCAT-probe >= 2.12.1 xCAT-gene Requires: httpd nfs-utils nmap bind perl(CGI) # on RHEL7, need to specify it explicitly Requires: net-tools -Requires: /usr/bin/killall +Requires: /usr/bin/killall # On RHEL this pulls in dhcp, on SLES it pulls in dhcp-server Requires: /usr/sbin/dhcpd # On RHEL this pulls in openssh-server, on SLES it pulls in openssh @@ -101,7 +107,7 @@ tar -xf postscripts.tar # this is now handled by requiring /usr/sbin/dhcpd #if [ -e "/etc/SuSE-release" ]; then # In SuSE, dhcp-server provides the dhcp server, which is different from the RedHat. - # When building the package, we cannot add "dhcp-server" into the "Requires", because RedHat doesn't + # When building the package, we cannot add "dhcp-server" into the "Requires", because RedHat doesn't # have such one package. # so there's only one solution, Yes, it looks ugly. #rpm -q dhcp-server >/dev/null @@ -190,13 +196,13 @@ then fi if [ -n "$(apachectl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] -then +then rm -rf /etc/apache2/conf.d/xcat.conf cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf fi if [ -n "$(apache2ctl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] -then +then rm -rf /etc/apache2/conf.d/xcat.conf cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf fi @@ -237,7 +243,6 @@ exit 0 %clean - %files %{prefix} # one for sles, one for rhel. yes, it's ugly... @@ -259,10 +264,8 @@ exit 0 %postun - if [ "$1" = "0" ]; then - %ifnos linux if grep "^xcatd" /etc/inittab >/dev/null then @@ -271,4 +274,3 @@ fi %endif true # so on aix we do not end up with an empty if stmt fi - diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index ed793aee6..db20b979f 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -1,7 +1,7 @@ Summary: Metapackage for a common, default xCAT service node setup Name: xCATsn Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Release: %{?release:%{release}}%{!?release:%(cat Release)} Epoch: 4 License: EPL Group: Applications/System @@ -13,11 +13,15 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root #BuildArch: noarch Source1: xcat.conf Source2: license.tar.gz -Source3: xCATSN +Source3: xCATSN Source5: templates.tar.gz Source6: xcat.conf.apach24 -Provides: xCATsn = %{version} -Requires: xCAT-server xCAT-client perl-DBD-SQLite xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-probe >= 2.12.2 +Requires: perl-DBD-SQLite +Requires: xCAT-client = 4:%{version}-%{release} +Requires: xCAT-server = 4:%{version}-%{release} +Requires: xCAT-probe = 4:%{version}-%{release} +Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} +Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} Conflicts: xCAT @@ -38,7 +42,7 @@ Requires: /usr/bin/ssh %ifnarch s390x Requires: /etc/xinetd.d/tftp # yaboot-xcat is pulled in so any MN can manage ppc nodes -#Requires: yaboot-xcat +#Requires: yaboot-xcat # Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty %endif @@ -74,7 +78,7 @@ Requires: syslinux-xcat %description xCATsn is a service node management package intended for at-scale management, -including hardware management and software management. +including hardware management and software management. %prep @@ -181,9 +185,9 @@ if [ "$1" = "1" ]; then #Only if installing for the first time.. # setup sqlite if no other database -%ifos linux -if [ -f "/proc/cmdline" ]; then #check to make sure this is not image install - if [ ! -s /etc/xcat/cfgloc ]; then # database is sqlite +%ifos linux +if [ -f "/proc/cmdline" ]; then #check to make sure this is not image install + if [ ! -s /etc/xcat/cfgloc ]; then # database is sqlite $RPM_INSTALL_PREFIX0/sbin/xcatconfig -d fi fi @@ -207,16 +211,16 @@ else # SuSE fi # start xcatd on linux [ -e "/etc/init.d/$apachedaemon" ] && chkconfig $apachedaemon on -[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl enable $apacheserviceunit +[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl enable $apacheserviceunit if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image XCATROOT=$RPM_INSTALL_PREFIX0 /etc/init.d/xcatd restart - [ -e "/etc/init.d/$apachedaemon" ] && /etc/init.d/$apachedaemon reload - [ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl reload $apacheserviceunit + [ -e "/etc/init.d/$apachedaemon" ] && /etc/init.d/$apachedaemon reload + [ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl reload $apacheserviceunit fi echo "xCATsn is now installed" %else # start xcatd on AIX - XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd + XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd echo "xCATsn is now installed" %endif @@ -237,7 +241,6 @@ if [ -f "/proc/cmdline" -a -f "/etc/xcat/genesis-scripts-updated" ]; then fi %endif - %clean %files From 327db76f9e49b3bb0136b19f94e2e20815489868 Mon Sep 17 00:00:00 2001 From: neo954 Date: Wed, 23 Nov 2016 00:36:08 -0600 Subject: [PATCH 059/217] Make all the deb packages have the exactly same version and release numbers --- build-ubunturepo | 64 ++++++++++++--------- perl-xCAT/debian/compat | 2 +- perl-xCAT/debian/control | 7 ++- perl-xCAT/debian/rules | 6 +- xCAT-IBMhpc/debian/compat | 2 +- xCAT-IBMhpc/debian/control | 14 ++--- xCAT-IBMhpc/debian/rules | 6 +- xCAT-OpenStack-baremetal/debian/compat | 2 +- xCAT-OpenStack-baremetal/debian/control | 8 +-- xCAT-OpenStack/debian/compat | 2 +- xCAT-OpenStack/debian/control | 12 ++-- xCAT-UI/debian/compat | 2 +- xCAT-UI/debian/control | 11 ++-- xCAT-UI/debian/rules | 5 +- xCAT-buildkit/debian/compat | 2 +- xCAT-buildkit/debian/control | 8 +-- xCAT-buildkit/debian/rules | 4 -- xCAT-client/debian/compat | 2 +- xCAT-client/debian/control | 12 ++-- xCAT-client/debian/rules | 6 +- xCAT-genesis-builder/debian/compat | 2 +- xCAT-genesis-builder/debian/control | 8 +-- xCAT-genesis-scripts/debian/compat | 2 +- xCAT-genesis-scripts/debian/control-amd64 | 19 +++--- xCAT-genesis-scripts/debian/control-ppc64el | 13 +++-- xCAT-probe/debian/compat | 2 +- xCAT-probe/debian/control | 6 +- xCAT-probe/debian/rules | 6 +- xCAT-rmc/debian/compat | 2 +- xCAT-rmc/debian/control | 6 +- xCAT-rmc/debian/rules | 6 +- xCAT-server/debian/compat | 2 +- xCAT-server/debian/control | 14 +++-- xCAT-server/debian/install | 1 - xCAT-server/debian/rules | 3 +- xCAT-test/debian/compat | 2 +- xCAT-test/debian/control | 9 ++- xCAT-test/debian/rules | 6 +- xCAT-vlan/debian/compat | 2 +- xCAT-vlan/debian/control | 9 ++- xCAT-vlan/debian/rules | 2 + xCAT/debian/compat | 2 +- xCAT/debian/control | 28 +++++++-- xCAT/debian/rules | 6 +- xCATsn/debian/compat | 2 +- xCATsn/debian/control | 13 +++-- xCATsn/debian/rules | 6 +- 47 files changed, 181 insertions(+), 175 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index b4220b4a6..8379d8201 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -4,7 +4,7 @@ # Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com) # Revisor: Arif Ali (aali@ocf.co.uk) # -# +# # Getting Started: # - Clone the xcat-core git repository int a directory called /src/xcat-core, where # is the same name as the release dir it is uploaded to xcat.org (e.g devel, 2.9, 2.10) @@ -15,21 +15,21 @@ # PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not # actually build xcat, just uploads the most recent snap build to http://xcat.org/files/xcat/ . # If not specified, a snap build is assumed, which uploads to https://xcat.org/files/xcat/ -# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this -# build is a GA candidate build, not to be released yet. This will result in the tarball +# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this +# build is a GA candidate build, not to be released yet. This will result in the tarball # being uploaded to http://xcat.org/files/xcat/repos/apt -# (but the tarball file name will be like a released tarball, not a snap build). +# (but the tarball file name will be like a released tarball, not a snap build). # When you are ready to release this build, use PROMOTE=1 without PREGA -# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in +# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in # prep for a release. # UP=0 or UP=1 - override the default upload behavior # LOG= - provide an LOG file option to redirect some output into log file # -# For the dependency packages 1. All the xcat dependency deb packages should be uploaded to +# For the dependency packages 1. All the xcat dependency deb packages should be uploaded to # "pokgsa/projects/x/xcat/build/ubuntu/xcat-dep/debs/" on GSA # 2. run ./build-ubunturepo -d # -# 3. the built xcat-dep deb packages tarball can be found in "../../xcat-dep" +# 3. the built xcat-dep deb packages tarball can be found in "../../xcat-dep" # related to the path of this script ############################ printusage() @@ -39,10 +39,10 @@ printusage() echo " -d : Create the xcat-dep repo." } # For the purpose of getting the distribution name -if [[ ! -f /etc/lsb-release ]]; then +if [[ ! -f /etc/lsb-release ]]; then echo "ERROR: Could not find /etc/lsb-release, is this script executed on a Ubuntu machine?" exit 1 -fi +fi . /etc/lsb-release # Check the necessary packages before starting the build @@ -84,7 +84,7 @@ do r) r_flag=1 genesis_rpm_path="$OPTARG" ;; - ?) printusage + ?) printusage exit 2 ;; esac @@ -129,7 +129,7 @@ fi export HOME=/root WGET_CMD="wget" -if [ ! -z ${LOG} ]; then +if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" fi @@ -211,13 +211,13 @@ then build_string="Snap_Build" cur_date=`date +%Y%m%d%H%M` pkg_version="${ver}-${pkg_type}${cur_date}" - + if [ ! -d ../../$package_dir_name ];then mkdir -p "../../$package_dir_name" fi packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit xCAT-vlan xCAT-confluent xCAT-probe" target_archs=(amd64 ppc64el) - for file in `echo $packages` + for file in $packages do file_low=`echo $file | tr '[A-Z]' '[a-z]'` if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" ]; then @@ -225,7 +225,7 @@ then else target_archs="all" fi - for target_arch in `echo $target_archs` + for target_arch in $target_archs do if grep -q $file $update_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then rm -f ../../$package_dir_name/${file_low}_*.$target_arch.deb @@ -245,18 +245,28 @@ then cp -f ${CURDIR}/../perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/lib/perl/xCAT/ cp -f ${CURDIR}/../perl-xCAT/xCAT/ServiceNodeUtils.pm ${CURDIR}/lib/perl/xCAT/ fi - dpkg-buildpackage -uc -us + CURDIR=$(pwd) + cp ${CURDIR}/debian/control ${CURDIR}/debian/control.save.998 + # Magic string used here + sed -i -e "s#>= 2.13-snap000000000000#= ${pkg_version}#g" ${CURDIR}/debian/control + dpkg-buildpackage -rfakeroot -uc -us + mv ${CURDIR}/debian/control.save.998 ${CURDIR}/debian/control else if [ "$file" = "xCAT-genesis-scripts" ]; then CURDIR=$(pwd) - echo "Rename control file to build pkg: mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control" - mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control + echo "Rename control file to build pkg: cp ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control" + cp ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control fi - dpkg-buildpackage -uc -us -a$target_arch + CURDIR=$(pwd) + cp ${CURDIR}/debian/control ${CURDIR}/debian/control.save.998 + # Magic string used here + sed -i -e "s#>= 2.13-snap000000000000#= ${pkg_version}#g" ${CURDIR}/debian/control + dpkg-buildpackage -rfakeroot -uc -us -a$target_arch + mv ${CURDIR}/debian/control.save.998 ${CURDIR}/debian/control if [ "$file" = "xCAT-genesis-scripts" ]; then CURDIR=$(pwd) echo "Move control file back: mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}" - mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch} + rm ${CURDIR}/debian/control fi fi rc=$? @@ -317,7 +327,7 @@ Label: xcat-core bazaar repository Codename: $dist Architectures: $tmp_out_arch Components: main -Description: Repository automatically genereted conf +Description: Repository automatically genereted conf SignWith: yes __EOF__ @@ -357,12 +367,12 @@ __EOF__ chmod 775 mklocalrepo.sh - #create the xcat-core.list file + #create the xcat-core.list file cd ../ if ! grep xcat /etc/group ; then groupadd xcat - fi + fi chgrp -R root xcat-core chmod -R g+w xcat-core @@ -388,7 +398,7 @@ then #the path of ubuntu xcat-dep deb packages on GSA GSA="/gsa/pokgsa/projects/x/xcat/build/ubuntu/xcat-dep" - + if [ ! -d $GSA ]; then echo "build-ubunturepo: It appears that you do not have gsa installed to access the xcat-dep pkgs." exit 1; @@ -400,10 +410,10 @@ then echo "Syncing RPMs from $GSA/ to $local_dep_repo_path/../ ..." rsync -ilrtpu --delete $GSA/ $local_dep_repo_path/../ - if [ $? -ne 0 ]; then + if [ $? -ne 0 ]; then echo "Error from rsync, cannot continue!" exit 1 - fi + fi #clean all old files if [ -e $local_dep_repo_path ];then @@ -427,7 +437,7 @@ Label: xcat-dep bazaar repository Codename: $dist Architectures: $tmp_out_arch Components: main -Description: Repository automatically genereted conf +Description: Repository automatically genereted conf SignWith: yes __EOF__ @@ -482,7 +492,7 @@ __EOF__ chmod g+w $dep_tar_name # Decide whether to upload or not (default NOT to upload) - if [ "$UP" != "1" ]; then + if [ "$UP" != "1" ]; then echo "Upload not specified, Done! (rerun with UP=1, to upload)" cd $old_pwd exit 0 diff --git a/perl-xCAT/debian/compat b/perl-xCAT/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/perl-xCAT/debian/compat +++ b/perl-xCAT/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/perl-xCAT/debian/control b/perl-xCAT/debian/control index 5222978b0..cd7877d24 100644 --- a/perl-xCAT/debian/control +++ b/perl-xCAT/debian/control @@ -2,12 +2,13 @@ Source: perl-xcat Section: libs Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5), libsoap-lite-perl, libdbi-perl -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9), libsoap-lite-perl, libdbi-perl +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: perl-xcat Architecture: all -Depends: ${perl:Depends} +Depends: ${perl:Depends} Description: xCAT perl libraries Provides perl xCAT libraries for core functionality. Required for all xCAT installations. Includes xCAT::Table, xCAT::NodeRange, among others. diff --git a/perl-xCAT/debian/rules b/perl-xCAT/debian/rules index e5a0aa6fd..763812bba 100755 --- a/perl-xCAT/debian/rules +++ b/perl-xCAT/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: dh_testdir ./db2man @@ -27,7 +24,6 @@ install: dh_installdirs dh_install -X".svn" - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -36,7 +32,7 @@ binary-indep: build install binary-arch: build install dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-IBMhpc/debian/compat b/xCAT-IBMhpc/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-IBMhpc/debian/compat +++ b/xCAT-IBMhpc/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-IBMhpc/debian/control b/xCAT-IBMhpc/debian/control index 38a06c9af..2bdffb1be 100644 --- a/xCAT-IBMhpc/debian/control +++ b/xCAT-IBMhpc/debian/control @@ -2,14 +2,14 @@ Source: xcat-ibmhpc Section: admin Priority: extra Maintainer: Arif Ali -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-ibmhpc Architecture: all -Depends: ${perl:Depends}, perl-xcat (>= 2.8.0), xcat-client (>= 2.8.0) -Description: Install and configuration utilities for IBM HPC products in an xCAT cluster - xCAT-IBMhpc provides sample installation and configuration scripts for running - the IBM HPC software stack in an xCAT cluser. Support for the following IBM - products is provided: GPFS, LoadLeveler, Parallel Environment, ESSL and Parallel +Depends: ${perl:Depends}, perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000) +Description: Utilities for manage IBM HPC products in an xCAT cluster + xCAT-IBMhpc provides sample installation and configuration scripts for running + the IBM HPC software stack in an xCAT cluser. Support for the following IBM + products is provided: GPFS, LoadLeveler, Parallel Environment, ESSL and Parallel ESSL libraries, some compilers (vac, xlC, xlf). diff --git a/xCAT-IBMhpc/debian/rules b/xCAT-IBMhpc/debian/rules index 659821bd5..1bd639730 100755 --- a/xCAT-IBMhpc/debian/rules +++ b/xCAT-IBMhpc/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd dh_quilt_patch @@ -29,7 +26,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -39,7 +35,7 @@ binary-arch: pwd dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-OpenStack-baremetal/debian/compat b/xCAT-OpenStack-baremetal/debian/compat index 45a4fb75d..ec635144f 100644 --- a/xCAT-OpenStack-baremetal/debian/compat +++ b/xCAT-OpenStack-baremetal/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-OpenStack-baremetal/debian/control b/xCAT-OpenStack-baremetal/debian/control index 61ad678eb..b62fc34bb 100644 --- a/xCAT-OpenStack-baremetal/debian/control +++ b/xCAT-OpenStack-baremetal/debian/control @@ -2,13 +2,11 @@ Source: xcat-openstack-baremetal Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 8.0.0) +Build-Depends: debhelper (>= 9) Standards-Version: 3.9.4 -Homepage: http://xcat.org -#Vcs-Git: git://git.debian.org/collab-maint/xcat-openstack-baremetal.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-openstack-baremetal.git;a=summary +Homepage: https://xcat.org/ Package: xcat-openstack-baremetal Architecture: all Depends: xcat-client -Description: Executables and data of the xCAT baremetal driver for OpenStack +Description: Executables and data of xCAT baremetal driver for OpenStack diff --git a/xCAT-OpenStack/debian/compat b/xCAT-OpenStack/debian/compat index 45a4fb75d..ec635144f 100644 --- a/xCAT-OpenStack/debian/compat +++ b/xCAT-OpenStack/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-OpenStack/debian/control b/xCAT-OpenStack/debian/control index 04cff6ab9..9f6ac5661 100644 --- a/xCAT-OpenStack/debian/control +++ b/xCAT-OpenStack/debian/control @@ -2,13 +2,13 @@ Source: xcat-openstack Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 8.0.0) -Standards-Version: 3.9.2 -#Vcs-Git: git://git.debian.org/collab-maint/xcat-openstack.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-openstack.git;a=summary +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-openstack Architecture: all Depends: xcat -Description: Meta-Metapackage for a common, default xCAT management node setup with OpenStack - xCAT-OpenStack is an xCAT management node package intended for at-scale management with OpenStack, including hardware management and software management. +Description: Metapackage for a xCAT management node setup with OpenStack + xCAT-OpenStack is an xCAT management node package intended for at-scale + management with OpenStack, including hardware management and software + management. diff --git a/xCAT-UI/debian/compat b/xCAT-UI/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-UI/debian/compat +++ b/xCAT-UI/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-UI/debian/control b/xCAT-UI/debian/control index 4e91971ef..f9fe95278 100644 --- a/xCAT-UI/debian/control +++ b/xCAT-UI/debian/control @@ -2,11 +2,12 @@ Source: xcat-ui Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-ui Architecture: all -Depends: ${perl:Depends}, python (>= 2.3), apache2, libapache2-mod-php5 -Description: Provides a browser-based interface for xCAT (extreme Cluster Administration Tool). - Provides a browser-based interface for xCAT (extreme Cluster Administration Tool). +Depends: ${perl:Depends}, python (>= 2.3), apache2, libapache2-mod-php +Description: Provides a browser-based interface for xCAT + Provides a browser-based interface for xCAT (extreme Cluster Administration + Tool). diff --git a/xCAT-UI/debian/rules b/xCAT-UI/debian/rules index ce79be57f..1cf265aa1 100755 --- a/xCAT-UI/debian/rules +++ b/xCAT-UI/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd @@ -38,7 +35,7 @@ binary-arch: pwd dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-buildkit/debian/compat b/xCAT-buildkit/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-buildkit/debian/compat +++ b/xCAT-buildkit/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-buildkit/debian/control b/xCAT-buildkit/debian/control index dfe2c644d..ee045d41e 100644 --- a/xCAT-buildkit/debian/control +++ b/xCAT-buildkit/debian/control @@ -1,11 +1,11 @@ Source: xcat-buildkit Section: admin Priority: extra -Maintainer: xu qing -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Maintainer: Xu Qing +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-buildkit Architecture: all Depends: dpkg-dev, devscripts, debhelper -Description: xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit. +Description: Provides build tools and sample files to build an xCAT kit diff --git a/xCAT-buildkit/debian/rules b/xCAT-buildkit/debian/rules index b5e90c11b..c792c4f31 100755 --- a/xCAT-buildkit/debian/rules +++ b/xCAT-buildkit/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd mkdir -p share/man/man1 @@ -40,7 +37,6 @@ install: find debian/xcat-buildkit/opt/xcat/share/doc/packages/xCAT-buildkit -type f -exec chmod 644 {} \; dh_link - # Build architecture-independent files here. binary-indep: build install dh_installchangelogs diff --git a/xCAT-client/debian/compat b/xCAT-client/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-client/debian/compat +++ b/xCAT-client/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-client/debian/control b/xCAT-client/debian/control index 032f70438..db9b62fe4 100644 --- a/xCAT-client/debian/control +++ b/xCAT-client/debian/control @@ -2,12 +2,14 @@ Source: xcat-client Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-client Architecture: all -Depends: ${perl:Depends}, nmap, perl-xcat -Recommends: libsort-versions-perl +Depends: ${perl:Depends}, perl-xcat (>= 2.13-snap000000000000) +Recommends: libsort-versions-perl, nmap Description: Core executables and data of the xCAT management project - xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters. + xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, + etc) helpful in administrating systems at scale, with particular attention + paid to large HPC clusters. diff --git a/xCAT-client/debian/rules b/xCAT-client/debian/rules index 5beff8b73..17e87fad6 100755 --- a/xCAT-client/debian/rules +++ b/xCAT-client/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd ./xpod2man @@ -29,7 +26,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -39,7 +35,7 @@ binary-arch: pwd dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-genesis-builder/debian/compat b/xCAT-genesis-builder/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-genesis-builder/debian/compat +++ b/xCAT-genesis-builder/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-genesis-builder/debian/control b/xCAT-genesis-builder/debian/control index b107a09ab..ebb738dcf 100644 --- a/xCAT-genesis-builder/debian/control +++ b/xCAT-genesis-builder/debian/control @@ -2,15 +2,15 @@ Source: xcat-genesis-base-amd64 Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 8.0.0) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-genesis-base-amd64 Architecture: all -Depends: +Depends: Replaces: xcat-genesis-amd64 Breaks: xcat-genesis-amd64 Description: xCAT Genesis netboot image xCAT genesis (Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in - discovery and management actions when interaction with an OS is infeasible. + discovery and management actions when interaction with an OS is infeasible. diff --git a/xCAT-genesis-scripts/debian/compat b/xCAT-genesis-scripts/debian/compat index 45a4fb75d..ec635144f 100644 --- a/xCAT-genesis-scripts/debian/compat +++ b/xCAT-genesis-scripts/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-genesis-scripts/debian/control-amd64 b/xCAT-genesis-scripts/debian/control-amd64 index ada257a83..8c4de338e 100644 --- a/xCAT-genesis-scripts/debian/control-amd64 +++ b/xCAT-genesis-scripts/debian/control-amd64 @@ -2,14 +2,17 @@ Source: xcat-genesis-scripts Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 8.0.0) -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-genesis-scripts-amd64 -Architecture: all +Architecture: all Depends: xcat-genesis-base-amd64 (>=2.13.0) -Conflicts: xcat-genesis-scripts,xcat-genesis-scripts-x86-64 -Replaces: xcat-genesis-scripts,xcat-genesis-scripts-x86-64 -Description: xCAT genesis - (Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in discovery and management actions when interaction with an OS is infeasible. This package reperesents the EPL content that is more tightly bound to specific xcat-core versions - +Conflicts: xcat-genesis-scripts, xcat-genesis-scripts-x86-64 +Replaces: xcat-genesis-scripts, xcat-genesis-scripts-x86-64 +Description: xCAT genesis + (Genesis Enhanced Netboot Environment for System Information and Servicing) + is a small, embedded-like environment for xCAT's use in discovery and + management actions when interaction with an OS is infeasible. This package + reperesents the EPL content that is more tightly bound to specific xcat-core + versions. diff --git a/xCAT-genesis-scripts/debian/control-ppc64el b/xCAT-genesis-scripts/debian/control-ppc64el index 825592d88..2165376c7 100644 --- a/xCAT-genesis-scripts/debian/control-ppc64el +++ b/xCAT-genesis-scripts/debian/control-ppc64el @@ -2,14 +2,17 @@ Source: xcat-genesis-scripts Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 8.0.0) -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-genesis-scripts-ppc64 Architecture: all Depends: xcat-genesis-base-ppc64 (>=2.13.0) Conflicts: xcat-genesis-scripts Replaces: xcat-genesis-scripts -Description: xCAT genesis - (Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in discovery and management actions when interaction with an OS is infeasible. This package reperesents the EPL content that is more tightly bound to specific xcat-core versions - +Description: xCAT genesis + (Genesis Enhanced Netboot Environment for System Information and Servicing) + is a small, embedded-like environment for xCAT's use in discovery and + management actions when interaction with an OS is infeasible. This package + reperesents the EPL content that is more tightly bound to specific xcat-core + versions. diff --git a/xCAT-probe/debian/compat b/xCAT-probe/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-probe/debian/compat +++ b/xCAT-probe/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-probe/debian/control b/xCAT-probe/debian/control index f0b56bb3f..2a7549362 100644 --- a/xCAT-probe/debian/control +++ b/xCAT-probe/debian/control @@ -2,11 +2,11 @@ Source: xcat-probe Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-probe Architecture: all Depends: ${perl:Depends} Recommends: wget, dnsutils, tftp-hpa -Description: Provides a toolkit to help probe all the possible issues in xCAT +Description: Provides a toolkit to probe possible issues in xCAT diff --git a/xCAT-probe/debian/rules b/xCAT-probe/debian/rules index cb48348a6..bb1842ebe 100755 --- a/xCAT-probe/debian/rules +++ b/xCAT-probe/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: dh_testdir pwd @@ -29,7 +26,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -40,7 +36,7 @@ binary-arch: export dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-rmc/debian/compat b/xCAT-rmc/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-rmc/debian/compat +++ b/xCAT-rmc/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-rmc/debian/control b/xCAT-rmc/debian/control index 33f8bc9cd..e8e97d82d 100644 --- a/xCAT-rmc/debian/control +++ b/xCAT-rmc/debian/control @@ -2,11 +2,11 @@ Source: xcat-rmc Section: admin Priority: extra Maintainer: Arif Ali -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 Package: xcat-rmc Architecture: all -Depends: ${perl:Depends}, perl-xcat, xcat-server +Depends: ${perl:Depends}, perl-xcat (>= 2.13-snap000000000000), xcat-server (>= 2.13-snap000000000000) Description: RMC monitoring plug-in for xCAT Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors diff --git a/xCAT-rmc/debian/rules b/xCAT-rmc/debian/rules index 5099b8b4b..d880b083b 100755 --- a/xCAT-rmc/debian/rules +++ b/xCAT-rmc/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd @@ -28,7 +25,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -39,7 +35,7 @@ binary-arch: export dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-server/debian/compat b/xCAT-server/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-server/debian/compat +++ b/xCAT-server/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-server/debian/control b/xCAT-server/debian/control index 83eb791fb..ae2306ed9 100644 --- a/xCAT-server/debian/control +++ b/xCAT-server/debian/control @@ -2,11 +2,15 @@ Source: xcat-server Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcat-server Architecture: all -Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.5.0-1), xcat-client (>= 2.5.0-1), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl -Description: Server and configuration utilities of the xCAT management project - xCAT-server provides the core server and configuration management components of xCAT. This package should be installed on your management server +Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl +Description: Server and configuration utilities of xCAT + xCAT-server provides the core server and configuration management components + of xCAT. + . + This package should be installed on the xCAT management node. diff --git a/xCAT-server/debian/install b/xCAT-server/debian/install index 7941d95c2..ec21c731e 100644 --- a/xCAT-server/debian/install +++ b/xCAT-server/debian/install @@ -19,7 +19,6 @@ share/xcat/devicetype/* opt/xcat/share/xcat/devicetype share/xcat/ib/netboot/sles/* opt/xcat/share/xcat/ib/netboot/sles share/xcat/ib/netboot/rh/* opt/xcat/share/xcat/ib/netboot/rh - lib/perl/xCAT/* opt/xcat/lib/perl/xCAT/ lib/xcat/plugins/* opt/xcat/lib/perl/xCAT_plugin/ lib/xcat/schema/* opt/xcat/lib/perl/xCAT_schema/ diff --git a/xCAT-server/debian/rules b/xCAT-server/debian/rules index 027559171..72d780fc1 100755 --- a/xCAT-server/debian/rules +++ b/xCAT-server/debian/rules @@ -9,7 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 export buildroot=$(PWD)/debian/xcat-server export prefix=/opt/xcat export rootdir=$(buildroot)/$(prefix) @@ -41,7 +40,7 @@ binary-arch: pwd dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-test/debian/compat b/xCAT-test/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-test/debian/compat +++ b/xCAT-test/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-test/debian/control b/xCAT-test/debian/control index 10e475fb5..fa073a669 100644 --- a/xCAT-test/debian/control +++ b/xCAT-test/debian/control @@ -2,10 +2,13 @@ Source: xcat-test Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcat-test Architecture: all Depends: ${perl:Depends} -Description: Provides automated test tool and buckets to help test xCAT commands automatically +Description: xCAT automated test tool + Provides automated test tool and buckets to help test xCAT commands + automatically. diff --git a/xCAT-test/debian/rules b/xCAT-test/debian/rules index 2d65f3a62..ad419b385 100755 --- a/xCAT-test/debian/rules +++ b/xCAT-test/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: dh_testdir mkdir -p share/man/man1 @@ -33,7 +30,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -44,7 +40,7 @@ binary-arch: export dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-vlan/debian/compat b/xCAT-vlan/debian/compat index 45a4fb75d..ec635144f 100755 --- a/xCAT-vlan/debian/compat +++ b/xCAT-vlan/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-vlan/debian/control b/xCAT-vlan/debian/control index b6d89e310..5eddaa6e8 100755 --- a/xCAT-vlan/debian/control +++ b/xCAT-vlan/debian/control @@ -2,12 +2,11 @@ Source: xcat-vlan Section: admin Priority: extra Maintainer: root -Build-Depends: debhelper (>= 8.0.0) -Standards-Version: 3.9.2 -#Vcs-Git: git://git.debian.org/collab-maint/xcat-vlan.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-vlan.git;a=summary +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcat-vlan Architecture: all -Depends: xcat-client +Depends: xcat-client (>= 2.13-snap000000000000) Description: xCAT-vlan provides the xCAT vlan confiuration. diff --git a/xCAT-vlan/debian/rules b/xCAT-vlan/debian/rules index 4ab16dbff..2ab51a5dd 100755 --- a/xCAT-vlan/debian/rules +++ b/xCAT-vlan/debian/rules @@ -11,10 +11,12 @@ build: ./xpod2man + clean: dh_testdir dh_testroot dh_clean -d + install: pwd dh_installdirs diff --git a/xCAT/debian/compat b/xCAT/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT/debian/compat +++ b/xCAT/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT/debian/control b/xCAT/debian/control index 913d00c94..fae5030f6 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -2,11 +2,29 @@ Source: xcat Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Vcs-browser: https://github.com/xcat2/xcat-core.git +Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el -Depends: ${perl:Depends}, xcat-server, xcat-client, libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, nmap, bind9, libxml-parser-perl, xinetd, tftpd-hpa, tftp-hpa, conserver-xcat, libnet-telnet-perl, ipmitool-xcat (>=1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, xcat-genesis-scripts-ppc64, xcat-genesis-scripts-amd64, elilo-xcat, xcat-buildkit, xcat-probe (>=2.12) -Description: Server and configuration utilities of the xCAT management project - xcat-server provides the core server and configuration management components of xCAT. This package should be installed on your management server +Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, xinetd, tftpd-hpa, conserver-xcat, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Suggests: yaboot-xcat +Description: Metapackage for a common, default xCAT setup + xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete + management for HPC clusters, RenderFarms, Grids, WebFarms, Online Gaming + Infrastructure, Clouds, Datacenters, and whatever tomorrow's buzzwords may + be. It is agile, extensible, and based on years of system administration best + practices and experience. + . + It enables you to: + . + * Provision Operating Systems on physical or virtual machines: RHEL, CentOS, + Fedora, SLES, Ubuntu, AIX, Windows, VMWare, KVM, PowerVM, PowerKVM, zVM. + * Provision using scripted install, stateless, statelite, iSCSI, or cloning + * Remotely manage systems: lights-out management, remote console, and + distributed shell support + * Quickly configure and control management node services: DNS, HTTP, DHCP, + TFTP, NFS diff --git a/xCAT/debian/rules b/xCAT/debian/rules index b45ba65a7..14d8be8b1 100755 --- a/xCAT/debian/rules +++ b/xCAT/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd @@ -28,7 +25,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -39,7 +35,7 @@ binary-arch: export dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCATsn/debian/compat b/xCATsn/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCATsn/debian/compat +++ b/xCATsn/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCATsn/debian/control b/xCATsn/debian/control index 7ed6120d9..250449a81 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -2,12 +2,15 @@ Source: xcatsn Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcatsn Architecture: all -Depends: ${perl:Depends}, xcat-server, perl-xcat, xcat-client, libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, tftp-hpa, conserver-xcat, libnet-telnet-perl, dhcp3-server, apache2, expect, nfs-kernel-server, nmap, bind9, ipmitool-xcat (>=1.8.17-1), syslinux-xcat, xnba-undi, xcat-genesis-scripts-ppc64, xcat-genesis-scripts-amd64, elilo-xcat,libsys-virt-perl, xcat-probe (>=2.12) -Recommends: yaboot-xcat +Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, conserver-xcat, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT service node setup - xCATsn is a service node management package intended for at-scale management, including hardware management and software management. + xCATsn is a service node management package intended for at-scale + management, including hardware management and software management. diff --git a/xCATsn/debian/rules b/xCATsn/debian/rules index ce79be57f..38689173d 100755 --- a/xCATsn/debian/rules +++ b/xCATsn/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: pwd @@ -28,7 +25,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -38,7 +34,7 @@ binary-arch: pwd dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" From a2c05045b39ab17274c06a5106b99cd14dcd1ca3 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Tue, 3 Jan 2017 01:22:04 -0500 Subject: [PATCH 060/217] complete --- xCAT-test/autotest/testcase/migration/redhat_migration | 10 ++++------ xCAT-test/autotest/testcase/migration/sles_migration | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 58ffdfd42..652121f03 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -1,6 +1,6 @@ start:redhat_migration1 os:Linux -description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN @@ -100,14 +100,13 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end start:redhat_migration2 os:Linux -description:update xCAT from $$MIGRATION2_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file stop:yes #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi @@ -208,8 +207,7 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 1117af3a0..474a42adc 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -1,6 +1,6 @@ start:sles_migration1 os:Linux -description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN @@ -103,14 +103,13 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end start:sles_migration2 os:Linux -description:update xCAT from $$MIGRATION22VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN @@ -213,8 +212,7 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end From 6ebfd712bb3e8b45e0658c196395575a24d3adea Mon Sep 17 00:00:00 2001 From: chenglch Date: Tue, 3 Jan 2017 16:10:24 +0800 Subject: [PATCH 061/217] return error code when updatenode command completed close-issue: #2281 --- xCAT-server/lib/xcat/plugins/updatenode.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 2b9c9e6af..a81388bbc 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -2252,6 +2252,9 @@ s/Running of postscripts has completed/Redeliver security files has completed/; } } } + if($response->{errorcode}) { + $rsp->{errorcode} = $response->{errorcode}; + } $CALLBACK->($rsp); } From 64400321119d1395aba2ec3f0304dfdba3d0a5ae Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 22 Dec 2016 02:39:54 -0500 Subject: [PATCH 062/217] modify getipmi and bmcsetup works also as a post/postboot script for diskful or diskless installation --- build-ubunturepo | 10 +++++++--- makerpm | 9 ++++++++- xCAT-genesis-scripts/bin/bmcsetup | 16 ++++++++++++++-- xCAT-genesis-scripts/bin/getipmi | 9 ++++++++- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index b4220b4a6..797b4941a 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -232,6 +232,7 @@ then #genesis scripts package, don't remove genesis amd64 files #rm -f ../../$package_dir_name/${file_low}-amd64_*.deb cd $file + CURDIR=$(pwd) dch -v $pkg_version -b -c debian/changelog $build_string if [ "$target_arch" = "all" ]; then #xcat probe use some functions shipped by xCAT, for below reasons we need to copy files to xCAT-probe directory @@ -239,7 +240,6 @@ then #2 don't maintain two files for each script #3 symbolic link can't work during package if [ $file_low = "xcat-probe" ]; then - CURDIR=$(pwd) mkdir -p ${CURDIR}/lib/perl/xCAT/ cp -f ${CURDIR}/../perl-xCAT/xCAT/NetworkUtils.pm ${CURDIR}/lib/perl/xCAT/ cp -f ${CURDIR}/../perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/lib/perl/xCAT/ @@ -248,15 +248,19 @@ then dpkg-buildpackage -uc -us else if [ "$file" = "xCAT-genesis-scripts" ]; then - CURDIR=$(pwd) echo "Rename control file to build pkg: mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control" mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control + elif [ "$file" = "xCAT" ]; then + cp ${CURDIR}/../xCAT-genesis-scripts/bin/bmcsetup ${CURDIR}/postscripts/ + cp ${CURDIR}/../xCAT-genesis-scripts/bin/getipmi ${CURDIR}/postscripts/ fi dpkg-buildpackage -uc -us -a$target_arch if [ "$file" = "xCAT-genesis-scripts" ]; then - CURDIR=$(pwd) echo "Move control file back: mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}" mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch} + elif [ "$file" = "xCAT" ]; then + rm -f ${CURDIR}/postscripts/bmcsetup + rm -f ${CURDIR}/postscripts/getipmi fi fi rc=$? diff --git a/makerpm b/makerpm index c80ed0edf..2042f1bbf 100755 --- a/makerpm +++ b/makerpm @@ -107,7 +107,10 @@ function makexcat { TARGET="--target $ARCH" if [ "$RPMNAME" = "xCAT" ]; then - cd `dirname $0`/$RPMNAME + cd `dirname $0`/ + cp xCAT-genesis-scripts/bin/bmcsetup $RPMNAME/postscripts + cp xCAT-genesis-scripts/bin/getipmi $RPMNAME/postscripts + cd $RPMNAME tar --exclude .svn --exclude upflag -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts tar --exclude .svn -czf $RPMROOT/SOURCES/templates.tar.gz templates @@ -139,6 +142,10 @@ function makexcat { echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm $EMBEDTXT..." rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" RC=$? + if [ "$RPMNAME" = "xCAT" ]; then + rm -f `dirname $0`/$RPMNAME/postscripts/bmcsetup + rm -f `dirname $0`/$RPMNAME/postscripts/getipmi + fi fi } diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 1be072fcd..27d82281c 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -13,7 +13,7 @@ # 0x08 0x00 0x49 0x4e 0x54 0x45 0x4c # 0x08 0x04 # -log_label="xcat.genesis.bmcsetup" +log_label="bmcsetup" TIMEOUT=15 @@ -29,6 +29,7 @@ TIMEOUT=15 function cold_reset_bmc() { if [ -z $XPROD ]; then logger -s -t $log_label -p local4.crit "CRITICAL ERROR - XPROD must be set before calling ${FUNCNAME[0]}" + rm -f /tmp/ipmicfg.xml exit 1 fi if [ "$XPROD" = "43707" -a "$IPMIMFG" != '0' ]; then @@ -87,6 +88,7 @@ function cold_reset_bmc() { function snooze() { if [ -z $XPROD ]; then logger -s -t $log_label -p local4.crit "CRITICAL ERROR - XPROD must be set before calling ${FUNCNAME[0]}" + rm -f /tmp/ipmicfg.xml exit 1 fi if [ "$XPROD" = "43707" -a "$IPMIMFG" != '0' ]; then @@ -100,7 +102,15 @@ function snooze() { logger -s -t $log_label -p local4.debug "snooze for 1 second..." sleep 1 fi -} +} + +if which ipmitool 2>&1 | grep no; then + echo "No ipmitool find, please install it first"; + exit 1; +fi + +# Add ipmi_devintf module to allow the ipmitool operation in-band +modprobe ipmi_devintf allowcred.awk & CREDPID=$! @@ -605,3 +615,5 @@ while [ $idev -gt 0 ]; do fi done +# remove the bmc configuration information before exit +rm -f /tmp/ipmicfg.xml diff --git a/xCAT-genesis-scripts/bin/getipmi b/xCAT-genesis-scripts/bin/getipmi index f129cb382..5ec67b7c6 100755 --- a/xCAT-genesis-scripts/bin/getipmi +++ b/xCAT-genesis-scripts/bin/getipmi @@ -1,11 +1,12 @@ #!/bin/bash -log_label="xcat.genesis.getipmi" allowcred.awk & CREDPID=$! if [ -z "$XCATDEST" ]; then XCATDEST=$1 fi + +# This section only works in genesis if [ -z "$XCATDEST" ]; then for parm in `cat /proc/cmdline` ; do if echo $parm |grep xcatd= > /dev/null; then @@ -13,6 +14,12 @@ if [ -z "$XCATDEST" ]; then fi done fi +# This section works in diskless/diskful +# The environment MASTER_IP and XCATDPORT is exported by mypostscript +if [ -z "$XCATDEST" ]; then + XCATDEST=$MASTER_IP:$XCATDPORT +fi + for LANCHAN in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do if ipmitool channel info $LANCHAN 2> /dev/null | grep 802.3 > /dev/null 2>&1 && ipmitool raw 0xc 2 $LANCHAN 5 0 0 > /dev/null 2>&1; then break; From 179f8211e373c0fb028dadc5f940cf97b880b826 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 3 Jan 2017 14:50:00 -0500 Subject: [PATCH 063/217] change drift file to /var/lib/ntp/drift/ntp.drift --- xCAT-server/lib/xcat/plugins/makentp.pm | 2 +- xCAT/postscripts/setupntp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/makentp.pm b/xCAT-server/lib/xcat/plugins/makentp.pm index 91afe08f8..7d7466f8b 100755 --- a/xCAT-server/lib/xcat/plugins/makentp.pm +++ b/xCAT-server/lib/xcat/plugins/makentp.pm @@ -318,7 +318,7 @@ sub process_request { print CFGFILE "disable auth\n"; print CFGFILE "broadcastclient\n"; } elsif ($os =~ /sles/) { - print CFGFILE "driftfile /etc/ntp.drift\n"; + print CFGFILE "driftfile /var/lib/ntp/drift/ntp.drift\n"; print CFGFILE "disable auth\n"; } else { print CFGFILE "driftfile /var/lib/ntp/drift\n"; diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index f2a95994e..882a6161a 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -100,7 +100,7 @@ if [ $OS_TYPE = Linux ]; then mkdir -p /var/lib/ntp chown ntp /var/lib/ntp if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then - echo "driftfile /etc/ntp.drift" >>$conf_file + echo "driftfile /var/lib/ntp/drift/ntp.drift" >>$conf_file else echo "driftfile /var/lib/ntp/drift" >>$conf_file fi From 5c9a3624d6800a79a160aeccb02ddcb8a55950d3 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 16 Dec 2016 09:42:50 -0500 Subject: [PATCH 064/217] refine the doc on cumulus switch --- .../edgecore_switches/edgecore_switches.rst | 152 ------------------ .../networks/edgecore_switches/index.rst | 6 +- .../edgecore_switches/onie_switches.rst | 135 ++++++++++++++++ xCAT/postscripts/enablesnmp | 26 +++ ...cumulusswitch.stanza => onieswitch.stanza} | 6 +- 5 files changed, 167 insertions(+), 158 deletions(-) delete mode 100644 docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst create mode 100644 docs/source/advanced/networks/edgecore_switches/onie_switches.rst create mode 100755 xCAT/postscripts/enablesnmp rename xCAT/templates/objects/node/{cumulusswitch.stanza => onieswitch.stanza} (82%) diff --git a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst b/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst deleted file mode 100644 index 31e1bd238..000000000 --- a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst +++ /dev/null @@ -1,152 +0,0 @@ -Edgecore Switch -=============== - -The Edgecore switch from Mellanox is 1Gb top-of-rack switch. Usually, Mellanox ships the switch with Cumulus Network OS(https://cumulusnetworks.com) and along with a license file installed. In some case, user may get whitebox switch hardware without OS and license installed. - -Since edgecore switch is different from other traditional switches that xCAT supports, xCAT supports edgecore switch in a different way. Currently, the features provided by xCAT include: :: - - 1) Cumulus Network OS provision - 2) switch discovery - 3) switch configuration: - (a) enable root-passwordless ssh - (b) install licence file - (c) enable snmp - 4) distribute files to switches with ``xdcp`` - 5) invoke remote commands or scripts on switches with `xdsh`` - 6) configure switches with ``updatenode`` - -This documentation presents a typical workflow on how to setup a edgecore switch from white box, then configure and manage the switch with xCAT. - - -Create a edgecore switch object -------------------------------- - -If you have the information of the ip and mac information of the switch, the edgecore switch object definition can be created with the "cumulusswitch" template shipped in xCAT : :: - - mkdef edgecoresw1 --template cumulusswitch arch=armv71 ip=192.168.5.191 mac=8C:EA:1B:12:CA:40 - -Discover the switch - -ONIE Mode ---------- - -If the switch arrives without an OS pre-loaded, the ONIE installer and management port is the only thing enabled on the switch. Once the switch connects to the xCAT network, the switch should get a dynamic IP address. The xCAT DHCP server will get requests from the onie-installer from the switch and attempt to find an OS binary file to execute. The following messages will be logged in /var/log/messages on the management node. :: - - Info: Fetching http://172.1.0.1/onie-installer-arm-accton_as4610_54-r0 ... - Info: Fetching http://172.1.0.1/onie-installer-arm-accton_as4610_54 ... - Info: Fetching http://172.1.0.1/onie-installer-accton_as4610_54 ... - Info: Fetching http://172.1.0.1/onie-installer-arm ... - Info: Fetching http://172.1.0.1/onie-installer . - - -To remove the installed Cumulus Linux OS to boot back to ONIE mode, connect to the switch via serial-port or ssh and execute the following commands: :: - - ssh cumulus@172.1.0.1 - #clean up all the configuration - sudo onie-select -k - sudo reboot - #boot back to onie mode - sudo onie-select -i - sudo reboot - - -After switch reboots, it will enter ONIE mode and send DHCP request to attempt to fetch the OS binary file. - - -Discover Edgecore Switch ------------------------- - -ONIE supports a number of methods for locating OS binary file. xCAT choose to use a DHCP server to provide specific information to the switch. - -* IP address of the switch -* URL of the OS binary file on the Web server - -With the xCAT DHCP configuration, ONIE picks up an IP address and downloads the URL specified by the user and start to install of the OS. The steps take to discover the edgecore switch and process request from ONIE installer as follows: - -#. Pre-define switch object into xCAT db, make sure ip adress, netboot and provemethod are set, also define core switch and port number where edgecore switch connect to. :: - - - #lsdef edgecoresw1 - Object name: edgecoresw1 - groups=switch - ip=192.168.23.1 - mgt=switch - netboot=onie - nodetype=switch - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - provmethod=/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin - switch=switch-10-5-23-1 - switchport=1 - - #makehosts edgecoresw1 - - -#. Run ``switchdiscover`` command, it will find edgecore switch and update mac address on pre-defined switch node definition. :: - - #switchdiscover --range 192.168.5.170-190 -s nmap - #lsdef edgecoresw1 - Object name: edgecoresw1 - groups=switch - ip=192.168.23.1 - mac=8C:EA:1B:12:CA:40 - mgt=switch - netboot=onie - nodetype=switch - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - provmethod=/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin - status=Matched - switch=switch-10-5-23-1 - switchport=1 - switchtype=cumulus - usercomment=Edgecore switch - - -#. Run ``makedhcp`` after edgecore switch discovered, it will update ``dhcpd.conf`` and response the DHCP request from the onie-installer. :: - - #makedhcp -n - #makedhcp -a edgecoresw1 - - -#. Installation of the Cumulus Linux OS takes about 50 minutes. Monitor the /var/log/messages to check the status of the installation. :: - - - Oct 27 15:28:08 fs4 dhcpd: DHCPDISCOVER from 8c:ea:1b:12:ca:40 via enP4p1s0f2 - Oct 27 15:28:08 fs4 dhcpd: DHCPOFFER on 192.168.23.1 to 8c:ea:1b:12:ca:40 via enP4p1s0f2 - Oct 27 15:28:08 fs4 dhcpd: DHCPREQUEST for 192.168.23.1 (192.168.3.25) from 8c:ea:1b:12:ca:40 via enP4p1s0f2 - Oct 27 15:28:08 fs4 dhcpd: DHCPACK on 192.168.23.1 to 8c:ea:1b:12:ca:40 via enP4p1s0f2 - - -#. Once installation finished, the pre-defined switch name and IP address will be configured on edgecore switch. :: - - cumulus@edgecoresw1:~$ ifconfig - eth0 Link encap:Ethernet HWaddr 8c:ea:1b:12:ca:40 - inet addr:192.168.23.1 Bcast:192.168.255.255 Mask:255.255.0.0 - inet6 addr: fe80::8eea:1bff:fe12:ca40/64 Scope:Link - UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 - cumulus@edgecoresw1:~$ hostname - edgecoresw1 - - -Configure Edgecore Switch -------------------------- - -xCAT provides a script ``/opt/xcat/share/xcat/script/configcumulus`` to configure attributes in the Cumulus Switch. Use the ``--help`` option to see more details. :: - - #configcumulus --help - Usage: - configcumulus [-?│-h│--help] - configcumulus [--switches switchnames] [--all] - configcumulus [--switches switchnames] [--ssh] - configcumulus [--switches switchnames] [--license filename ] - configcumulus [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] - configcumulus [--switches switchnames] [--ntp] - - - - - - - - diff --git a/docs/source/advanced/networks/edgecore_switches/index.rst b/docs/source/advanced/networks/edgecore_switches/index.rst index 6d3bdf038..0c897d340 100644 --- a/docs/source/advanced/networks/edgecore_switches/index.rst +++ b/docs/source/advanced/networks/edgecore_switches/index.rst @@ -1,7 +1,7 @@ -Edgecore Switches -================= +ONIE Compatible Bare Metal Switches +=================================== .. toctree:: :maxdepth: 2 - edgecore_switches.rst + onie_switches.rst diff --git a/docs/source/advanced/networks/edgecore_switches/onie_switches.rst b/docs/source/advanced/networks/edgecore_switches/onie_switches.rst new file mode 100644 index 000000000..dd41a8c71 --- /dev/null +++ b/docs/source/advanced/networks/edgecore_switches/onie_switches.rst @@ -0,0 +1,135 @@ +ONIE compatible bare metal switch +================================= + +The ONIE [1]_. compatible bare metal switches(abbreviated as "ONIE switch") from vendors such as Mellanox or Edgecore are often used as top-of-rack switches in the cluster. Usually, the switches are shipped with a Cumulus Network OS(https://cumulusnetworks.com) and a license pre-installed. In some cases, user may get whitebox switch hardware with a standalone Cumulus installer and license file. This documentation presents a typical workflow on how to setup ONIE switch from white box, then configure and manage the switch with xCAT. + +.. [1] Open Network Install Environment: Created by Cumulus Networks, Inc. in 2012, the Open Network Install Environment (ONIE) Project is a small operating system, pre-installed as firmware on bare metal network switches, that provides an environment for automated operating system provisioning. + +Create an ONIE switch object +------------------------------- + +The ONIE switch object can be created with the "onieswitch" template shipped in xCAT, the ip address and mac of the switch management ethernet port should be specified : :: + + mkdef edgecoresw1 --template onieswitch arch=armv71 ip=192.168.5.191 mac=8C:EA:1B:12:CA:40 + +Provision the Cumulus OS on ONIE switch +--------------------------------------- + +To provision Cumulus OS, the Cumulus installation file, a binary shipped with the switch, should be saved in a directory exported in the http server. + +Run ``chdef`` to specify the "provmethod" attribute of the switch object to the full path of the installation file: :: + + chdef edgecoresw1 netboot=onie provmethod="/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin" + +Run ``makedhcp`` to prepare the DHCP/BOOTP lease. :: + + makedhcp -a edgecoresw1 + +The command or operation to start the provision dependes on the status of switch: + +1. If the switch is a white box without Cumulus OS installed, simply connect the management ethernet port of the switch to xCAT management node, then power on the switch. + +2. If a Cumulus OS has been installed on the switch, you need to login to the switch(the default user is ``cumulus`` and the password is ``CumulusLinux!``) and run a batch of commands: :: + + sudo onie-select -i + sudo reboot + +If the passwordless-ssh of "root" has been enabled, the commands can be issued with: :: + + xdsh edgecoresw1 "/usr/cumulus/bin/onie-select -i -f;reboot" + +After reboot, the switch will enter ONIE install mode and begin the installation. The provision might take about 50 minutes. + + +Switch Configuration +-------------------- + +Enable the passwordless ssh for "root" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In a newly installed Cumulus OS, a default user ``cumulus`` will be created, the switch can be accessed via ssh with the default password ``CumulusLinux!``. + +The passwordless ssh access of "root" should be enabled with the script ``/opt/xcat/share/xcat/scripts/configcumulus`` :: + + /opt/xcat/share/xcat/scripts/configcumulus --switches edgecoresw1 --ssh + +After the passwordless access for "root" is setup successfully, the switch can be managed with the node management commands such as ``xdsh``, ``xdcp`` and ``updatenode``, etc. + +Licence file installation +~~~~~~~~~~~~~~~~~~~~~~~~~ + +On the newly installed switch, only the serial console and the management ethernet port are enabled. To activate the data ports, the licence file shipped with the switch should be installed: :: + + xdcp edgecoresw1 /install/custom/sw/edgecore/licensefile.txt /tmp + xdsh edgecoresw1 "/usr/cumulus/bin/cl-license -i /tmp/licensefile.txt" + +To check whether the license file is installed successfully: :: + + ~: xdsh edgecoresw1 /usr/cumulus/bin/cl-license + edgecoresw1: xxx@xx.com|xxxxxxxxxxxxxxx + +Reboot the switch to apply the licence file: :: + + xdsh edgecoresw1 reboot + +Enable SNMP +~~~~~~~~~~~ + +The snmpd in the switch is not enabled by default, xCAT ships a postscript to enable it: :: + + updatenode edgecoresw1 -P enablesnmp + + +Switch Discovery +---------------- + +The ONIE switch can be scaned and discovered with ``switchdiscover`` :: + + ~: switchdiscover --range 192.168.23.1-10 + Discovering switches using nmap for 192.168.23.1-10. It may take long time... + ip name vendor mac + ------------ ------------ ------------ ------------ + 192.168.23.1 edgecoresw1 Edgecore switch 8C:EA:1B:12:CA:40 + Switch discovered: edgecoresw1 + +Once SNMP on the ONIE switch is enabled, the ONIE switch can be discovered with "snmp" method: :: + + ~: switchdiscover --range 192.168.23.1-10 -s snmp + Discovering switches using snmpwalk for 192.168.23.1-10 .... + ip name vendor mac + ------------ ------------ ------------ ------------ + 192.168.23.1 edgecoresw1 Linux edgecoresw1 4.1.0-cl-2-iproc #1 SMP Debian 4.1.25-1+cl3u4 (2016-08-13) armv7l 8c:ea:1b:12:ca:40 + Switch discovered: edgecoresw1 + + +Switch Management +----------------- + +File Dispatch +~~~~~~~~~~~~~ + +The files can be dispatched to ONIE switches with ``xdcp`` :: + + xdcp edgecoresw1 + +Refer to :doc:`xdcp manpage ` for details. + +Remote Commands +~~~~~~~~~~~~~~~ + +Commands can be run on ONIE switches remotely with ``xdsh`` :: + + xdsh edgecoresw1 + +Refer to :doc:`xdsh manpage ` for details. + +Run scripts remotely +~~~~~~~~~~~~~~~~~~~~ + +The scripts under "/install/postscripts" can be run on ONIE switches with ``updatenode -P`` :: + + updatenode edgecoresw1 -P