From de705f06dbf86b67b4dcaeb12cc5d6f6653de40a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 28 Aug 2020 11:13:15 -0400 Subject: [PATCH 01/82] Support OS install on nvme disk --- .../share/xcat/install/scripts/getinstdisk | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 8752f7663..a5cabb2b1 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -13,7 +13,7 @@ # type, select the first one. # 3. Select the default one: /dev/sda. # -# Output: /tmp/xcat.install_disk +# Output: Install disk name written to /tmp/xcat.install_disk # #----------------------------------------------------------- @@ -31,7 +31,7 @@ tmpfile="$tmpdir/getinstalldisk_" if [ -z "$install_disk" ]; then - echo "[get_install_disk]Information from /proc/partitions:" + echo "[get_install_disk]Contents of /proc/partitions:" cat /proc/partitions echo "" @@ -67,6 +67,7 @@ if [ -z "$install_disk" ]; then mkdir -p $mount_dir; disk_array="" + umount_rc=0 for partition in $partitions; do echo "[get_install_disk]Check the partition $partition." @@ -107,7 +108,13 @@ if [ -z "$install_disk" ]; then # It seems the kernel file in ubuntu and sles are named like vmlinux, but in RH it is called vmlinuz # To check both vmlinux and vmlinuz, use regular expression "vmlinu*" to match them for i in $ker_dir/vmlinu*; do - disk_part=${partition%%[0-9]*} + if [[ $partition = nvme* ]]; then + # Expected nvme partition format example: nvme0n1p1 + disk_part=${partition%%p*} + else + # Expected sd partition format example: sda1 + disk_part=${partition%%[0-9]*} + fi touch "$tmpfile$disk_part" disk_array=$disk_array"$disk_part " echo "[get_install_disk] The partition $partition has kernel file." @@ -115,6 +122,10 @@ if [ -z "$install_disk" ]; then done umount -l $mount_dir || echo "[get_install_disk] $partition umount failed." + if [ $? -ne 0 ]; then + # Preserve a umount failure RC + umount_rc=$? + fi else echo "[get_install_disk] Partition $partition mount failed or the partition is swap." fi @@ -128,7 +139,13 @@ if [ -z "$install_disk" ]; then echo "" fi - rmdir $mount_dir; + if [ $umount_rc -eq 0 ]; then + rmdir $mount_dir; + else + # Do not remove $mount_dir if there was a umount failure, as it might wipe out + # the contents of a still mounted disk + echo "[get_install_disk]There was a umount failure earlier, not removing $mount_dir" + fi for file in $tmpfile*; do rm $file; @@ -215,7 +232,7 @@ rm -rf $tmpdir; # Cannot find proper disk for OS install, select the default one "/dev/sda" if [ -z "$install_disk" ]; then install_disk="/dev/sda" - echo "[get_install_disk]The default install_disk is $install_disk." + echo "[get_install_disk]Choosing default install_disk is $install_disk." fi # Output the result to $install_disk_file From d0f486ce1057de484b5624c4c82f1415426744f0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 2 Sep 2020 17:00:50 -0400 Subject: [PATCH 02/82] Use case instead of if which does not work on Ubuntu --- .../share/xcat/install/scripts/getinstdisk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index a5cabb2b1..43325a4d4 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -108,13 +108,16 @@ if [ -z "$install_disk" ]; then # It seems the kernel file in ubuntu and sles are named like vmlinux, but in RH it is called vmlinuz # To check both vmlinux and vmlinuz, use regular expression "vmlinu*" to match them for i in $ker_dir/vmlinu*; do - if [[ $partition = nvme* ]]; then - # Expected nvme partition format example: nvme0n1p1 - disk_part=${partition%%p*} - else - # Expected sd partition format example: sda1 - disk_part=${partition%%[0-9]*} - fi + case $partition in + nvme*) + # Expected nvme partition format example: nvme0n1p1 + disk_part=${partition%%p*} + ;; + *) + # Expected sd partition format example: sda1 + disk_part=${partition%%[0-9]*} + ;; + esac touch "$tmpfile$disk_part" disk_array=$disk_array"$disk_part " echo "[get_install_disk] The partition $partition has kernel file." From 19b6ee3b5ad59d72bdf9a6e2258ebda0251b07f1 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 29 Oct 2020 10:06:24 -0400 Subject: [PATCH 03/82] Improve reporting of invalid OS, ARCH and HCP --- xCAT-test/xcattest | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 01ec0b777..47ebfa45f 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -962,6 +962,10 @@ sub load_case { my $fd = undef; my %invalidcases; + + # invalidoptions saves invalid OS, or ARCH, or HCP + my %invalidoptions; + my %case_name_index_map_bak; foreach my $file (@files) { if (!open($fd, "<$file")) { @@ -1036,7 +1040,7 @@ sub load_case { my @newvalidoslist = (); foreach my $validos (@validoslist) { if ($validos =~ /linux/i) { - push(@newvalidoslist, ("rhel", "sles", "ubuntu")); + push(@newvalidoslist, ("rhels", "sles", "ubuntu")); } else { push(@newvalidoslist, $validos); } @@ -1062,6 +1066,7 @@ sub load_case { delete $$case_name_index_map_ref{ $case_ref->[$i]->{name} }; if (!grep (/$case_ref->[$i]->{name}/, @{ $invalidcases{"noruncases"} })) { push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + push @{ $invalidoptions{"invalid-os"} }, "$case_ref->[$i]->{os}"; } } } @@ -1121,6 +1126,7 @@ sub load_case { delete $$case_name_index_map_ref{ $case_ref->[$i]->{name} }; if (!grep (/$case_ref->[$i]->{name}/, @{ $invalidcases{"noruncases"} })) { push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + push @{ $invalidoptions{"invalid-arch"} }, "$case_ref->[$i]->{arch}"; } } } @@ -1152,6 +1158,7 @@ sub load_case { delete $$case_name_index_map_ref{ $case_ref->[$i]->{name} }; if (!grep (/$case_ref->[$i]->{name}/, @{ $invalidcases{"noruncases"} })) { push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + push @{ $invalidoptions{"invalid-hcp"} }, "$case_ref->[$i]->{hcp}"; } } } @@ -1249,7 +1256,18 @@ sub load_case { } if ($invalidcases{"noruncases"} && @{ $invalidcases{"noruncases"} }) { - log_this($running_log_fd, "Unsuitable current environment:", @{ $invalidcases{"noruncases"} }); + my $temp_invalid_op; + my $test_case = $invalidcases{"noruncases"}[0]; + if (exists $invalidoptions{"invalid-os"}) { + $temp_invalid_op = $invalidoptions{"invalid-os"}[0]; + print "Test case $test_case has an invalid OS option - $temp_invalid_op\n"; + } elsif (exists $invalidoptions{"invalid-arch"}) { + $temp_invalid_op = $invalidoptions{"invalid-arch"}[0]; + print "Test case $test_case has an invalid ARCH option - $temp_invalid_op\n"; + } elsif (exists $invalidoptions{"invalid-hcp"}) { + $temp_invalid_op = $invalidoptions{"invalid-hcp"}[0]; + print "Test case $test_case has an invalid HCP option - $temp_invalid_op\n"; + } push @wrong_cases, @{ $invalidcases{"noruncases"} }; $caseerror = 2; } From 5b0f04e2c3b90166e7c7eabb4f9c9cb190fcaf27 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 10 Nov 2020 10:05:02 -0500 Subject: [PATCH 04/82] Update Version --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 0e7079b69..43c85e792 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.16.1 +2.16.2 From f7c4811a95c131e7293b22ca75a04bf2dcf9557d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 10 Nov 2020 10:05:57 -0500 Subject: [PATCH 05/82] Update conf.py --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index df334cef4..9dc81f2a9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.16.1' +release = '2.16.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From faddacc7e6e10699f438a397e6fb6f81eb565910 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 10 Dec 2020 13:52:12 -0500 Subject: [PATCH 06/82] Skip key expiration verification when provisioning SLES15 compute and service nodes --- xCAT-server/share/xcat/install/sles/compute.sle15.tmpl | 1 + xCAT-server/share/xcat/install/sles/service.sle15.tmpl | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl b/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl index 4d9a5884e..cb70be65f 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl @@ -32,6 +32,7 @@ true true true + true diff --git a/xCAT-server/share/xcat/install/sles/service.sle15.tmpl b/xCAT-server/share/xcat/install/sles/service.sle15.tmpl index b1ed324ea..f91d1f5e5 100644 --- a/xCAT-server/share/xcat/install/sles/service.sle15.tmpl +++ b/xCAT-server/share/xcat/install/sles/service.sle15.tmpl @@ -32,6 +32,7 @@ true true true + true From 67650af830e6fe43e4e3c0dddf16b467155fdfec Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 21 Jan 2021 16:42:08 -0500 Subject: [PATCH 07/82] Fix link and formatting for makedns man page --- .../admin-guides/references/man8/makedns.8.rst | 15 +++++++-------- xCAT-client/pods/man8/makedns.8.pod | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makedns.8.rst b/docs/source/guides/admin-guides/references/man8/makedns.8.rst index a97c1401a..37e266219 100644 --- a/docs/source/guides/admin-guides/references/man8/makedns.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makedns.8.rst @@ -33,7 +33,7 @@ DESCRIPTION \ **makedns**\ configures a DNS server on the system you run it on, which is typically the xCAT management node. -The list of nodes to include comes from either the \ **noderange**\ provided on the command line or the entries in the local /etc/hosts files. +The list of nodes to include comes from either the \ **noderange**\ provided on the command line or the entries in the local \ */etc/hosts*\ files. There are several bits of information that must be included in the xCAT database before running this command. @@ -45,12 +45,11 @@ An xCAT \ **network**\ definition must be defined for each network used in the A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definition corresponding to the node or in the \ **site**\ definition. -Only entries in /etc/hosts or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. +Only entries in \ */etc/hosts*\ or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. -By default, \ **makedns**\ sets up the \ **named**\ service and updates the DNS records on the local system (management node). If the -e flag is specified, it will also update the DNS records on any external DNS server that is listed in the /etc/resolv.conf on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) +By default, \ **makedns**\ sets up the \ **named**\ service and updates the DNS records on the local system (management node). If the \ **-e**\ flag is specified, it will also update the DNS records on any external DNS server that is listed in the \ */etc/resolv.conf*\ on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) -For more information on Cluster Name Resolution: -Cluster_Name_Resolution +For more information on Cluster Name Resolution see https://xcat-docs.readthedocs.io/en/stable/advanced/domain_name_resolution/domain_name_resolution.html ******* @@ -79,13 +78,13 @@ OPTIONS \ **-e | -**\ **-external**\ - Update DNS records to the external DNS server listed in /etc/resolv.conf. + Update DNS records to the external DNS server listed in \ */etc/resolv.conf*\ . - Enabling the site attribute \ *externaldns*\ means use 'external' DNS by default. If setting \ *externaldns*\ to 1, you need NOT use \ **-e**\ flag in every makedns call. + Enabling the site attribute \ *externaldns*\ means use 'external' DNS by default. If setting \ *externaldns*\ to 1, you need NOT use \ **-e**\ flag in every \ **makedns**\ call. -\ **noderange**\ +\ *noderange*\ A set of comma delimited node names and/or group names. See the "noderange" man page for details on additional supported formats. diff --git a/xCAT-client/pods/man8/makedns.8.pod b/xCAT-client/pods/man8/makedns.8.pod index 047adc2fe..b6a46014e 100644 --- a/xCAT-client/pods/man8/makedns.8.pod +++ b/xCAT-client/pods/man8/makedns.8.pod @@ -14,7 +14,7 @@ B [B<-V>|B<--verbose>] [B<-e>|B<--external>] [B<-d>|B<--delete> I configures a DNS server on the system you run it on, which is typically the xCAT management node. -The list of nodes to include comes from either the B provided on the command line or the entries in the local /etc/hosts files. +The list of nodes to include comes from either the B provided on the command line or the entries in the local I files. There are several bits of information that must be included in the xCAT database before running this command. @@ -26,12 +26,11 @@ An xCAT B definition must be defined for each network used in the clust A network B and B values must be provided either in the B definition corresponding to the node or in the B definition. -Only entries in /etc/hosts or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. +Only entries in I or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. -By default, B sets up the B service and updates the DNS records on the local system (management node). If the -e flag is specified, it will also update the DNS records on any external DNS server that is listed in the /etc/resolv.conf on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) +By default, B sets up the B service and updates the DNS records on the local system (management node). If the B<-e> flag is specified, it will also update the DNS records on any external DNS server that is listed in the I on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) -For more information on Cluster Name Resolution: -Cluster_Name_Resolution +For more information on Cluster Name Resolution see https://xcat-docs.readthedocs.io/en/stable/advanced/domain_name_resolution/domain_name_resolution.html =head1 OPTIONS @@ -51,11 +50,11 @@ Remove the DNS records. =item B<-e>|B<--external> -Update DNS records to the external DNS server listed in /etc/resolv.conf. +Update DNS records to the external DNS server listed in I. -Enabling the site attribute I means use 'external' DNS by default. If setting I to 1, you need NOT use B<-e> flag in every makedns call. +Enabling the site attribute I means use 'external' DNS by default. If setting I to 1, you need NOT use B<-e> flag in every B call. -=item B +=item I A set of comma delimited node names and/or group names. See the "noderange" man page for details on additional supported formats. From fc380e1ea372194450e3c1a516c293a269f7c240 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 1 Feb 2021 19:32:56 -0500 Subject: [PATCH 08/82] Modify two confignetwork test cases so that is done after network-scripts is restored under /etc/sysconfig --- xCAT-test/autotest/testcase/confignetwork/cases0 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 911f01641..fc5fd75ff 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -253,14 +253,17 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" +check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 end start:confignetwork_secondarynic_nicextraparams_updatenode @@ -949,14 +952,16 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" +check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +check:rc==0 cmd:chtab -d node=$$CN nics +check:rc==0 end start:confignetwork__bridge_false From 7ef173824e9245ecc8b62114cb3cafa885812a17 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 3 Feb 2021 13:45:04 -0500 Subject: [PATCH 09/82] Remove check:rc==0 for nmcli con reload --- xCAT-test/autotest/testcase/confignetwork/cases0 | 2 -- 1 file changed, 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index fc5fd75ff..10be8284a 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -257,7 +257,6 @@ check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" -check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts @@ -955,7 +954,6 @@ cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" -check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" From 9918b96ffe6b9fc8de3f65335606a577daa19481 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 10 Feb 2021 11:49:08 -0500 Subject: [PATCH 10/82] Add postscript execution summary --- .../hierarchy/define_service_node.rst | 2 +- .../deployment/prepostscripts/post_script.rst | 5 +--- .../deployment/prepostscripts/pre_script.rst | 18 ++++++------ .../manage_clusters/common/updatenode.rst | 2 +- .../customize_image/postscript_execution.rst | 27 ++++++++++++++++++ .../customize_image/pre_post_script.rst | 2 +- .../customize_image/postscript_execution.rst | 28 +++++++++++++++++++ .../customize_image/pre_post_script.rst | 2 +- .../ppc64le/management/basic/rcons.rst | 10 +++---- 9 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst diff --git a/docs/source/advanced/hierarchy/define_service_node.rst b/docs/source/advanced/hierarchy/define_service_node.rst index 3c2d8ec1f..f53430441 100644 --- a/docs/source/advanced/hierarchy/define_service_node.rst +++ b/docs/source/advanced/hierarchy/define_service_node.rst @@ -61,7 +61,7 @@ Now set some of the common attributes for the SNs at the group level: :: provmethod=rhels7-x86_64-install-service Add Service Nodes to the ``servicenode`` Table ------------------------------------------- +---------------------------------------------- An entry must be created in the ``servicenode`` table for each service node or the **service** group. This table describes all the services you would like xcat to diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst index 2fa03bed8..48bc9e559 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst @@ -1,8 +1,5 @@ .. _Using-Postscript-label: -Using Postscript ----------------- - xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. Types of scripts @@ -358,7 +355,7 @@ THE ``#NETWORK_FOR_DISKLESS_EXPORT#`` line will provide diskless networks inform .. #NETWORK_FOR_DISKLESS_EXPORT# -Note: the ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode -P syslog``. +.. note:: The ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode -P syslog``. The ``#INCLUDE_POSTSCRIPTS_LIST#`` flag provides a list of postscripts defined for this ``$NODE``. :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst index 4ca419812..390b30ed0 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst @@ -26,7 +26,7 @@ Identify the scripts to be run for each node by adding entries to the prescripts Format for naming prescripts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The general format for the prescripts-begin or prescripts-end attribute is: :: +The general format for the ``prescripts-begin`` or ``prescripts-end`` attribute is: :: [action1:]s1,s2...[|action2:s3,s4,s5...] @@ -42,19 +42,17 @@ If actions are omitted, the scripts apply to all actions. Examples: - * myscript1,myscript2 - run scripts for all supported commands - * install:myscript1,myscript2|netboot:myscript3 + * ``myscript1,myscript2`` - run scripts for all supported commands + * ``install:myscript1,myscript2|netboot:myscript3`` - Run scripts ``myscript1`` and ``myscript2`` for nodeset(install), runs ``myscript3`` for nodeset(netboot). -Run scripts 1,2 for nodeset(install), runs script3 for nodeset(netboot). - -All the scripts should be copied to /install/prescripts directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local /install directory (i.e. /install is not mounted from the xCAT management node to the service nodes), you will need to synchronize your /install/prescripts directory to your service node anytime you create new scripts or make changes to existing scripts. +All the scripts should be copied to ``/install/prescripts`` directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local ``/install`` directory (i.e. ``/install`` is not mounted from the xCAT management node to the service nodes), you will need to synchronize your ``/install/prescripts`` directory to your service node anytime you create new scripts or make changes to existing scripts. The following two environment variables will be passed to each script: - * NODES - a comma separated list of node names on which to run the script - * ACTION - current nodeset action. + * ``NODES`` - a comma separated list of node names on which to run the script + * ``ACTION`` - current nodeset action. -By default, the script will be invoked once for all nodes. However, if **'#xCAT setting:MAX_INSTANCE=number'** is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in **number** will be invoked at at a time. +By default, the script will be invoked once for all nodes. However, if ``#xCAT setting:MAX_INSTANCE=`` is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in ```` will be invoked at a time. Exit values for prescripts ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -67,7 +65,7 @@ If there is no error, a prescript should return with 0. If an error occurs, it s If one of the prescripts returns 1, the command will finish the rest of the prescripts in that section and then exit out with value 1. For example, a node has three begin prescripts s1,s2 and s3, three end prescripts s4,s5,s6. If s2 returns 1, the prescript s3 will be executed, but other code and the end prescripts will not be executed by the command. -If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have **'#xCAT setting:MAX_INSTANCE=number'**. +If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have ``#xCAT setting:MAX_INSTANCE=``. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst index e31ba49b8..4b35ba62c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst @@ -72,7 +72,7 @@ You can use the ``updatenode`` command to perform the following functions after * Rerun postscripts defined in the postscripts table. * Run any additional postscript one time. -Go to :ref:`Using-Postscript-label` to see how to configure postscript. +Go to :ref:`Using Postscript ` to see how to configure postscript. Go to :ref:`Using-Prescript-label` to see how to configure prepostscript. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst new file mode 100644 index 000000000..11e0c6c18 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst @@ -0,0 +1,27 @@ + +Using Postscript +---------------- + +Postscript Execution Order Summary +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-----------------------------------------------------------------------------------+ +| Diskful | ++----------------+-------------------------+----------------------------------------+ +| Stage | Scripts | Execute Order | ++================+=========================+========================================+ +| N/A | postinstall | Does not execute for diskfull install | ++----------------+-------------------------+---+------------------------------------+ +| Install/Create | | 1 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | postscripts | 2 | osimage | +| | (execute before reboot) +---+------------------------------------+ +| | | 3 | node | ++----------------+-------------------------+---+------------------------------------+ +| Boot/Reboot | postbootscripts | 4 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | | 5 | osimage | +| | +---+------------------------------------+ +| | | 6 | node | ++----------------+-------------------------+---+------------------------------------+ + +.. include:: ../../../common/deployment/prepostscripts/post_script.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst index f281030d5..150d397de 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst @@ -5,6 +5,6 @@ Prescripts and Postscripts :maxdepth: 2 ../../../common/deployment/prepostscripts/pre_script.rst - ../../../common/deployment/prepostscripts/post_script.rst + ./postscript_execution.rst ../../../common/deployment/prepostscripts/suggestions.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst new file mode 100644 index 000000000..16bab9fa3 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst @@ -0,0 +1,28 @@ + +Using Postscript +---------------- + +Postscript Execution Order Summary +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ++---------------------------------------------------------------------------+ +| Diskless | ++----------------+-----------------+----------------------------------------+ +| Stage | Scripts | Execute Order | ++================+=================+========================================+ +| Install/Create | postinstall | genimage, after packages are installed | ++----------------+-----------------+---+------------------------------------+ +| Boot/Reboot | | 1 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | postscripts | 2 | osimage | +| | +---+------------------------------------+ +| | | 3 | node | +| +-----------------+---+------------------------------------+ +| | postbootscripts | 4 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | | 5 | osimage | +| | +---+------------------------------------+ +| | | 6 | node | ++----------------+-----------------+---+------------------------------------+ + +.. include:: ../../../common/deployment/prepostscripts/post_script.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst index f186b874c..e9502ad3e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst @@ -5,7 +5,7 @@ Prescripts and Postscripts :maxdepth: 2 ../../../common/deployment/prepostscripts/pre_script.rst - ../../../common/deployment/prepostscripts/post_script.rst + ./postscript_execution.rst ../../../common/deployment/prepostscripts/postinstall_script.rst ../../../common/deployment/prepostscripts/suggestions.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 10b395b81..5f784f157 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -19,7 +19,7 @@ Open a console to ``compute1``: :: rcons compute1 -**Note:** The keystroke ``ctrl+e c .`` will disconnect you from the console. +.. note:: The keystroke ``ctrl+e c .`` will disconnect you from the console. Troubleshooting @@ -30,14 +30,14 @@ General ``xCAT`` has been integrated with 3 kinds of console server service, they are - - `conserver `_ + - `conserver `_ **[Deprecated]** - `goconserver `_ - `confluent `_ ``rcons`` command relies on one of them. The ``conserver`` and ``goconserver`` packages should have been installed with xCAT as they are part of the xCAT -dependency packages. If you hope to try ``confluent``, -see `confluent `_. +dependency packages. If you want to try ``confluent``, +see :doc:`confluent server `. For systemd based systems, ``goconserver`` is used by default. If you are having problems seeing the console, try the following. @@ -56,7 +56,7 @@ having problems seeing the console, try the following. #. Invoke the console again: ``rcons `` -More details for goconserver, see `goconserver documentation `_. +More details for goconserver, see :doc:`goconserver documentation `. **[Deprecated]** If ``conserver`` is used, try the following. From d2ebc7ea0015ed6f1ad23a72530c3f1907dc8a78 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 23 Feb 2021 15:34:05 -0500 Subject: [PATCH 11/82] Improve xCAT uninstall on Ubuntu --- xCAT-server/share/xcat/tools/go-xcat | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index c8abf7073..b4e41e529 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.46 +# Version 1.0.47 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -32,6 +32,8 @@ # 2020-5-7 Nic Mays # - Handles 'stable' as a flag to install latest version via the command: # go-xcat --xcat-version=stable install +# 2021-02-18 Mark Gurevich +# - On Ubuntu remove packages one at a time # @@ -176,7 +178,7 @@ GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT-client xCAT xCAT-buildkit xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) -# For Debian/Ubuntu, it will need a sight different package list +# For Debian/Ubuntu, it will need a slightly different package list type dpkg >/dev/null 2>&1 && GO_XCAT_INSTALL_LIST=(perl-xcat xcat-client xcat xcat-buildkit xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server @@ -187,7 +189,7 @@ GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps xCAT-buildkit conserver-xcat) -# For Debian/Ubuntu, it will need a sight different package list +# For Debian/Ubuntu, it will need a slightly different package list type dpkg >/dev/null 2>&1 && GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn @@ -1588,8 +1590,12 @@ function remove_package_apt() type apt-get >/dev/null 2>&1 || return 255 local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift - apt-get --allow-unauthenticated remove "${yes[@]}" "$@" - warn_if_bad "$?" "Unable to remove xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` + # For each package, remove one at a time + for package in "$@" + do + apt-get --allow-unauthenticated remove "${yes[@]}" ${package} + warn_if_bad "$?" "Unable to remove xCAT package ${package}" + done } function remove_package() @@ -1603,8 +1609,12 @@ function purge_package_apt() type apt-get >/dev/null 2>&1 || return 255 local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift - apt-get --allow-unauthenticated purge "${yes[@]}" "$@" - warn_if_bad "$?" "Unable to purge xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` + # For each package, remove one at a time + for package in "$@" + do + apt-get --allow-unauthenticated purge "${yes[@]}" ${package} + warn_if_bad "$?" "Unable to purge xCAT package ${package}" + done } function purge_package_others() From 01780a010e8eb3f7397abc0e5d113e704c06d0e3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 26 Feb 2021 13:00:33 -0500 Subject: [PATCH 12/82] Improve debug messages and comments --- .../share/xcat/install/scripts/getinstdisk | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 43325a4d4..e4d5f395f 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -4,14 +4,15 @@ # # Get proper disk to install OS # -# 1. Check all partitions list in /proc/partitions, whether -# there is disk had OS installed. If there is, add it to +# 1. Check all partitions listed in /proc/partitions, whether +# there is a disk that had OS installed. If there is, add it to # the disk array. -# 2. If there is disk had OS installed, check disks list -# generated in Step 1. Else, check all disks get from -# /proc/partitions file. Sort them by WWN/PATH and driver -# type, select the first one. -# 3. Select the default one: /dev/sda. +# 2. If there is no disk that had OS installed found +# in Step 1, then check all disks in +# /proc/partitions file. Sort them by driver type, then by WWN/PATH +# select the first one. +# 3. If no disks selected in Steps 1 or 2, then +# select the default disk: /dev/sda. # # Output: Install disk name written to /tmp/xcat.install_disk # @@ -182,7 +183,7 @@ if [ -z "$install_disk" ]; then disk_data=$disk_wwn elif [ $has_wwn -eq 1 ]; then echo "[get_install_disk] The disk $disk has no wwn info." - echo "[get_install_disk] There is other disk has wwn info, so don't record this disk." + echo "[get_install_disk] There is another disk with wwn info, so don't record this disk." continue; elif [ "$disk_path" ]; then has_path=1 @@ -190,7 +191,7 @@ if [ -z "$install_disk" ]; then disk_data=$disk_path elif [ $has_path -eq 1 ]; then echo "[get_install_disk] The disk $disk has no wwn or path info." - echo "[get_install_disk] There is other disk has path info, so don't record this disk." + echo "[get_install_disk] There is another disk with path info, so don't record this disk." continue; else file_pre="other" @@ -235,7 +236,7 @@ rm -rf $tmpdir; # Cannot find proper disk for OS install, select the default one "/dev/sda" if [ -z "$install_disk" ]; then install_disk="/dev/sda" - echo "[get_install_disk]Choosing default install_disk is $install_disk." + echo "[get_install_disk]Choosing default install_disk $install_disk." fi # Output the result to $install_disk_file From 617a4ed557a8edc21f6dcce4bdd9f74d61b0c8a6 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 1 Mar 2021 16:52:37 -0500 Subject: [PATCH 13/82] Modify mysqlsetup and restorexCATdb to examine DB restoration delay --- xCAT-client/bin/mysqlsetup | 2 +- xCAT-client/sbin/restorexCATdb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 588db7011..63183c9ea 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -1965,7 +1965,7 @@ sub restorexcatdb } # restore it - my $cmd = "XCATBYPASS=y XCATCFG=\"$xcatcfg\" restorexCATdb -p $::backupdir"; + my $cmd = "XCATBYPASS=y XCATCFG=\"$xcatcfg\" restorexCATdb -p $::backupdir > /tmp/test_delay.log"; # not display passwords in verbose mode my $tmpv = $::VERBOSE; diff --git a/xCAT-client/sbin/restorexCATdb b/xCAT-client/sbin/restorexCATdb index 512ed46cc..881c9628a 100644 --- a/xCAT-client/sbin/restorexCATdb +++ b/xCAT-client/sbin/restorexCATdb @@ -77,9 +77,26 @@ if (@output2) { @skiptbls = split(/\,/, $output2[0]); } +system("date"); +print "\ndf:\n\n"; +system("df"); +print "\n"; +system("lsblk"); +print "\n"; + +print "meminfo:\n\n"; +system("cat /proc/meminfo"); +print "\n"; + +print "/etc/xcat/cfgloc\n\n"; +system("cat /etc/xcat/cfgloc"); +print "\n"; + my @files = readdir(DIRPATH); foreach my $table (@files) { + system("date"); + print "Table: $table\n\n"; if ($table ne '.' and $table ne '..') { my $tablename = $::PATH; From ef814440be3ce2169a5a23539c2ce66234b1a8de Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 3 Mar 2021 13:51:27 -0500 Subject: [PATCH 14/82] Extract correct size of the nvme disk partition --- xCAT-server/share/xcat/install/scripts/getinstdisk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index e4d5f395f..5aff3589f 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -45,9 +45,10 @@ if [ -z "$install_disk" ]; then # Classify entries by DEVTYPE for entry in $entries; do - DEVSIZE=$(udevadm info --attribute-walk --name=$entry|grep size| sed -e 's/[^"]*"//' -e 's/"//'|tail -n 1) + DEVSIZE=$(udevadm info --attribute-walk --name=$entry|grep \{size\}| sed -e 's/[^"]*"//' -e 's/"//'|tail -n 1) if [ -z "$DEVSIZE" -o $DEVSIZE -lt 262144 ]; then # ignore small devices, that are likely remote media or similar + echo "[get_install_disk] Skipping partition $entry. Size too small: $DEVSIZE" continue fi From 94bb4ca4b8f626e579215d5f561321fa898ec968 Mon Sep 17 00:00:00 2001 From: peterwywong <46875219+peterwywong@users.noreply.github.com> Date: Wed, 10 Mar 2021 11:33:08 -0600 Subject: [PATCH 15/82] Revert "Modify mysqlsetup and restorexCATdb to examine DB restoration delay" --- xCAT-client/bin/mysqlsetup | 2 +- xCAT-client/sbin/restorexCATdb | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 63183c9ea..588db7011 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -1965,7 +1965,7 @@ sub restorexcatdb } # restore it - my $cmd = "XCATBYPASS=y XCATCFG=\"$xcatcfg\" restorexCATdb -p $::backupdir > /tmp/test_delay.log"; + my $cmd = "XCATBYPASS=y XCATCFG=\"$xcatcfg\" restorexCATdb -p $::backupdir"; # not display passwords in verbose mode my $tmpv = $::VERBOSE; diff --git a/xCAT-client/sbin/restorexCATdb b/xCAT-client/sbin/restorexCATdb index 881c9628a..512ed46cc 100644 --- a/xCAT-client/sbin/restorexCATdb +++ b/xCAT-client/sbin/restorexCATdb @@ -77,26 +77,9 @@ if (@output2) { @skiptbls = split(/\,/, $output2[0]); } -system("date"); -print "\ndf:\n\n"; -system("df"); -print "\n"; -system("lsblk"); -print "\n"; - -print "meminfo:\n\n"; -system("cat /proc/meminfo"); -print "\n"; - -print "/etc/xcat/cfgloc\n\n"; -system("cat /etc/xcat/cfgloc"); -print "\n"; - my @files = readdir(DIRPATH); foreach my $table (@files) { - system("date"); - print "Table: $table\n\n"; if ($table ne '.' and $table ne '..') { my $tablename = $::PATH; From 3b65b2d89e1a273d95ff0ee3d758ce0ef22ff3c6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 11 Mar 2021 09:13:31 -0500 Subject: [PATCH 16/82] Extend XML Simple to pass parser options --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 2 +- xCAT-server/lib/perl/xCAT/IPMI.pm | 2 +- xCAT-server/lib/perl/xCAT/OPENBMC.pm | 2 +- xCAT-server/lib/perl/xCAT/XML.pm | 83 ++++++++++++++++++++++++ xCAT-server/sbin/xcatd | 35 ++++------ 5 files changed, 98 insertions(+), 26 deletions(-) create mode 100644 xCAT-server/lib/perl/xCAT/XML.pm diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 0873872b7..324d8e451 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -## IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html +## IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html package xCAT::Goconserver; diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 76810de40..3fb50d582 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -# IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html +# IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html #(C)IBM Corp #modified by jbjohnso@us.ibm.com #This module abstracts the session management aspects of IPMI diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 5ace2f59c..030215717 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -## IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html +## IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html package xCAT::OPENBMC; diff --git a/xCAT-server/lib/perl/xCAT/XML.pm b/xCAT-server/lib/perl/xCAT/XML.pm new file mode 100644 index 000000000..972b331d2 --- /dev/null +++ b/xCAT-server/lib/perl/xCAT/XML.pm @@ -0,0 +1,83 @@ +#!/usr/bin/perl +# IBM(c) 2021 EPL license http://www.eclipse.org/legal/epl-v10.html +# +# This module extends XML::Simple class. +# +# For versions of XML::Simple class which implement new_xml_parser(): +# Overwrite XML::Simple::new_xml_parser() to pass parser options +# directly to the XML::Parser. The passing of parser options with +# XML::Simple::XMLin() has been depricated. +# +# +# For older versions of XML::Simple class which do not implement new_xml_parser(): +# Overwrite XML::Simple::build_tree_xml_parser() to pass parser options +# directly to the XML::Parser. The passing of parser options with +# XML::Simple::XMLin() has been depricated. +# +package xCAT::XML; +use XML::Simple; +use xCAT::MsgUtils; +use Carp; +$XML::Simple::PREFERRED_PARSER = 'XML::Parser'; +use parent 'XML::Simple'; + +sub build_tree_xml_parser { + my $self = shift; + my $filename = shift; + my $string = shift; + + # Check if parent class XML::Simple has implemented new_xml_parser(), + # if it has, just call XML::Simple::build_tree_xml_parser() from parent + # and it in turn will call new_xml_parser() overwritten by this module. + # + # If parent class XML::Simple does not have new_xml_parser() implemented, + # fall through and execute the build_tree_xml_parser() overwritten + # by this module. + # + if (exists &{XML::Simple::new_xml_parser}) { + return $self->SUPER::build_tree_xml_parser($filename, $string); + } + + eval { + local($^W) = 0; # Suppress warning from Expat.pm re File::Spec::load() + require XML::Parser; # We didn't need it until now + }; + if($@) { + croak "XMLin() requires either XML::SAX or XML::Parser"; + } + + if($self->{opt}->{nsexpand}) { + carp "'nsexpand' option requires XML::SAX"; + } + + my $xp = XML::Parser->new(Style => 'Tree', + [ load_ext_dtd => 0, + ext_ent_handler => undef, + no_network => 1, + expand_entities => 0, + ]); + my($tree); + if($filename) { + # $tree = $xp->parsefile($filename); # Changed due to prob w/mod_perl + open(my $xfh, '<', $filename) || croak qq($filename - $!); + $tree = $xp->parse($xfh); + } + else { + $tree = $xp->parse($$string); + } + + return($tree); +} + +sub new_xml_parser { + my($self) = @_; + my $xp = XML::Parser->new(Style => 'Tree', + [ load_ext_dtd => 0, + ext_ent_handler => undef, + no_network => 1, + expand_entities => 0, + ]); + $xp->setHandlers(ExternEnt => sub {return $_[2]}); + return $xp; +} +1; diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 0549ef122..e229aa4d1 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -117,9 +117,7 @@ my $dispatch_requests = 1; # govern whether commands are dispatchable use IO::Socket; use IO::Handle; use IO::Select; -use XML::Simple; -$XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use XML::LibXML; +use xCAT::XML; use xCAT::Table; my $dbmaster; use xCAT::ExtTab; @@ -692,12 +690,9 @@ sub do_discovery_process { IO::Uncompress::Gunzip::gunzip(\$data, \$bigdata); $data = $bigdata; } - my $req = eval { XMLin($data, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ - load_ext_dtd => 0, - ext_ent_handler => undef, - no_network => 1, - expand_entities => 0, - ]) }; + my $xs = xCAT::XML->new(); + my $req = eval { $xs->XMLin($data, SuppressEmpty => undef, ForceArray => qr/.*/) }; + xCAT::MsgUtils->message("S", "xcatd: Error parsing XML data - $@") if $@; if ($req and $req->{command} and ($req->{command}->[0] eq "findme" and $sport < 1000)) { # only consider priveleged port requests to start with $req->{'_xcat_clientip'} = $clientip; $req->{'_xcat_clientport'} = $sport; @@ -2688,14 +2683,14 @@ sub send_response { } } } - $xml = XMLout($response, KeyAttr => [], NoAttr => 1, KeepRoot => 1); + $xml = xCAT::XML::XMLout($response, KeyAttr => [], NoAttr => 1, KeepRoot => 1); } else { if ($MYXCATSERVER) { unless (exists($response->{serverdone})) { $response->{xcatdsource}->[0] = $MYXCATSERVER; } } - $xml = XMLout($response, RootName => 'xcatresponse', NoAttr => 1); + $xml = xCAT::XML::XMLout($response, RootName => 'xcatresponse', NoAttr => 1); } $xml =~ tr/\011-\177/?/c; @@ -2720,12 +2715,8 @@ sub send_response { my $cmdlog_xml = ""; $tmp_xml =~ s/\e/xxxxESCxxxx/g; $cmdlog_xml .= $tmp_xml . ""; - my $cmdlog_rsp = XMLin($cmdlog_xml, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ - load_ext_dtd => 0, - ext_ent_handler => undef, - no_network => 1, - expand_entities => 0, - ]); + my $xs = xCAT::XML->new(); + my $cmdlog_rsp = $xs->XMLin($cmdlog_xml, SuppressEmpty => undef, ForceArray => qr/.*/ ); cmdlog_collectlog($cmdlog_rsp); # ----used for command log end -------- @@ -2782,12 +2773,10 @@ sub get_request { return undef; } } - return eval { XMLin($request, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ - load_ext_dtd => 0, - ext_ent_handler => undef, - no_network => 1, - expand_entities => 0, - ]) }; + my $xs = xCAT::XML->new(); + my $request_hash = eval { $xs->XMLin($request, SuppressEmpty => undef, ForceArray => qr/.*/) }; + xCAT::MsgUtils->message("S", "xcatd: Error parsing XML request - $@") if $@; + return $request_hash; } elsif ($encode eq "storable") { my $return = eval { fd_retrieve($sock); }; # suppres end of stream err return $return; From f82b6f48aff6c4ff2d62ec6215e2b4a243905191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= Date: Thu, 11 Mar 2021 17:28:49 -0300 Subject: [PATCH 17/82] Support for Oracle Linux 7 and Oracle Linux 8 --- perl-xCAT/xCAT/data/discinfo.pm | 3 + .../share/xcat/install/ol/compute.ol7.pkglist | 1 + .../share/xcat/install/ol/compute.ol7.tmpl | 1 + .../share/xcat/install/ol/compute.ol8.pkglist | 1 + .../share/xcat/install/ol/compute.ol8.tmpl | 59 +++++++++++++++++++ .../xcat/netboot/ol/compute.ol7.x86_64.exlist | 1 + .../netboot/ol/compute.ol7.x86_64.pkglist | 1 + .../netboot/ol/compute.ol7.x86_64.postinstall | 1 + .../xcat/netboot/ol/compute.ol8.x86_64.exlist | 1 + .../netboot/ol/compute.ol8.x86_64.pkglist | 1 + .../netboot/ol/compute.ol8.x86_64.postinstall | 1 + xCAT-server/share/xcat/netboot/ol/dracut_047 | 1 + xCAT-server/share/xcat/netboot/ol/geninitrd | 1 + xCAT-server/share/xcat/netboot/rh/genimage | 29 +++++++++ 14 files changed, 102 insertions(+) create mode 120000 xCAT-server/share/xcat/install/ol/compute.ol7.pkglist create mode 120000 xCAT-server/share/xcat/install/ol/compute.ol7.tmpl create mode 120000 xCAT-server/share/xcat/install/ol/compute.ol8.pkglist create mode 100644 xCAT-server/share/xcat/install/ol/compute.ol8.tmpl create mode 120000 xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist create mode 120000 xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall create mode 120000 xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist create mode 120000 xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall create mode 120000 xCAT-server/share/xcat/netboot/ol/dracut_047 create mode 120000 xCAT-server/share/xcat/netboot/ol/geninitrd diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 5f3b2724f..5d59a2707 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -135,6 +135,9 @@ our %distnames = ( "1299104542.844706" => "SL6", #x86_64 DVD ISO "1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install + "1601956087.745957" => "ol7.9", # x86_64, Oracle Linux 7.9 + "1604965593.730885" => "ol8.3", # x86_64, Oracle Linux 8.3 + "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM ); diff --git a/xCAT-server/share/xcat/install/ol/compute.ol7.pkglist b/xCAT-server/share/xcat/install/ol/compute.ol7.pkglist new file mode 120000 index 000000000..57567949a --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol7.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels7.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/compute.ol7.tmpl b/xCAT-server/share/xcat/install/ol/compute.ol7.tmpl new file mode 120000 index 000000000..f44d7121c --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol7.tmpl @@ -0,0 +1 @@ +../rh/compute.rhels7.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/compute.ol8.pkglist b/xCAT-server/share/xcat/install/ol/compute.ol8.pkglist new file mode 120000 index 000000000..ccb1fe4ef --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol8.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/compute.ol8.tmpl b/xCAT-server/share/xcat/install/ol/compute.ol8.tmpl new file mode 100644 index 000000000..746eb1ad5 --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol8.tmpl @@ -0,0 +1,59 @@ +#version=OL8 +# Use text install +text +# Use network installation +%include /tmp/repos +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +#KICKSTARTNET# +# Root password +rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password# +# Not run the Setup Agent on first boot +firstboot --disable +# Do not configure the X Window System +skipx +# System services +#services --enabled="chronyd" +# System timezone +timezone #TABLE:site:key=timezone:value# --isUtc +# Partition clearing information +zerombr +clearpart --all --initlabel +#XCAT_PARTITION_START# +%include /tmp/partitionfile +#XCAT_PARTITION_END# + +# Do not configure any iptables rules +firewall --disable +selinux --disable +reboot + +%packages +#INCLUDE_DEFAULT_PKGLIST# + +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +%end +%pre +{ +echo "Running Kickstart Pre-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# +} &>>/tmp/pre-install.log +%end +%post --interpreter=/bin/bash +mkdir -p /var/log/xcat/ +cat /tmp/pre-install.log >>/var/log/xcat/xcat.log +{ +echo "Running Kickstart Post-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels8# +} &>>/var/log/xcat/xcat.log +%end diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist new file mode 120000 index 000000000..338644a02 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels7.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist new file mode 120000 index 000000000..1161417ef --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels7.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall new file mode 120000 index 000000000..f8605039f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels7.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist new file mode 120000 index 000000000..a6d9c0135 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist new file mode 120000 index 000000000..5ecd4c4d1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall new file mode 120000 index 000000000..3e16d254e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/dracut_047 b/xCAT-server/share/xcat/netboot/ol/dracut_047 new file mode 120000 index 000000000..fe26fce05 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/dracut_047 @@ -0,0 +1 @@ +../rh/dracut_047 \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/geninitrd b/xCAT-server/share/xcat/netboot/ol/geninitrd new file mode 120000 index 000000000..073e03e56 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/geninitrd @@ -0,0 +1 @@ +../rh/geninitrd \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 0620ec5af..e457304f5 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -365,6 +365,14 @@ if($onlyinitrd){ $yumcmd .= "--setopt=module_platform_id=platform:el" . $majorrel . " "; } } + + if ($osver =~ /^ol\D*(\d*)[.\d]*.*$/) { + $majorrel = $1; + if ($majorrel > 7) { + $yumcmd .= "--releasever=" . $majorrel . " "; + $yumcmd .= "--setopt=module_platform_id=platform:el" . $majorrel . " "; + } + } foreach (0 .. $repnum) { $yumcmd .= "--enablerepo=$osver-$arch-$_ "; @@ -784,6 +792,18 @@ if (-e "$rootimg_dir/etc/yum.repos.d/CentOS-Base.repo") { } # +#-- Oracle Linux, disable internet repositories +if (-e "$rootimg_dir/etc/yum.repos.d/oracle-linux-ol8.repo") { + my $repo_content = `sed -e '/enabled/d' $rootimg_dir/etc/yum.repos.d/oracle-linux-ol8.repo | sed -e '/^gpgkey/i enabled=0'`; + system("echo '$repo_content' > $rootimg_dir/etc/yum.repos.d/oracle-linux-ol8.repo"); +} + +if (-e "$rootimg_dir/etc/yum.repos.d/uek-ol8.repo") { + my $repo_content = `sed -e '/enabled/d' $rootimg_dir/etc/yum.repos.d/uek-ol8.repo | sed -e '/^gpgkey/i enabled=0'`; + system("echo '$repo_content' > $rootimg_dir/etc/yum.repos.d/uek-ol8.repo"); +} +# + #-- run postinstall script unless ($imagename) { $postinstall_filename = imgutils::get_profile_def_filename($osver, $profile, $arch, $customdir, "postinstall"); @@ -1005,6 +1025,11 @@ sub mkinitrd_dracut { $dracutmoduledir = "$rootimg_dir/usr/lib/dracut/modules.d/"; } + # For whatever reasons Oracle Linux have both /usr/lib/dracut and /usr/share/dracut folders + # so we just check if it /etc/oracle-release exists and force the correct path + if ((-f "$rootimg_dir/etc/oracle-release")) { + $dracutmoduledir = "$rootimg_dir/usr/lib/dracut/modules.d/"; + } if ($dracutver >= "033") { my $perm = (stat("$fullpath/$dracutdir/patch/syslog/module-setup.sh"))[2]; @@ -1950,6 +1975,10 @@ sub using_systemd { if ($1 >= 7) { return 1; } + } elsif ($os =~ /ol(\d+)/) { + if ($1 >= 7) { + return 1; + } } elsif ($os =~ /rhelhpc(\d+)/) { if ($1 >= 7) { return 1; From 0495fb0ffca3ff11b77c68548e978a3f8b8d1ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vini=CC=81cius=20Ferra=CC=83o?= Date: Fri, 12 Mar 2021 18:17:10 -0300 Subject: [PATCH 18/82] Added discinfo values for all active releases --- perl-xCAT/xCAT/data/discinfo.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 5d59a2707..fd9b40f0b 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -135,7 +135,13 @@ our %distnames = ( "1299104542.844706" => "SL6", #x86_64 DVD ISO "1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install + "1529960248.065311" => "ol6.10", # x86_64, Oracle Linux 6.10 + "1565395001.564692" => "ol7.7", # x86_64, Oracle Linux 7.8 + "1586293815.797636" => "ol7.8", # x86_64, Oracle Linux 7.8 "1601956087.745957" => "ol7.9", # x86_64, Oracle Linux 7.9 + "1563868563.575621" => "ol8.0", # x86_64, Oracle Linux 8.0 + "1573718260.172018" => "ol8.1", # x86_64, Oracle Linux 8.1 + "1588679121.349755" => "ol8.2", # x86_64, Oracle Linux 8.2 "1604965593.730885" => "ol8.3", # x86_64, Oracle Linux 8.3 "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM From 2556112b24d214b3ccc777ba20c2f2e99230f247 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 15 May 2020 11:57:25 -0400 Subject: [PATCH 19/82] Support 'Full' media variant for SLES SUSE sometimes publishes distro as a single media --- xCAT-server/lib/xcat/plugins/sles.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 0eb2e9a4d..ffc5332a0 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1769,6 +1769,15 @@ sub copycd $distname = "sle15"; } }; + } elsif ($dsc =~ /SLE-15/ and $dsc =~ /Full/) { + $discnumber = 1; + unless ($distname) { + if ($dsc =~ /SLE-15-SP(\d)/) { + $distname = "sle15.$1"; + } else { + $distname = "sle15"; + } + }; } } From ecc26ed6943d03b81a36adaa01b5d810adc407d1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 Nov 2020 11:46:09 -0500 Subject: [PATCH 20/82] Workaround SuSE Full media difference Profiles written around the initial SuSE15 concept of 'Installer' and 'Packages' expect Packages in 2. Workaround by symlinking a 2 when needed. --- xCAT-server/lib/xcat/plugins/sles.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index ffc5332a0..dea6643b7 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1631,6 +1631,7 @@ sub copycd #parse the disc info of the os media to get the distribution, arch of the os my $discnumber; my $darch; + my $linktwo = 0; if (-r $mntpath . "/content") { my $dinfo; @@ -1771,6 +1772,7 @@ sub copycd }; } elsif ($dsc =~ /SLE-15/ and $dsc =~ /Full/) { $discnumber = 1; + $linktwo = 1; unless ($distname) { if ($dsc =~ /SLE-15-SP(\d)/) { $distname = "sle15.$1"; @@ -1903,6 +1905,7 @@ sub copycd rmtree($ospkgpath); } mkpath("$ospkgpath"); + if ($linktwo) { symlink("$path/$discnumber", "$path/2"); } my $omask = umask 0022; umask $omask; From d464c4fc6c1365ee9f2b13dcf91183d9ff56f841 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 Mar 2021 16:08:35 -0400 Subject: [PATCH 21/82] Add support for SLES15 SP2 --- xCAT-server/lib/perl/xCAT/Template.pm | 3 +++ xCAT-server/share/xcat/install/sles/compute.sle15.pkglist | 1 + 2 files changed, 4 insertions(+) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 0da104fa0..bbfec6d95 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -342,6 +342,9 @@ sub subvars { $product_dir=$subdir; if($subdir =~ /^Module-/){ $product_name="sle-".lc($subdir); + }elsif($subdir =~ /^Product-SUSE-Manager-Server|^Product-SLES_SAP/){ + # Skip product directories that are not "SLES", causes conflict on SLE15.2 + next; }elsif($subdir =~ /^Product-/){ $subdir=~s/Product-//; $product_name=$subdir; diff --git a/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist b/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist index 1e72952ac..9fee9c520 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist +++ b/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist @@ -6,3 +6,4 @@ insserv-compat net-tools-deprecated rsyslog nfs-client +wget From 42ffdddf9b3007e23974e32dd84987398beaa44b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 Mar 2021 17:33:13 -0400 Subject: [PATCH 22/82] For x86 also need to exclude Product-SLED --- xCAT-server/lib/perl/xCAT/Template.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index bbfec6d95..1069de7d7 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -342,7 +342,7 @@ sub subvars { $product_dir=$subdir; if($subdir =~ /^Module-/){ $product_name="sle-".lc($subdir); - }elsif($subdir =~ /^Product-SUSE-Manager-Server|^Product-SLES_SAP/){ + }elsif($subdir =~ /^Product-SUSE-Manager-Server|^Product-SLES_SAP|^Product-SLED/){ # Skip product directories that are not "SLES", causes conflict on SLE15.2 next; }elsif($subdir =~ /^Product-/){ From 219b6f9cacf11f3a704ddf8a39e879b1795b1bd5 Mon Sep 17 00:00:00 2001 From: besawn <38794505+besawn@users.noreply.github.com> Date: Wed, 17 Mar 2021 15:59:46 -0400 Subject: [PATCH 23/82] genimage doc updates: fixed typo, formating fix, minor rewording, updated os examples --- .../references/man1/genimage.1.rst | 19 ++++++++----------- xCAT-client/pods/man1/genimage.1.pod | 19 ++++++++----------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/genimage.1.rst b/docs/source/guides/admin-guides/references/man1/genimage.1.rst index d28fd3880..85107fe69 100644 --- a/docs/source/guides/admin-guides/references/man1/genimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/genimage.1.rst @@ -33,14 +33,13 @@ DESCRIPTION Generates a stateless and a statelite image that can be used to boot xCAT nodes in a diskless mode. -genimage will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings, and will be written back to the osimage definition. +\ **genimage**\ will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings and will be written back to the osimage definition. If \ **genimage**\ runs on the management node, both the \ *osimage*\ table and \ *linuximage*\ table will be updated with the given values from the options. -The \ **genimage**\ command will generate two initial ramdisks for \ **stateless**\ and \ **statelite**\ , one is \ **initrd-stateless.gz**\ , the other one is \ **initrd-statelite.gz**\ . +The \ **genimage**\ command will generate two initial ramdisks, \ **initrd-stateless.gz**\ for \ **stateless**\ mode, and \ **initrd-statelite.gz**\ for \ **statelite**\ mode. -After your image is generated, you can chroot to the -image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. +After your image is generated, you can chroot to the image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. for stateless: \ **packimage**\ @@ -50,8 +49,7 @@ Besides prompting for some parameter values, the \ **genimage**\ command takes If \ **-**\ **-onlyinitrd**\ is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. -The \ **genimage**\ command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be -used on. If the management node is not the same architecture or same distro level, copy the contents of +The \ **genimage**\ command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be used on. If the management node is not the same architecture or same distro level, copy the contents of /opt/xcat/share/xcat/netboot/ to a system that is the proper architecture, and mount /install from the management node to that system. Then change directory to /opt/xcat/share/xcat/netboot/ and run ./genimage. @@ -72,13 +70,13 @@ OPTIONS \ **-a**\ \ *arch*\ - The hardware architecture of this node: x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. + The hardware architecture of this node: ppc64le, x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. \ **-o**\ \ *osver*\ - The operating system for the image: fedora8, rhel5, sles10, etc. The OS packages must be in + The operating system for the image: rhels8.2.0, sle15, ubuntu18.04.2, etc. The OS packages must be in /install// (use copycds(8)|copycds.8). @@ -121,10 +119,9 @@ OPTIONS Regenerates the initrd for a stateless image to be used for a diskless install. - Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/stateli - te mode. + Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/statelite mode. - The \ **genimage -**\ **-onlyinitrd**\ command will generate two initial ramdisks, one is \ **initrd-statelite.gz**\ for \ **statelite**\ mode, the other one is \ **initrd-stateless.gz**\ for \ **stateless**\ mode. + The \ **genimage -**\ **-onlyinitrd**\ command will generate two initial ramdisks, \ **initrd-stateless.gz**\ for \ **stateless**\ mode, and \ **initrd-statelite.gz**\ for \ **statelite**\ mode. diff --git a/xCAT-client/pods/man1/genimage.1.pod b/xCAT-client/pods/man1/genimage.1.pod index 56dfb2af1..8145a637e 100644 --- a/xCAT-client/pods/man1/genimage.1.pod +++ b/xCAT-client/pods/man1/genimage.1.pod @@ -16,14 +16,13 @@ B [B<-h> | B<--help> | B<-v> | B<--version>] Generates a stateless and a statelite image that can be used to boot xCAT nodes in a diskless mode. -genimage will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings, and will be written back to the osimage definition. +B will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings and will be written back to the osimage definition. If B runs on the management node, both the I table and I table will be updated with the given values from the options. -The B command will generate two initial ramdisks for B and B, one is B, the other one is B. +The B command will generate two initial ramdisks, B for B mode, and B for B mode. -After your image is generated, you can chroot to the -image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. +After your image is generated, you can chroot to the image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. for stateless: B @@ -33,8 +32,7 @@ Besides prompting for some parameter values, the B command takes defau If B<--onlyinitrd> is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. -The B command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be -used on. If the management node is not the same architecture or same distro level, copy the contents of +The B command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be used on. If the management node is not the same architecture or same distro level, copy the contents of /opt/xcat/share/xcat/netboot/ to a system that is the proper architecture, and mount /install from the management node to that system. Then change directory to /opt/xcat/share/xcat/netboot/ and run ./genimage. @@ -50,11 +48,11 @@ I specifies the name of an os image definition to be used. The specif =item B<-a> I -The hardware architecture of this node: x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. +The hardware architecture of this node: ppc64le, x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. =item B<-o> I -The operating system for the image: fedora8, rhel5, sles10, etc. The OS packages must be in +The operating system for the image: rhels8.2.0, sle15, ubuntu18.04.2, etc. The OS packages must be in /install// (use L). =item B<-p> I @@ -88,10 +86,9 @@ The maximum size allowed for the root file system in the image. Specify in byte Regenerates the initrd for a stateless image to be used for a diskless install. -Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/stateli -te mode. +Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/statelite mode. -The B command will generate two initial ramdisks, one is B for B mode, the other one is B for B mode. +The B command will generate two initial ramdisks, B for B mode, and B for B mode. =item B<--permission> I From e6a7a2d33250ca55ff41022fa3c1cf326026d8f2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 18 Mar 2021 16:59:23 -0400 Subject: [PATCH 24/82] Add repositories for diskless image generation --- xCAT-server/share/xcat/netboot/sles/genimage | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 049c1b681..7f299e84b 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -299,12 +299,20 @@ unless ($onlyinitrd) { if (-d "$dir/1") { $ddir .= "/1"; } - system("zypper -R $rootimg_dir $non_interactive ar file:$ddir $osver-$i"); - $i++; - if (-d "$dir/2") { - $ddir = $dir . "/2"; + if ($osver =~ "^sle15.2") { + # For SLE15 SP2 need 'baseurl' to point to a 3 module subdirs + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Product-SLES $osver-$i-Product-SLES"); + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Basesystem $osver-$i-Module-Basesystem"); + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Legacy $osver-$i-Module-Legacy"); + + } else { system("zypper -R $rootimg_dir $non_interactive ar file:$ddir $osver-$i"); $i++; + if (-d "$dir/2") { + $ddir = $dir . "/2"; + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir $osver-$i"); + $i++; + } } } From 237c7fee91001e0366e1ad8f021f7d96198df62b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 Mar 2021 15:56:07 -0400 Subject: [PATCH 25/82] Additional packages locations for diskless image generation --- xCAT-server/share/xcat/netboot/sles/genimage | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 7f299e84b..1e944441d 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -2006,7 +2006,13 @@ sub generic_post { # This function is meant to leave the image in a state approx print $cfgfile "NETWORKING=yes\n"; close($cfgfile); - # SLE15 has a symlink to /run/netconfig/resolv.conf and does not need a dummy file + # SLE15.2 has a symlink to /run/netconfig/resolv.conf but still need a dummy file + if (-l "$rootimg_dir/etc/resolv.conf" && $osver =~ "15.2") { + # Remove resolv.conf, so that link is gone and code below will + # create a dummy file + unlink("$rootimg_dir/etc/resolv.conf"); + } + # SLE15.0 has a symlink to /run/netconfig/resolv.conf and does not need a dummy file if (! -l "$rootimg_dir/etc/resolv.conf") { open($cfgfile, ">", "$rootimg_dir/etc/resolv.conf"); print $cfgfile "#Dummy resolv.conf to make boot cleaner"; From 5ead6c1bdaa2b85577ea14a90bc0b0eaee980964 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 23 Mar 2021 15:34:39 -0400 Subject: [PATCH 26/82] Use 'find' to reliably find vmlinu* file on the partition --- xCAT-server/share/xcat/install/scripts/getinstdisk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 5aff3589f..f5586c14d 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -109,7 +109,7 @@ if [ -z "$install_disk" ]; then # If there is kernel file, add partition's disk into disk_array # It seems the kernel file in ubuntu and sles are named like vmlinux, but in RH it is called vmlinuz # To check both vmlinux and vmlinuz, use regular expression "vmlinu*" to match them - for i in $ker_dir/vmlinu*; do + for i in $(find $ker_dir -maxdepth 1 -name "vmlinu*"); do case $partition in nvme*) # Expected nvme partition format example: nvme0n1p1 From 12a72dcfb7bdc5bc81f49a06ca7a49cffcaddf64 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 24 Mar 2021 10:25:18 -0400 Subject: [PATCH 27/82] Make compute.sles12.ppc64le.tmpl the same as compute.sles12.tmpl --- .../install/sles/compute.sles12.ppc64le.tmpl | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl index f3f8be272..7062fedaa 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl @@ -12,7 +12,7 @@ - GMT + UTC #TABLE:site:key=timezone:value# @@ -40,42 +40,6 @@ XCATPARTITIONHOOK true all - - - true - false - device - 65 - 1 - false - 8225280 - - - true - false - swap - true - false - swap - uuid - 130 - 2 - false - auto - - - true - false - btrfs - true - false - / - uuid - 131 - 3 - 100% - - From d1108776cdee296b6d3ba2b943b2507e7b81d2f2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 25 Mar 2021 16:02:51 -0400 Subject: [PATCH 28/82] xcatprobe fixes --- xCAT-probe/subcmds/xcatmn | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index f2f6ed1da..1a4ce1dac 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -110,8 +110,9 @@ sub do_main_job { $rc |= $rst; #check DNS service - $rst = check_dns_service(\%sitetable, $installnicip, \$checkpoint, \@error); - print_check_result($checkpoint, "f", $rst, \@error); + ($rst, $flag) = check_dns_service(\%sitetable, $installnicip, \$checkpoint, \@error); + print_check_result($checkpoint, $flag, $rst, \@error); + $rst = 0 if ($flag == "w"); $rc |= $rst; #check DHCP service @@ -173,7 +174,8 @@ sub do_main_job { $rst = check_dhcp_leases(\$checkpoint, \@error); print_check_result($checkpoint, "w", $rst, \@error); $rc |= $rst; - } else { + + #check if database packages are installed $rst = check_db_pkgs(\$checkpoint, \@error); print_check_result($checkpoint, "f", $rst, \@error); $rc |= $rst; @@ -893,7 +895,7 @@ sub check_log_record { my @grep_logs = `grep "$log_msg on SN" $log_file | grep -v "Allowing" | grep -v "dispatch"`; foreach my $grep_log (@grep_logs) { - if ($grep_log =~ /.+ \d+:\d+:\d+ (\w+) xcat: $log_msg on SN/) { + if ($grep_log =~ /.+ \d+:\d+:\d+ (\w+) xcat.*: .* $log_msg on SN/) { push @checked_nodes, $1; } } @@ -901,7 +903,7 @@ sub check_log_record { my %hash_pass = map{$_=>1} @checked_nodes; my @error_nodes = grep {!$hash_pass{$_}} @valid_nodes; if (@error_nodes) { - push @$error_ref, "Failed to store logs come from " . join(",", @error_nodes) . " to $log_file on MN"; + push @$error_ref, "Failed to store logs sent from SN " . join(",", @error_nodes) . " to $log_file on MN"; $rst = 1; } if (@invld_nodes) { @@ -1005,13 +1007,30 @@ sub check_dns_service { } } else { - # if there is no sn, nslookup mnip + # if there is no sn, "nslookup mnip mnip" my $nslkp = `nslookup -type=A $serverip $serverip 2>&1`; chomp($nslkp); my $tmp = grep { $_ =~ "Server:[\t\s]*$serverip" } split(/\n/, $nslkp); if (!$tmp) { $rc = 1; } + # now check if nameserver in /etc/resolv.conf can resolve server name + my $nslkp = `nslookup -type=A $serverip 2>&1`; + chomp($nslkp); + my $nameserverip = "n/a"; + if ($nslkp =~ /Server:[\t\s]*(\d+).(\d+).(\d+).(\d+)/) { + $nameserverip = "$1.$2.$3.$4"; + } + if ($nslkp =~ /server can't find/) { + push @$error_ref, "DNS nameserver $nameserverip can not resolve $serverip"; + # Just a warning + return (1, 'w'); + } + if ($nslkp =~ /no servers could be reached/) { + push @$error_ref, "DNS nameserver can not be reached"; + # Just a warning + return (1, 'w'); + } } if ($rc) { push @$error_ref, "DNS service isn't ready on $serverip"; @@ -1023,7 +1042,7 @@ sub check_dns_service { $rst = 2; } - return $rst; + return ($rst, 'f'); } @@ -1284,7 +1303,7 @@ sub check_db_pkgs { my $error_ref = shift; my $rst = 0; - $$checkpoint_ref = "Checking DB packages installatio..."; + $$checkpoint_ref = "Checking DB packages installation..."; @$error_ref = (); my $cfgloc_file = "/etc/xcat/cfgloc"; @@ -1298,7 +1317,7 @@ sub check_db_pkgs { my $db_name; if ($db_type eq "mysql") { $db_name = "perl-DBD-MySQL or perl-DBD-mysql"; - $db_pkg = `rpm qa | grep -e perl-DBD-MySQL -e perl-DBD-mysql`; + $db_pkg = `rpm -qa | grep -e perl-DBD-MySQL -e perl-DBD-mysql`; } elsif ($db_type eq "Pg") { $db_name = "perl-DBD-Pg"; $db_pkg = `rpm -qa | grep $db_name`; From c2220cd6958abe49763694089e5907a3d351257c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 26 Mar 2021 12:34:50 -0400 Subject: [PATCH 29/82] Eliminate specifically checking for OS version --- xCAT-server/share/xcat/netboot/sles/genimage | 23 +++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 1e944441d..c3f623ae9 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -299,8 +299,8 @@ unless ($onlyinitrd) { if (-d "$dir/1") { $ddir .= "/1"; } - if ($osver =~ "^sle15.2") { - # For SLE15 SP2 need 'baseurl' to point to a 3 module subdirs + if (-d "$ddir/Product-SLES" && -d "$ddir/Module-Basesystem" && -d "$ddir/Module-Legacy") { + # If "Modile" and "Product" directories are there, use them for package repositories system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Product-SLES $osver-$i-Product-SLES"); system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Basesystem $osver-$i-Module-Basesystem"); system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Legacy $osver-$i-Module-Legacy"); @@ -2006,14 +2006,21 @@ sub generic_post { # This function is meant to leave the image in a state approx print $cfgfile "NETWORKING=yes\n"; close($cfgfile); - # SLE15.2 has a symlink to /run/netconfig/resolv.conf but still need a dummy file - if (-l "$rootimg_dir/etc/resolv.conf" && $osver =~ "15.2") { - # Remove resolv.conf, so that link is gone and code below will - # create a dummy file - unlink("$rootimg_dir/etc/resolv.conf"); + # Check resolv.conf file. + # If it is a link and link leads to an empty file, remove that link + # If it is a link and link leads to a non emply file, leave it alone + # If it is not a link, fill it it with some "dummy" text + if (-l "$rootimg_dir/etc/resolv.conf" ) { + my $link_file = readlink "$rootimg_dir/etc/resolv.conf"; + if (-z "$rootimg_dir/$link_file") { + # Link leading to an empty file + # Remove resolv.conf, so that link is gone and code below will + # create a dummy file + unlink("$rootimg_dir/etc/resolv.conf"); + } } - # SLE15.0 has a symlink to /run/netconfig/resolv.conf and does not need a dummy file if (! -l "$rootimg_dir/etc/resolv.conf") { + # Not a link, fill in with "dummy" text open($cfgfile, ">", "$rootimg_dir/etc/resolv.conf"); print $cfgfile "#Dummy resolv.conf to make boot cleaner"; close($cfgfile); From cdc565ff04d69cb365e03e42dda79ac2dea25c09 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 1 Apr 2021 14:03:15 -0400 Subject: [PATCH 30/82] SLES15.2 service node pkglist needs wget --- xCAT-server/share/xcat/install/sles/service.sle15.pkglist | 2 +- xCAT-server/share/xcat/netboot/sles/genimage | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/sles/service.sle15.pkglist b/xCAT-server/share/xcat/install/sles/service.sle15.pkglist index 63bff5bf3..a2bf0e341 100644 --- a/xCAT-server/share/xcat/install/sles/service.sle15.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sle15.pkglist @@ -22,4 +22,4 @@ perl-DBD-mysql mariadb-client #libmysqlclient18 vim - +wget diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index c3f623ae9..54c7b1808 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -300,7 +300,7 @@ unless ($onlyinitrd) { $ddir .= "/1"; } if (-d "$ddir/Product-SLES" && -d "$ddir/Module-Basesystem" && -d "$ddir/Module-Legacy") { - # If "Modile" and "Product" directories are there, use them for package repositories + # If "Module" and "Product" directories are there, use them for package repositories system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Product-SLES $osver-$i-Product-SLES"); system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Basesystem $osver-$i-Module-Basesystem"); system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Legacy $osver-$i-Module-Legacy"); From e1319979be1afb84fbed115c1c8ff72b1d99f9e5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Apr 2021 11:20:51 -0400 Subject: [PATCH 31/82] Use correct zypper flag --auto-agree-with-licenses --- xCAT/postscripts/otherpkgs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 38a535a98..131787d13 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -843,9 +843,9 @@ EOF` fi elif [ $haszypper -eq 1 ]; then if [ $VERBOSE ]; then - echo "$envlist zypper --non-interactive update --auto-agree-with-license" + echo "$envlist zypper --non-interactive update --auto-agree-with-licenses" fi - result=`eval $envlist zypper --non-interactive update --auto-agree-with-license 2>&1` + result=`eval $envlist zypper --non-interactive update --auto-agree-with-licenses 2>&1` R=$? if [ $R -ne 0 ]; then From e4619859c0906bf32c63931da5b4beeee6e77502 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Apr 2021 13:13:27 -0400 Subject: [PATCH 32/82] Use correct Perl string compare operator --- xCAT-client/bin/mysqlsetup | 4 ++-- xCAT-probe/subcmds/xcatmn | 10 +++++----- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 588db7011..48a15f8d3 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -152,7 +152,7 @@ $::linuxos = xCAT::Utils->osver(); my $sp1flag; # if linuxos==sles12 -if ($::linuxos == "sles12") { +if ($::linuxos eq "sles12") { # open /etc/os-release my @lines; @@ -930,7 +930,7 @@ sub initmysqldb $cmd = "$sqlcmd --user=mysql"; #on rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip, #but it's available at the /usr/bin/resolveip - if ($::linuxos == "rhels7.7") { + if ($::linuxos eq "rhels7.7") { my $resolveip="/usr/libexec/resolveip"; if (!(-x ($resolveip))) { my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index f2f6ed1da..099bc4dcb 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -62,7 +62,7 @@ sub do_main_job { #check if all xcat daemons are running ($rst, $flag) = check_all_xcat_daemons(\$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); return $rst if ($rst); #check if xcatd can receive request @@ -89,13 +89,13 @@ sub do_main_job { #check important directory ($rst, $flag) = check_directory(\%sitetable, \$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check if SElinux is disabled ($rst, $flag) = check_selinux(\$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check http service @@ -106,7 +106,7 @@ sub do_main_job { #check tftp service ($rst, $flag) = check_tftp_service($installnicip, \$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check DNS service @@ -310,7 +310,7 @@ sub check_all_xcat_daemons { foreach my $daemon (@daemon_list) { my $counter = $output =~ s/$daemon/$daemon/g; if ($counter > 1) { - if ($daemon == "SSL listener") { + if ($daemon eq "SSL listener") { my $cur_pid = `cat /var/run/xcatd.pid`; my @ssl_pids = `ps aux 2>&1|grep -v grep|grep "xcatd: $daemon"|awk -F' ' '{print \$2}'`; foreach my $ssl_pid (@ssl_pids) { diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 456a8b802..19076b962 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1496,7 +1496,7 @@ sub parse_args { # Updateid was passed, check flags allowed with update id if ($option_flag !~ /^--delete$|^-a$|^--activate$/) { my $optional_help_msg = ""; - if ($option_flag == "-d") { + if ($option_flag eq "-d") { # For this special case, -d was changed to pass in a directory. $optional_help_msg = "Did you mean --delete?" } From 93d9eb72c621de0a8d88d0098d166080a531b891 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Apr 2021 14:41:56 -0400 Subject: [PATCH 33/82] Move to bionic release for Travis --- .travis.yml | 5 ++--- travis.pl | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8f18824b..a9ede4ae6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ os: linux -dist: xenial -sudo: required +dist: bionic before_install: -- sudo apt-get install -y git fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common +- sudo apt-get install -y git fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl libcgi-pm-perl quilt openssh-server dpkg looptools genometools software-properties-common - perl -v #- echo "yes" | sudo cpan -f -i Capture::Tiny diff --git a/travis.pl b/travis.pl index abcf39047..5cab615ec 100644 --- a/travis.pl +++ b/travis.pl @@ -327,10 +327,10 @@ sub install_xcat{ my @cmds = ("cd ./../../xcat-core && sudo ./mklocalrepo.sh", "sudo chmod 777 /etc/apt/sources.list", - "sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list", - "sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep bionic main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep bionic main\" >> /etc/apt/sources.list", "sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -", - "sudo apt-get -qq update"); + "sudo apt-get -qq --allow-insecure-repositories update"); my @output; foreach my $cmd (@cmds){ print "[install_xcat] running $cmd\n"; From f90883b31ff4e35c72e3971ac18c9ef839ae3178 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 6 Apr 2021 13:44:26 -0400 Subject: [PATCH 34/82] Fixes after review --- xCAT-probe/subcmds/xcatmn | 84 ++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 1a4ce1dac..2dcfec712 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -48,7 +48,7 @@ Description: Options: -h : Get usage information of $program_name -V : Output more information for debug - -i : Specify the network interface name of provision network on management node. if not specified, will guess the provision network from site table master attribute. Recommand to use -i option. If there is vlan in the network interface, provide the network interface with vlan infomation, such as '-i .'. + -i : Specify the network interface name of provision network on management node. if not specified, will guess the provision network from 'site' table 'master' attribute. Use of '-i' option is recommended. If there is vlan in the network interface, provide the network interface with vlan information, such as '-i .'. "; sub do_main_job { @@ -152,7 +152,7 @@ sub do_main_job { print_check_result($checkpoint, $flag, $rst, \@error); $rc |= $rst; - #some sepecific check points in MN + #some specific check points in MN if (!$is_sn) { #check xCAT daemon attributes configuration @@ -174,13 +174,13 @@ sub do_main_job { $rst = check_dhcp_leases(\$checkpoint, \@error); print_check_result($checkpoint, "w", $rst, \@error); $rc |= $rst; - - #check if database packages are installed - $rst = check_db_pkgs(\$checkpoint, \@error); - print_check_result($checkpoint, "f", $rst, \@error); - $rc |= $rst; } + #check if database packages are installed + $rst = check_db_pkgs(\$checkpoint, \@error); + print_check_result($checkpoint, "f", $rst, \@error); + $rc |= $rst; + cleanup(); return $rc; } @@ -350,7 +350,7 @@ sub check_xcatd_receive_request { push @$error_ref, $_ foreach (@lines); $rst = 1; }elsif($cmdoutput =~ /Permission denied for request/){ - push @$error_ref, "Permission denied for request, please checking xcatd"; + push @$error_ref, "Permission denied for request, check xcatd"; $rst = 1; } return $rst if ($rst); @@ -363,7 +363,7 @@ sub check_xcatd_receive_request { if ($port) { my $cmdoutput = `netstat -ant 2>&1|grep LISTEN|grep $port`; if ($?) { - push @$error_ref, "Attribute '$port_attr' in site table is set to $port, but xcatd isn't listening on $port"; + push @$error_ref, "Attribute '$port_attr' in 'site' table is set to $port, but xcatd isn't listening on $port"; $rst = 1; } } else { @@ -398,10 +398,10 @@ sub check_site_table { if (($attr eq "master") and (!xCAT::NetworkUtils->isIpaddr("$value"))) { my $masterip = xCAT::NetworkUtils->getipaddr("$value"); if (! defined $masterip){ - push @$error_ref, "The value of 'master' in 'site' table isn't an IP addres and can not be resolved to a IP addres"; + push @$error_ref, "The value of 'master' in 'site' table isn't an IP address and can not be resolved to a IP address"; $rst = 1; }else{ - probe_utils->send_msg("$output", "i", "The value of 'master' in 'site' table is $value, can be resolve to $masterip") if($verbose); + probe_utils->send_msg("$output", "i", "The value of 'master' in 'site' table is $value, can be resolved to $masterip") if($verbose); $value = $masterip; } } @@ -490,7 +490,7 @@ sub check_network { my @tmp1 = split("\\\\", $str); my @tmp2 = split(" ", $tmp1[0]); $installnic=$tmp2[-1]; - probe_utils->send_msg("$output", "w", "No interface provided by '-i' option, detected site table IP attribute $$serverip_ref, checking xCAT configuration using interface: $installnic"); + probe_utils->send_msg("$output", "w", "No interface provided by '-i' option, detected 'site' table IP attribute $$serverip_ref, checking xCAT configuration using interface: $installnic"); probe_utils->send_msg("$output", "w", "If this is incorrect, rerun with -i option"); } } @@ -553,7 +553,7 @@ sub check_directory { $rst = 1; } else { if (!-e "$sitetable_ref->{$dir}") { - push @$error_ref, "There isn't '$sitetable_ref->{$dir}' directory on current server, there is something wrong during xCAT installation"; + push @$error_ref, "There isn't '$sitetable_ref->{$dir}' directory on current server, something went wrong during xCAT installation"; $rst = 1; } else { if ($is_sn) { @@ -573,7 +573,7 @@ sub check_directory { } if ($mountip ne $sitetable_ref->{master}) { - push @$error_ref, "$dir '$sitetable_ref->{$dir}' isn't mounted from the management node,please check SN's configuration"; + push @$error_ref, "$dir '$sitetable_ref->{$dir}' isn't mounted from the management node, check SN's configuration"; $rst = 1; } } elsif (($dir eq "tftpdir" and $sitetable_ref->{sharedtftp} ne "1") or @@ -661,7 +661,7 @@ sub check_disk { } my $mountmun = $#{$mountpointinfo{$mountpoint}{mount}} +1 ; if($mountmun >1){ - $msg .= "these directories are parts of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough."; + $msg .= "these directories are part of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough."; }else{ $msg .= "this directory is a part of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough."; } @@ -729,7 +729,7 @@ sub check_http_service { `which wget > /dev/null 2>&1`; if ($?) { - push @$error_ref, "HTTP check need 'wget' tool, please install 'wget' tool and try again"; + push @$error_ref, "HTTP check needs 'wget' tool, install 'wget' tool and try again"; } else { { my $httpinfo = `lsdef -t site -i installdir,httpport -c 2>&1`; @@ -789,13 +789,13 @@ sub check_tftp_service { if ($checktftp) { `which tftp > /dev/null 2>&1`; if ($?) { - push @$error_ref, "TFTP check need 'tftp' tool, please install 'tftp' tool and try again"; + push @$error_ref, "TFTP check needs 'tftp' tool, install 'tftp' tool and try again"; } else { { my $tftpdir = `lsdef -t site -i tftpdir -c 2>&1| awk -F'=' '{print \$2}'`; chomp($tftpdir); unless($tftpdir){ - push @$error_ref, "TFTP work path isn't configured in 'sit' table"; + push @$error_ref, "TFTP work path isn't configured in 'site' table"; last; } unless(-d "$tftpdir"){ @@ -926,7 +926,7 @@ sub check_ntp_service{ if($?){ `which ntpq > /dev/null 2>&1`; if ($?) { - push @$error_ref, "ntp service check need 'ntpq' or 'chronyc' tool, please install and try again"; + push @$error_ref, "ntp service check needs 'ntpq' or 'chronyc' tool, install and try again"; $rst = 1; } else { my $error; @@ -981,7 +981,7 @@ sub check_dns_service { if ($checkdns) { `which nslookup > /dev/null 2>&1`; if ($?) { - push @$error_ref, "DNS check need 'nslookup' tool, please install 'nslookup' tool and try again"; + push @$error_ref, "DNS check needs 'nslookup' tool, install 'nslookup' tool and try again"; $rst = 1; } else { if ($is_sn) { @@ -1013,23 +1013,25 @@ sub check_dns_service { my $tmp = grep { $_ =~ "Server:[\t\s]*$serverip" } split(/\n/, $nslkp); if (!$tmp) { $rc = 1; - } - # now check if nameserver in /etc/resolv.conf can resolve server name - my $nslkp = `nslookup -type=A $serverip 2>&1`; - chomp($nslkp); - my $nameserverip = "n/a"; - if ($nslkp =~ /Server:[\t\s]*(\d+).(\d+).(\d+).(\d+)/) { - $nameserverip = "$1.$2.$3.$4"; - } - if ($nslkp =~ /server can't find/) { - push @$error_ref, "DNS nameserver $nameserverip can not resolve $serverip"; - # Just a warning - return (1, 'w'); - } - if ($nslkp =~ /no servers could be reached/) { - push @$error_ref, "DNS nameserver can not be reached"; - # Just a warning - return (1, 'w'); + } else { + # "nslookup mnip mnip" was ok, + # now check if nameserver in /etc/resolv.conf can resolve server name + my $nslkp = `nslookup -type=A $serverip 2>&1`; + chomp($nslkp); + my $nameserverip = "n/a"; + if ($nslkp =~ /Server:[\t\s]*(\d+).(\d+).(\d+).(\d+)/) { + $nameserverip = "$1.$2.$3.$4"; + } + if ($nslkp =~ /server can't find/) { + push @$error_ref, "DNS nameserver $nameserverip can not resolve $serverip"; + # Just a warning + return (1, 'w'); + } + if ($nslkp =~ /no servers could be reached/) { + push @$error_ref, "DNS nameserver can not be reached"; + # Just a warning + return (1, 'w'); + } } } if ($rc) { @@ -1216,7 +1218,7 @@ sub check_ulimits { my $percent = $open_num/$nofile_num; unless ($percent < 0.8) { - push @$error_ref, "The number of open files is not enough for xcatd service, increase the limits for it according to xCAT document"; + push @$error_ref, "The number of open files is not enough for xcatd service, increase the limits for it according to xCAT documentation"; $rst = 1; if ($percent >= 1) { $rst_type = "f"; @@ -1245,7 +1247,7 @@ sub check_network_parameter { my $percent = $arp_num/$net_gc_thresh; unless ($percent < 0.8) { - push @$error_ref, "Most ARP has been used, please tuning network parameter as document"; + push @$error_ref, "Most ARP has been used, tune network parameters"; $rst = 1; if ($percent >= 1) { $rst_type = "f"; @@ -1308,7 +1310,7 @@ sub check_db_pkgs { my $cfgloc_file = "/etc/xcat/cfgloc"; if (! -e $cfgloc_file) { - push @$error_ref, "$cfgloc_file does not exist, please check xcat installation."; + push @$error_ref, "$cfgloc_file does not exist, check xcat installation."; return 1; } my $db_type = `cat $cfgloc_file | awk -F ':' '{print \$1}'`; @@ -1323,7 +1325,7 @@ sub check_db_pkgs { $db_pkg = `rpm -qa | grep $db_name`; } if (!$db_pkg) { - push @$error_ref, "$db_name is not installed, please install it."; + push @$error_ref, "$db_name is not installed."; $rst = 1; } return $rst; From 7e635bafd961d55d206c222c61dfd8d4b42a6b10 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 7 Apr 2021 15:23:05 -0400 Subject: [PATCH 35/82] Make xCAT-server require httpd --- xCAT-server/xCAT-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index be9f40d72..d64726ab8 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -58,7 +58,7 @@ Requires: grub2-xcat >= 2.02-0.76.el7.1.snap201905160255 perl-Net-HTTPS-NB perl- %else %ifos linux # do this for non-fsm linux -Requires: perl-IO-Tty perl-Crypt-SSLeay make +Requires: perl-IO-Tty perl-Crypt-SSLeay make httpd %endif %endif From 7b012a8f6e5a2f060e44e83cf4e14a38e03a9844 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 7 Apr 2021 15:07:22 -0400 Subject: [PATCH 36/82] Remove sp1flag from mysqlsetup --- xCAT-client/bin/mysqlsetup | 62 ++++++++++---------------------------- 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 48a15f8d3..0b8f87ee4 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -148,30 +148,6 @@ if (-e "/etc/debian_version") { # determine whether redhat or sles $::linuxos = xCAT::Utils->osver(); -# SLES SP 1 -my $sp1flag; - -# if linuxos==sles12 -if ($::linuxos eq "sles12") { - - # open /etc/os-release - my @lines; - my $relfile; - $sp1flag = 0; - open($relfile, "<", "/etc/os-release"); - - # parse lines - @lines = <$relfile>; - close($relfile); - chomp(@lines); - - # for sles12.x - $sp1flag = 1; -} - -# set flag -# SLES SP 1 - # is this MariaDB or MySQL $::MariaDB = 0; my $cmd; @@ -226,28 +202,24 @@ if (grep(/$mysqlcheck/, @output)) $::mysqlrunning = 1; } -#for ubuntu 14, after install mysql/maria server, the mysql will running -#need to stop mysql in order to setup init xcat mysql -if ($::debianflag or $sp1flag) { - $cmd = "pidof mysqld"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC == 0) +# Stop mysql in order to setup init xcat mysql +$cmd = "pidof mysqld"; +xCAT::Utils->runcmd($cmd, -1); +if ($::RUNCMD_RC == 0) +{ + if ($::INIT) { - if ($::INIT) + my $ret = xCAT::Utils->stopservice("mysql"); + if ($ret != 0) { - my $ret = xCAT::Utils->stopservice("mysql"); - if ($ret != 0) - { - xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb."); - exit(1); - } - } - else { - $::mysqlrunning = 1; + xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb."); + exit(1); } + } else { + $::mysqlrunning = 1; } - } + if (-e ("/etc/xcat/cfgloc")) # check to see if xcat is using mysql { # cfgloc exists $cmd = "fgrep mysql /etc/xcat/cfgloc"; @@ -1012,10 +984,8 @@ sub mysqlstart for ($i = 0 ; $i < 12 ; $i++) { my @output = xCAT::Utils->runcmd($cmd, 0); - my $mysqlcheck = "--datadir"; # see if really running - if ($::debianflag or $sp1flag) { - $mysqlcheck = "mysqld"; - } + $mysqlcheck = "mysqld"; + if (grep(/$mysqlcheck/, @output)) { sleep 10; # give a few extra seconds to be sure @@ -1027,7 +997,7 @@ sub mysqlstart } } xCAT::MsgUtils->message("E", - " Could not start the mysql daemon, in time allocated ( 2minutes)"); + " Could not start the mysql daemon, in time allocated (2 minutes)"); exit(1); } From 1e768f4d5d7e2ec7e764c06d62c111272b0c64b8 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 12 Apr 2021 12:16:05 -0400 Subject: [PATCH 37/82] Get the correct XML record for a PIC device if it is one of the devices in an iommuGroup --- xCAT-server/lib/xcat/plugins/kvm.pm | 41 ++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 89be54d85..8f5851ff0 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -814,13 +814,52 @@ sub build_xmldesc { } my $devhash = XMLin($devxml); + if (defined $devhash->{capability}->{type} and $devhash->{capability}->{type} =~ /pci/i) { my %tmphash; $tmphash{mode} = 'subsystem'; $tmphash{type} = $devhash->{capability}->{type}; $tmphash{managed} = "yes"; $tmphash{driver}->{name} = "vfio"; - $tmphash{source}->{address}->[0] = \%{ $devhash->{'capability'}->{'iommuGroup'}->{'address'} }; + + if (ref $devhash->{'capability'}->{'iommuGroup'}->{'address'} ne 'ARRAY') + { + # There is only one record of address. + + $tmphash{source}->{address}->[0] = \%{ $devhash->{'capability'}->{'iommuGroup'}->{'address'} }; + } + else + { + # There are multiple records of address. Extract the function portion of the PCI devname. + + my $numaddr; + my $tmpval; + my $devfunction; + my $tmpfunction; + + $devname =~ /pci_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)/; + + $devfunction = $4; + + $numaddr = length (ref $devhash->{'capability'}->{'iommuGroup'}->{'address'}); + + for (my $i = 0; $i < $numaddr; $i++) + { + $tmpval = $devhash->{'capability'}->{'iommuGroup'}->{'address'}->[$i]->{'function'}; + + $tmpval =~ /0x([0-9]*)/; + + $tmpfunction = $1; + + # Compare the function portion of the PCI devname against that of the XML structure.:w + if ($devfunction eq $tmpfunction) + { + $tmphash{source}->{address}->[0] = \%{ $devhash->{'capability'}->{'iommuGroup'}->{'address'}->[$i] }; + last; + } + } + } + push(@prdevarray, \%tmphash); } From af4507bc316235d5c066ee0e0c102be9faae1a8c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 13 Apr 2021 15:45:15 -0400 Subject: [PATCH 38/82] Make xcatprobe xcatmn recognize default SQLite DB --- docs/source/advanced/hierarchy/databases/index.rst | 2 ++ .../advanced/hierarchy/databases/mysql_install.rst | 2 +- xCAT-probe/subcmds/xcatmn | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/source/advanced/hierarchy/databases/index.rst b/docs/source/advanced/hierarchy/databases/index.rst index e7e1d6520..57551a075 100644 --- a/docs/source/advanced/hierarchy/databases/index.rst +++ b/docs/source/advanced/hierarchy/databases/index.rst @@ -1,6 +1,8 @@ Configure a Database ==================== +SQLite +------ xCAT uses the SQLite database (https://www.sqlite.org/) as the default database and it is initialized during xCAT installation of the Management Node. If using Service Nodes, SQLite **cannot** be used because Service Nodes require remote access to the xCAT database. One of the following databases should be used: * :ref:`mysql_reference_label` diff --git a/docs/source/advanced/hierarchy/databases/mysql_install.rst b/docs/source/advanced/hierarchy/databases/mysql_install.rst index ef6094a8e..9847bf094 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_install.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_install.rst @@ -82,7 +82,7 @@ Debian/Ubuntu mysql-server mysql-common libdbd-mysql-perl - libmysqlclient18 + libmysqlclient* mysql-client-5* mysql-client-core-5* mysql-server-5* diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 63229e9c4..ecabd128e 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -322,7 +322,7 @@ sub check_all_xcat_daemons { $rst_type = "w" if ($child_pid); } } - push @$error_ref, "More Daemon '$daemon' is running"; + push @$error_ref, "More than one instance of '$daemon' is running"; $rst = 1; } elsif ($counter == 0) { push @$error_ref, "Daemon '$daemon' isn't running"; @@ -1310,8 +1310,13 @@ sub check_db_pkgs { my $cfgloc_file = "/etc/xcat/cfgloc"; if (! -e $cfgloc_file) { - push @$error_ref, "$cfgloc_file does not exist, check xcat installation."; - return 1; + # no $cfgloc_file, check if running with default SQLite + if (-d "/etc/xcat") { + return 0; #Default SQLite + } else { + push @$error_ref, "Can not find $cfgloc_file or /etc/xcat, check xcat database installation."; + return 1; + } } my $db_type = `cat $cfgloc_file | awk -F ':' '{print \$1}'`; chomp($db_type); From 7526223a25946a02e870d24a3cafb2c5b14dff2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= Date: Fri, 16 Apr 2021 17:17:26 -0300 Subject: [PATCH 39/82] Fixed a typo on OL version in discinfo.pm --- perl-xCAT/xCAT/data/discinfo.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index fd9b40f0b..b406c834d 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -136,7 +136,7 @@ our %distnames = ( "1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install "1529960248.065311" => "ol6.10", # x86_64, Oracle Linux 6.10 - "1565395001.564692" => "ol7.7", # x86_64, Oracle Linux 7.8 + "1565395001.564692" => "ol7.7", # x86_64, Oracle Linux 7.7 "1586293815.797636" => "ol7.8", # x86_64, Oracle Linux 7.8 "1601956087.745957" => "ol7.9", # x86_64, Oracle Linux 7.9 "1563868563.575621" => "ol8.0", # x86_64, Oracle Linux 8.0 From 75a6cd03fe43b961405ec4cca8e709a08b19f0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= Date: Fri, 16 Apr 2021 17:18:21 -0300 Subject: [PATCH 40/82] Fixes statefull installation with Oracle Linux --- xCAT-server/lib/perl/xCAT/Template.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 0da104fa0..0eded1d50 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -299,7 +299,7 @@ sub subvars { my $writerepo; my $c = 0; foreach my $pkgdir (@pkgdirs) { - if ($platform =~ /^(rh|SL|centos|fedora)$/) { + if ($platform =~ /^(rh|SL|centos|ol|fedora)$/) { if ($c == 0) { # After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x # the rhels5.9 will not be installed successfully. So put in kickstart directly. From f045f67994c322286000612cb92b796724c041aa Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Apr 2021 08:46:17 -0400 Subject: [PATCH 41/82] Support Oracle Linux on service nodes --- perl-xCAT/xCAT/data/discinfo.pm | 7 ------ xCAT-server/lib/xcat/plugins/anaconda.pm | 22 +++++++++++++++++-- .../share/xcat/install/ol/service.ol7.tmpl | 1 + .../ol/service.ol7.x86_64.otherpkgs.pkglist | 1 + .../install/ol/service.ol7.x86_64.pkglist | 1 + .../share/xcat/install/ol/service.ol8.pkglist | 1 + .../ol/service.ol8.ppc64le.otherpkgs.pkglist | 1 + .../share/xcat/install/ol/service.ol8.tmpl | 1 + .../ol/service.ol8.x86_64.otherpkgs.pkglist | 1 + .../xcat/netboot/ol/service.ol7.x86_64.exlist | 1 + .../ol/service.ol7.x86_64.otherpkgs.pkglist | 1 + .../netboot/ol/service.ol7.x86_64.pkglist | 1 + .../netboot/ol/service.ol7.x86_64.postinstall | 1 + .../xcat/netboot/ol/service.ol8.x86_64.exlist | 1 + .../ol/service.ol8.x86_64.otherpkgs.pkglist | 1 + .../netboot/ol/service.ol8.x86_64.pkglist | 1 + .../netboot/ol/service.ol8.x86_64.postinstall | 1 + 17 files changed, 35 insertions(+), 9 deletions(-) create mode 120000 xCAT-server/share/xcat/install/ol/service.ol7.tmpl create mode 120000 xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/install/ol/service.ol8.pkglist create mode 120000 xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/install/ol/service.ol8.tmpl create mode 120000 xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index b406c834d..445cf5eab 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -136,13 +136,6 @@ our %distnames = ( "1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install "1529960248.065311" => "ol6.10", # x86_64, Oracle Linux 6.10 - "1565395001.564692" => "ol7.7", # x86_64, Oracle Linux 7.7 - "1586293815.797636" => "ol7.8", # x86_64, Oracle Linux 7.8 - "1601956087.745957" => "ol7.9", # x86_64, Oracle Linux 7.9 - "1563868563.575621" => "ol8.0", # x86_64, Oracle Linux 8.0 - "1573718260.172018" => "ol8.1", # x86_64, Oracle Linux 8.1 - "1588679121.349755" => "ol8.2", # x86_64, Oracle Linux 8.2 - "1604965593.730885" => "ol8.3", # x86_64, Oracle Linux 8.3 "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index e27ee05a0..44b8413c7 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2033,7 +2033,7 @@ sub copycd if (-r $mntpath . "/.discinfo") { - print "DEBUG - [anaconda.pm] Attempt to detemine OS information from the .discinfo file ...\n"; + print "DEBUG - [anaconda.pm] Attempt to detemine OS information from the $mntpath/.discinfo file ...\n"; open($dinfo, $mntpath . "/.discinfo"); $did = <$dinfo>; @@ -2073,7 +2073,7 @@ sub copycd $dno = $1; } } - print "DEBUG - [anaconda.pm] Distname=$distname, OS=$desc, ARCH=$arch, Version=$dno\n"; + print "DEBUG - [anaconda.pm] Distname=$distname, OS=$desc, ARCH=$darch, Version=$dno\n"; unless ($distname) { @@ -2109,6 +2109,24 @@ sub copycd } close($dinfo); } + elsif ($desc =~ /Oracle Linux/) + { + # + # Attempt to auto-detect for OL8 OS, the last element has typically been the version + # ex: "Oracle Linux 8.3.0" + # + my @ol_version = split / /, $desc; + $distname = "ol" . $ol_version[-1]; + } + elsif ($desc =~ /OL-/) + { + # + # Attempt to auto-detect for OL7 OS, the last element has typically been the version + # ex: OL-7.9 Server.x86_64 + # + my @ol_version = split /[- ]/, $desc; + $distname = "ol" . $ol_version[1]; + } elsif ($desc =~ /^[\d\.]+$/) { open($dinfo, $mntpath . "/.treeinfo"); diff --git a/xCAT-server/share/xcat/install/ol/service.ol7.tmpl b/xCAT-server/share/xcat/install/ol/service.ol7.tmpl new file mode 120000 index 000000000..453d4b94a --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol7.tmpl @@ -0,0 +1 @@ +../rh/service.rhels7.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..7166f39c2 --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist new file mode 120000 index 000000000..8836bf046 --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.pkglist b/xCAT-server/share/xcat/install/ol/service.ol8.pkglist new file mode 120000 index 000000000..818f670ec --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist new file mode 120000 index 000000000..ed90f050f --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.ppc64le.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.tmpl b/xCAT-server/share/xcat/install/ol/service.ol8.tmpl new file mode 120000 index 000000000..373e2f6eb --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.tmpl @@ -0,0 +1 @@ +../rh/service.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist new file mode 120000 index 000000000..71786c8e0 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..7166f39c2 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist new file mode 120000 index 000000000..8836bf046 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall new file mode 120000 index 000000000..bce5cd2cd --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist new file mode 120000 index 000000000..9d1e45244 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist new file mode 120000 index 000000000..cba1edc0e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall new file mode 120000 index 000000000..cd4cbff17 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.postinstall \ No newline at end of file From d43dfe0469028f98d63e6015cafa0d208c2d41e3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Apr 2021 13:40:30 -0400 Subject: [PATCH 42/82] Shorten provision wait time --- xCAT-test/autotest/testcase/commoncmd/retry_install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index d98f9fc7a..76ace4f45 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -7,13 +7,16 @@ node=$1 osimage=$2 vmhost=`lsdef $node -i vmhost -c | cut -d '=' -f 2` times=3 +wait_for_provision=30 #Min to wait for node to provision +check_status=10 #Sec to keep checking status +iterations=$wait_for_provision*60/$check_status #Iterations to check for "booted" status if [ $# -eq 3 ]; then times=$3 fi -echo "Try to rinstall for $times times ......" +echo "Try to rinstall for $times times (allowing $wait_for_provision min for each try) ......" for (( tryreinstall = 1 ; tryreinstall <= $times ; ++tryreinstall )) do @@ -43,11 +46,11 @@ do sleep 360 while [ ! `lsdef -l $node|grep status|grep booted` ] do - sleep 10 + sleep $check_status stat=`lsdef $node -i status -c | cut -d '=' -f 2` echo "[$a] The status is not booted... ($stat)" a=++a - if [ $a -gt 400 ];then + if [ $a -gt $(($iterations + 0)) ];then a=0 break fi From 0dbc10bd0db5e1fd4da3b58b7572998b86bd4710 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Apr 2021 15:29:30 -0400 Subject: [PATCH 43/82] Better comment for [-1] index --- xCAT-server/lib/xcat/plugins/anaconda.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 44b8413c7..96845749c 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2112,7 +2112,8 @@ sub copycd elsif ($desc =~ /Oracle Linux/) { # - # Attempt to auto-detect for OL8 OS, the last element has typically been the version + # Attempt to auto-detect for OL8 OS, the last element + # (accessed with [-1] array index) has typically been the version # ex: "Oracle Linux 8.3.0" # my @ol_version = split / /, $desc; @@ -2121,7 +2122,8 @@ sub copycd elsif ($desc =~ /OL-/) { # - # Attempt to auto-detect for OL7 OS, the last element has typically been the version + # Attempt to auto-detect for OL7 OS, the first element + # (after "-") has typically been the version # ex: OL-7.9 Server.x86_64 # my @ol_version = split /[- ]/, $desc; From 82a2e8afd65922af0f32dc6218825953cf6529d4 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 21 Apr 2021 15:50:17 -0400 Subject: [PATCH 44/82] Remove pidfile /dev/null for chronyd in setupntp on Ubuntu systems --- xCAT/postscripts/setupntp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index a95c621da..98ce05f26 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -167,6 +167,18 @@ warn_if_bad "$?" "Failed to configure the system to maintain the RTC in universa # Synchronize and set the system clock once logger -t $log_label -p local4.info "Syncing the clock ..." + +OS_name=`cat /etc/os-release | grep "NAME=\"Ubuntu\""` + +if [ -z $OS_name ] +then + pidfile_option="pidfile /dev/null" +else + # Some versions of chronyd on Ubuntu distros have an issue + # with the valid option "pidfile /dev/null". + pidfile_option="" +fi + chronyd -f /dev/null -q "$( if [ "${#NTP_SERVERS[@]}" -gt "0" ] then @@ -174,7 +186,7 @@ chronyd -f /dev/null -q "$( else echo "pool pool.ntp.org iburst" fi -)" "pidfile /dev/null" +)" "$pidfile_option" rm -f /etc/adjtime # Set the hardware clock from the system clock From f0705f9ff4a428c42cc7bc2c749f91402b2acea5 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 22 Apr 2021 12:22:23 -0400 Subject: [PATCH 45/82] Modification of the conditional statement --- xCAT/postscripts/setupntp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index 98ce05f26..1388e5b5f 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -168,15 +168,13 @@ warn_if_bad "$?" "Failed to configure the system to maintain the RTC in universa # Synchronize and set the system clock once logger -t $log_label -p local4.info "Syncing the clock ..." -OS_name=`cat /etc/os-release | grep "NAME=\"Ubuntu\""` - -if [ -z $OS_name ] +if [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null then - pidfile_option="pidfile /dev/null" -else # Some versions of chronyd on Ubuntu distros have an issue # with the valid option "pidfile /dev/null". pidfile_option="" +else + pidfile_option="pidfile /dev/null" fi chronyd -f /dev/null -q "$( From d009f2c00a1e785ea1f2f3d0764a74021a23fd86 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 22 Apr 2021 13:10:32 -0400 Subject: [PATCH 46/82] Add grep to check_exec_or_exit --- xCAT/postscripts/setupntp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index 1388e5b5f..c0466607a 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -145,7 +145,7 @@ fi unset MASTER unset NTPSERVERS -check_exec_or_exit cp cat logger +check_exec_or_exit cp cat logger grep check_exec_or_exit systemctl timedatectl hwclock systemctl stop ntp.service 2>/dev/null From 5430fde3a3f75e651c39f4adce4b2317e3c706b0 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 23 Apr 2021 11:19:43 -0400 Subject: [PATCH 47/82] Update xcatsnap by collecting more files and improving its code --- xCAT-server/sbin/xcatsnap | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/xCAT-server/sbin/xcatsnap b/xCAT-server/sbin/xcatsnap index 3b3d1318b..829c9a02e 100755 --- a/xCAT-server/sbin/xcatsnap +++ b/xCAT-server/sbin/xcatsnap @@ -103,7 +103,7 @@ sub run_cmd { eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 600; - @output = `$Command`; + @output = `/bin/bash -c \'$Command\'`; alarm 0; }; if ($@) { @@ -209,7 +209,12 @@ sub snap_it { "/etc/rsyslog.conf", "/etc/rsyslog.d/*", "/var/lib/dhcpd/dhcpd.leases", "/etc/hosts", "/etc/resolv.conf", "/etc/named.conf", "/etc/conserver.cf", "/var/log/conserver", - "/etc/nsswitch.conf", "/var/log/messages", "/var/log/xcat/*"); + "/etc/nsswitch.conf", "/var/log/messages", "/var/log/xcat/*", + "/etc/dhcp/dhcpd.conf", "/etc/dhcp/dhcpd6.conf", + "/etc/dhcpd6.conf", "/var/lib/dhcp/db/dhcpd.leases", + "/var/lib/dhcp/dhcpd.leases","/etc/goconserver/server.conf", + "/var/log/goconserver/*", "/etc/logrotate.d/goconserver", + "/etc/bind/named.conf"); print("@files_array \n"); } foreach my $item (@files_array) { @@ -220,15 +225,12 @@ sub snap_it { print "Gathering system configuration...\n\n"; $output_dir = "$logDirectory/commands_output/"; my $xcatroot = $ENV{'XCATROOT'}; - my $installdir; - chop($installdir = - `tabdump site | grep installdir | cut -f2 -d ,`); make_output_dir(); if ($OSname eq "AIX") { @Commands_array = ( "uname -a", "ifconfig -a", "netstat -in", "netstat -rn", "env", "reventlog -a", "lsmod", "/sbin/lspci", "lssrc -a", "rpm -qa", - "ls $installdir", "/bin/crontab -l", + "ls $INSTALLDIR", "/bin/crontab -l", "find /tftpboot -size -32k", "ls -lR $xcatroot", "arp -a", "ps -edlf", "ps -aux", "ulimit -a", "df -k", "oslevel", "netstat -A", "errpt -a", "/usr/sbin/instfix -i", @@ -237,8 +239,8 @@ sub snap_it { elsif ($OSname eq "Linux") { @Commands_array = ( "uname -a", "ifconfig -a", "netstat -in", "netstat -rn", "env", - "reventlog -a", "lsmod", "/sbin/lspci", "lssrc -a", "rpm -qa", - "ls $installdir", "/usr/bin/crontab -l", + "reventlog -a", "lsmod", "lspci", "lssrc -a", "rpm -qa", + "ls $INSTALLDIR", "/usr/bin/crontab -l", "apt list", "find /tftpboot -size -32k", "ls -lR $xcatroot", "arp -a", "ps -edlf", "ps -aux", "ulimit -a", "df -k", "cat /etc/issue", "lsxcatd -a", "cat /proc/meminfo", "cat /proc/cpuinfo", "journalctl -b --no-pager -u xcatd"); From 28fe1dfaad358ebdba0e1599816d2748a8cb3a5a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 23 Apr 2021 14:49:56 -0400 Subject: [PATCH 48/82] Improve xcatprobe check for firewall --- xCAT-probe/lib/perl/probe_utils.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index 6fbf59cd5..fa31e84e7 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -282,15 +282,11 @@ sub is_firewall_open { my $output = `iptables -nvL -t filter 2>&1`; - `echo "$output" |grep "Chain INPUT (policy ACCEPT" > /dev/null 2>&1`; - $rst = 1 if ($?); - - `echo "$output" |grep "Chain FORWARD (policy ACCEPT" > /dev/null 2>&1`; - $rst = 1 if ($?); - - `echo "$output" |grep "Chain OUTPUT (policy ACCEPT" > /dev/null 2>&1`; - $rst = 1 if ($?); - + if ($output =~ /DROP|RETURN/) { + # If output contains DROP or RETURN rules, assume firewall + # is blocking some traffic + $rst=1; + } return $rst; } From af97ed3128722c9a94aecfd61609e12f13a49952 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 26 Apr 2021 15:42:38 -0400 Subject: [PATCH 49/82] Improve verification of prsync command in testcases --- .../reg_linux_statelite_installation_hierarchy_by_nfs | 5 +++++ .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 64e3fca66..fb936f761 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -72,8 +72,13 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compu check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +#Before doing prsync of /install to the service node, check if there is enough space there +cmd:du -sh /install +cmd:xdsh $$SN du -H cmd:prsync /install $$SN:/ check:rc==0 +check:output=~$$SN: done +check:output!=write failed cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 6337a694f..99c460198 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -65,9 +65,13 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compu check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +#Before doing prsync of /install to the service node, check if there is enough space there +cmd:du -sh /install +cmd:xdsh $$SN du -H cmd:prsync /install $$SN:/ check:rc==0 - +check:output=~$$SN: done +check:output!=write failed cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 From 120c7380d0c69de016a28d1a1105e4569f411910 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 28 Apr 2021 08:54:12 -0400 Subject: [PATCH 50/82] Fix testcase command and operator for prsync --- .../reg_linux_statelite_installation_hierarchy_by_nfs | 4 ++-- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index fb936f761..5027166db 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -74,11 +74,11 @@ cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-comput check:rc==0 #Before doing prsync of /install to the service node, check if there is enough space there cmd:du -sh /install -cmd:xdsh $$SN du -H +cmd:xdsh $$SN df -H cmd:prsync /install $$SN:/ check:rc==0 check:output=~$$SN: done -check:output!=write failed +check:output!~write failed cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 99c460198..ea2ab343c 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -67,11 +67,11 @@ cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-comput check:rc==0 #Before doing prsync of /install to the service node, check if there is enough space there cmd:du -sh /install -cmd:xdsh $$SN du -H +cmd:xdsh $$SN df -H cmd:prsync /install $$SN:/ check:rc==0 check:output=~$$SN: done -check:output!=write failed +check:output!~write failed cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 From d4d6ecb54c0ba572c73c6ccba12c3f4f7bf15c18 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 29 Apr 2021 10:33:22 -0400 Subject: [PATCH 51/82] Increase service node disk --- xCAT-test/autotest/testcase/installation/setup_vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index 312e12854..7877a3fb1 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -13,7 +13,7 @@ check:output=~on|skip cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then tabdump -w node==$$CN kvm_nodedata; fi check:rc==0 -cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" -a "__GETNODEATTR($$SN,mgt)__" != "openbmc" ];then echo "SN node $$SN is a VM, mgt is __GETNODEATTR($$SN,mgt)__, starting to recreate the VM"; echo "rpower $$SN off"; rpower $$SN off; sleep 3; echo "rpower $$SN stat"; rpower $$SN stat; var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`; echo "The disk type of $$SN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$SN"; mkvm $$SN; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN"; mkvm $$SN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$SN -s 30G -f"; mkvm $$SN -s 30G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 30G -f"; mkvm $$SN -s 30G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix disk type $var"; exit 2; else echo "Unsupported disk type $var"; exit 3;fi;else echo "SN node $$SN is not a VM; do not need to recreate it";fi +cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" -a "__GETNODEATTR($$SN,mgt)__" != "openbmc" ];then echo "SN node $$SN is a VM, mgt is __GETNODEATTR($$SN,mgt)__, starting to recreate the VM"; echo "rpower $$SN off"; rpower $$SN off; sleep 3; echo "rpower $$SN stat"; rpower $$SN stat; var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`; echo "The disk type of $$SN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$SN"; mkvm $$SN; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN"; mkvm $$SN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$SN -s 50G -f"; mkvm $$SN -s 50G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 50G -f"; mkvm $$SN -s 50G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix disk type $var"; exit 2; else echo "Unsupported disk type $var"; exit 3;fi;else echo "SN node $$SN is not a VM; do not need to recreate it";fi check:rc==0 From 8b59f559989061ba83be215861f9f67cf17bd3b4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 15 Nov 2019 15:12:04 -0500 Subject: [PATCH 52/82] Remove erroneous = from man page --- xCAT-client/pods/man8/copycds.8.pod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-client/pods/man8/copycds.8.pod b/xCAT-client/pods/man8/copycds.8.pod index ac254ac46..167ce4ae7 100644 --- a/xCAT-client/pods/man8/copycds.8.pod +++ b/xCAT-client/pods/man8/copycds.8.pod @@ -4,7 +4,7 @@ B - Copies Linux distributions and service levels from DVDs/ISOs to the =head1 SYNOPSIS -B [{B<-n|--name|--osver>}=I] [{B<-a|--arch>}=I] [{B<-p|--path>}=I] [B<-o>|B<--noosimage>] [B<-w>|B<--nonoverwrite>] {I} ... +B [{B<-n|--name|--osver>} I] [{B<-a|--arch>} I] [{B<-p|--path>} I] [B<-o>|B<--noosimage>] [B<-w>|B<--nonoverwrite>] {I} ... B [B<-i>|B<--inspection>] {I} @@ -22,15 +22,15 @@ You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl =over 6 -=item B<-n|--name|--osver>=I +=item B<-n|--name|--osver> I The linux distro name and version that the ISO/DVD contains. Examples: rhels6.3, sles11.2, fedora9. Note the 's' in rhels6.3 which denotes the Server version of RHEL, which is typically used. -=item B<-a|--arch>=I +=item B<-a|--arch> I The architecture of the linux distro on the ISO/DVD. Examples: x86, x86_64, ppc64, s390x. -=item B<-p|--path>=I +=item B<-p|--path> I The destination directory to which the contents of ISO/DVD will be copied. When this option is not specified, the default destination directory will be formed from the B site table attribute and the distro name and architecture, for example: /install/rhel6.3/x86_64. This option is only supported for distributions of sles, redhat and windows. From 720bbec97745487f14c392aa9b23bba950ac5077 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 29 Apr 2021 14:34:45 -0400 Subject: [PATCH 53/82] Generated rst file --- .../guides/admin-guides/references/man8/copycds.8.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 37c399113..5e4af8f43 100644 --- a/docs/source/guides/admin-guides/references/man8/copycds.8.rst +++ b/docs/source/guides/admin-guides/references/man8/copycds.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **copycds**\ [{\ **-n|-**\ **-name|-**\ **-osver**\ }=\ *distroname*\ ] [{\ **-a|-**\ **-arch**\ }=\ *architecture*\ ] [{\ **-p|-**\ **-path**\ }=\ *ospkgpath*\ ] [\ **-o | -**\ **-noosimage**\ ] [\ **-w | -**\ **-nonoverwrite**\ ] {\ *iso | device-path*\ } ... +\ **copycds**\ [{\ **-n|-**\ **-name|-**\ **-osver**\ } \ *distroname*\ ] [{\ **-a|-**\ **-arch**\ } \ *architecture*\ ] [{\ **-p|-**\ **-path**\ } \ *ospkgpath*\ ] [\ **-o | -**\ **-noosimage**\ ] [\ **-w | -**\ **-nonoverwrite**\ ] {\ *iso | device-path*\ } ... \ **copycds**\ [\ **-i | -**\ **-inspection**\ ] {\ *iso | device-path*\ } @@ -44,19 +44,19 @@ OPTIONS -\ **-n|-**\ **-name|-**\ **-osver**\ =\ *distroname*\ +\ **-n|-**\ **-name|-**\ **-osver**\ \ *distroname*\ The linux distro name and version that the ISO/DVD contains. Examples: rhels6.3, sles11.2, fedora9. Note the 's' in rhels6.3 which denotes the Server version of RHEL, which is typically used. -\ **-a|-**\ **-arch**\ =\ *architecture*\ +\ **-a|-**\ **-arch**\ \ *architecture*\ The architecture of the linux distro on the ISO/DVD. Examples: x86, x86_64, ppc64, s390x. -\ **-p|-**\ **-path**\ =\ *ospkgpath*\ +\ **-p|-**\ **-path**\ \ *ospkgpath*\ The destination directory to which the contents of ISO/DVD will be copied. When this option is not specified, the default destination directory will be formed from the \ **installdir**\ site table attribute and the distro name and architecture, for example: /install/rhel6.3/x86_64. This option is only supported for distributions of sles, redhat and windows. From 53d6ae93903b6f160ec41d5b07d42f780f1f6207 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 29 Apr 2021 14:41:33 -0400 Subject: [PATCH 54/82] Remove = from usage also --- xCAT-server/lib/xcat/plugins/copycds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index 9fb75072b..3f6bf14ad 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -65,7 +65,7 @@ sub process_request { 'w|nonoverwrite' => \$nonoverwrite, ); if ($help) { - $callback->({ info => "copycds [{-p|--path}=path] [{-n|--name|--osver}=distroname] [{-a|--arch}=architecture] [-i|--inspection] [{-o|--noosimage}] [{-w|--nonoverwrite}] 1st.iso [2nd.iso ...]." }); + $callback->({ info => "copycds [{-p|--path} path] [{-n|--name|--osver} distroname] [{-a|--arch} architecture] [-i|--inspection] [{-o|--noosimage}] [{-w|--nonoverwrite}] 1st.iso [2nd.iso ...]." }); return; } if ($arch and $arch =~ /i.86/) { From f9f7cda833668955f81c36a66641e909eb7baf5c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 1 Oct 2019 13:12:19 -0400 Subject: [PATCH 55/82] Add missing shebangs to key scripts --- xCAT-server/share/xcat/scripts/setup-server-cert.sh | 1 + xCAT-server/share/xcat/scripts/setup-xcat-ca.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-server/share/xcat/scripts/setup-server-cert.sh b/xCAT-server/share/xcat/scripts/setup-server-cert.sh index 11bdf8693..684c15187 100755 --- a/xCAT-server/share/xcat/scripts/setup-server-cert.sh +++ b/xCAT-server/share/xcat/scripts/setup-server-cert.sh @@ -1,3 +1,4 @@ +#!/bin/bash # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html #XCATDIR=`gettab key=xcatconfdir site.value` if [ -z "$XCATDIR" ]; then diff --git a/xCAT-server/share/xcat/scripts/setup-xcat-ca.sh b/xCAT-server/share/xcat/scripts/setup-xcat-ca.sh index b124fd32b..7a4c1b299 100755 --- a/xCAT-server/share/xcat/scripts/setup-xcat-ca.sh +++ b/xCAT-server/share/xcat/scripts/setup-xcat-ca.sh @@ -1,3 +1,4 @@ +#!/bin/bash #XCATDIR=`gettab key=xcatconfdir site.value` # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html if [ -z "$XCATROOT" ]; then From 5251e67c00fa6a60c10426cc10785fbd4ea450a0 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 4 Mar 2020 15:27:38 -0500 Subject: [PATCH 56/82] Fix mistake where someone used ext4 RHEL uses xfs by default, selecting ext4 is a peculiar thing to do. --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 204d73a8e..26d8f6ae4 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -248,8 +248,8 @@ then instdisk="$(cat /tmp/xcat.install_disk)" fi -BOOTFSTYPE=ext4 -FSTYPE=ext4 +BOOTFSTYPE=xfs +FSTYPE=xfs EFIFSTYPE=efi #remove any exiting "xcatvg" VG to avoid fatal error From fef3a09b65184347389ce81fcbff7bd5d00c79ff Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 29 Apr 2021 17:38:03 -0400 Subject: [PATCH 57/82] Modify test case makentp_extntpserver_value and add it to seven daily bundles --- xCAT-test/autotest/bundle/rhels_ppc_daily.bundle | 1 + xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/rhels_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle | 1 + xCAT-test/autotest/testcase/makentp/cases0 | 8 ++------ 8 files changed, 9 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 0d9eed54a..92129c212 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -3,6 +3,7 @@ tabdump_servicenode reg_linux_diskless_installation_hierarchy tabdump_servicenode reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value tabdump_servicenode updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 0e45189e3..f8b4cb4ad 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 29bda82ab..b5f2fadc0 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 63dfc7e00..3a0443bda 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index 7aaf23dc5..0b1d3e307 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 983d59527..753958701 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 84f8f6968..83ba17e6a 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index 28eef1e18..f63124129 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -56,12 +56,8 @@ check:output=~configuring management node: $$MN 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 +check:output=~Calling ... /install/postscripts/setupntp +check:output=~Daemon chronyd configured cmd:date check:output=~$$DATE cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock ;else hwclock ; fi From d7799b8c1a4a3f2eceafc4af1c2b29a035e536f7 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 29 Apr 2021 17:49:58 -0400 Subject: [PATCH 58/82] Some changes to cases0 were missed in the previous commit --- xCAT-test/autotest/testcase/makentp/cases0 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index f63124129..d956dda70 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -46,6 +46,8 @@ cmd:lsdef -t site -o clustersite -i extntpservers -c >/tmp/extntpserver check:rc==0 cmd:chtab key=extntpservers site.value="$$extntpserversip" check:rc==0 +cmd:date | awk '{print $6}' > /tmp/abc123 +check:rc==0 cmd:date -s 20000101 check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock -w;else hwclock -w ; fi @@ -58,14 +60,18 @@ check:rc==0 check:output=~configuring management node: $$MN check:output=~Calling ... /install/postscripts/setupntp check:output=~Daemon chronyd configured -cmd:date -check:output=~$$DATE -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock ;else hwclock ; fi +cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;date | grep $Time check:rc==0 -check:output=~$$DATE +check:output=~\d +cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $Time;else hwclock | grep $Time ; fi +check:rc==0 +check:output=~\d cmd:extntpserver=`cat /tmp/extntpserver | awk -F = '{print \$2}'`;chtab key=extntpservers site.value=$extntpserver check:rc==0 cmd:rm -rf /tmp/extntpserver +check:rc==0 +cmd:rm /tmp/abc123 +check:rc==0 end start:updatenode_computenode_P_setupntp From 0e02c87a9a42b124af1c861d63fdcdce0a287774 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 30 Apr 2021 14:41:45 -0400 Subject: [PATCH 59/82] test case enhancement --- xCAT-test/autotest/testcase/makentp/cases0 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index d956dda70..b807e4893 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -46,7 +46,7 @@ cmd:lsdef -t site -o clustersite -i extntpservers -c >/tmp/extntpserver check:rc==0 cmd:chtab key=extntpservers site.value="$$extntpserversip" check:rc==0 -cmd:date | awk '{print $6}' > /tmp/abc123 +cmd:date | awk '{print $6}' > /tmp/currentyear check:rc==0 cmd:date -s 20000101 check:rc==0 @@ -60,17 +60,17 @@ check:rc==0 check:output=~configuring management node: $$MN check:output=~Calling ... /install/postscripts/setupntp check:output=~Daemon chronyd configured -cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;date | grep $Time +cmd:curryear=`cat /tmp/currentyear`;date | grep $curryear check:rc==0 check:output=~\d -cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $Time;else hwclock | grep $Time ; fi +cmd:curryear=`cat /tmp/currentyear`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $curryear;else hwclock | grep $curryear ; fi check:rc==0 check:output=~\d cmd:extntpserver=`cat /tmp/extntpserver | awk -F = '{print \$2}'`;chtab key=extntpservers site.value=$extntpserver check:rc==0 cmd:rm -rf /tmp/extntpserver check:rc==0 -cmd:rm /tmp/abc123 +cmd:rm -f /tmp/currentyear check:rc==0 end From ddc0ae91a13ec0d43af584337098addd1f603e40 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 30 Apr 2021 15:22:07 -0400 Subject: [PATCH 60/82] Docs improvements --- .../common/deployment/cfg_partition.rst | 6 +++--- .../common/deployment/driver_update_disk.rst | 12 +++++++----- .../admin-guides/references/man5/bootparams.5.rst | 2 +- .../admin-guides/references/man5/openbmc.5.rst | 4 ++-- .../guides/admin-guides/references/man7/group.7.rst | 6 +++--- .../guides/admin-guides/references/man7/node.7.rst | 6 +++--- perl-xCAT/xCAT/Schema.pm | 6 +++--- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index bd09ac1d1..eb03b2018 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -33,7 +33,7 @@ The partition file must follow the partitioning syntax of the respective install * The file ``/root/anaconda-ks.cfg`` is a sample kickstart file created by RedHat installing during the installation process based on the options that you selected. * system-config-kickstart is a tool with graphical interface for creating kickstart files - * SLES: `Autoyast documentation `_ + * SLES: `Autoyast documentation `_ * Use yast2 autoyast in GUI or CLI mode to customize the installation options and create autoyast file * Use yast2 clone_system to create autoyast configuration file ``/root/autoinst.xml`` to clone an existing system @@ -384,7 +384,7 @@ Create a shell script that will be run on the node during the install process to The purpose of the partition script is to create the ``/tmp/partionfile`` that will be inserted into the kickstart/autoyast/preseed template, the script could include complex logic like select which disk to install and even configure RAID, etc -**Note**: the partition script feature is not thoroughly tested on SLES, there might be problems, use this feature on SLES at your own risk. +.. note:: the partition script feature is not thoroughly tested on SLES, there might be problems, use this feature on SLES at your own risk. .. END_Partition_Definition_Script_Create_partition_script_content @@ -460,7 +460,7 @@ Run below commands to associate partition script with osimage: :: - The ``s:`` preceding the filename tells nodeset that this is a script. - For RedHat, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will add the execution of the contents of this script to the %pre section of that file. The ``nodeset`` command will then replace the ``#XCAT_PARTITION_START#...#XCAT_PARTITION_END#`` directives from the osimage template file with ``%include /tmp/partitionfile`` to dynamically include the tmp definition file your script created. - - For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will replace the ``#XCA_PARTMAN_RECIPE_SCRIPT#`` directive and add the execution of the contents of this script to the ``/install/autoinst/.pre``, the ``/install/autoinst/.pre`` script will be run in the preseed/early_command. +- For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will replace the ``#XCA_PARTMAN_RECIPE_SCRIPT#`` directive and add the execution of the contents of this script to the ``/install/autoinst/.pre``, the ``/install/autoinst/.pre`` script will be run in the preseed/early_command. .. END_Partition_Definition_Script_Associate_partition_script_with_osimage_common diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst index 19d232d97..2a31a51cc 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst @@ -19,7 +19,7 @@ No matter which approach chosen, there are two steps to make new drivers work. o There are two approaches for xCAT to find the driver disk (pick one): -#. Specify the location of the driver disk in the osimage object (*This is ONLY supported in 2.8 and later*) +#. Specify the location of the driver disk in the osimage object (*This is ONLY supported in xCAT 2.8 and later*) The value for the 'driverupdatesrc' attribute is a comma separated driver disk list. The tag 'dud' must be specified before the full path of 'driver update disk' to specify the type of the file: :: @@ -66,14 +66,16 @@ If 'osupdatename' is specified, the kernel shipped with the 'osupdatename' will - If specifying the driver disk location in the osimage, there are two ways to inject drivers: - #. :: + #. Using nodeset command only: :: + nodeset osimage= - #. :: + #. Using geninitrd with nodeset command: :: + geninitrd nodeset osimage= --noupdateinitrd -**Note:** 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for a diskful node. 'geninitrd' only needs be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. +.. note:: 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for a diskful node. 'geninitrd' only needs be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. - If putting the driver disk in /driverdisk//: @@ -94,7 +96,7 @@ There are two ways to inject drivers: geninitrd [--ignorekernelchk] nodeset osimage= --noupdateinitrd -**Note:** 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for diskful nodes. 'geninitrd' only needs to be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. +.. note:: 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for diskful nodes. 'geninitrd' only needs to be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. The option '--ignorekernelchk' is used to skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. To use this flag, you should make sure the drivers in the driver rpms are usable for the target kernel. .. END_inject_into_initrd__for_diskful_for_RPM diff --git a/docs/source/guides/admin-guides/references/man5/bootparams.5.rst b/docs/source/guides/admin-guides/references/man5/bootparams.5.rst index 13f261616..6fd7195df 100644 --- a/docs/source/guides/admin-guides/references/man5/bootparams.5.rst +++ b/docs/source/guides/admin-guides/references/man5/bootparams.5.rst @@ -56,7 +56,7 @@ bootparams Attributes: \ **kcmdline**\ - Arguments to be passed to the kernel + (Deprecated, use addkcmdline instead) Arguments to be passed to the kernel. diff --git a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst index 11bbee003..5ac845089 100644 --- a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst +++ b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst @@ -62,13 +62,13 @@ openbmc Attributes: \ **username**\ - The BMC userid. + The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default. \ **password**\ - The BMC password. + The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default. diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 45b7d3f85..72c006ac8 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -85,7 +85,7 @@ group Attributes: or - The BMC password. + The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -141,7 +141,7 @@ group Attributes: or - The BMC userid. + The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -459,7 +459,7 @@ group Attributes: \ **kcmdline**\ (bootparams.kcmdline) - Arguments to be passed to the kernel + (Deprecated, use addkcmdline instead) Arguments to be passed to the kernel. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index e8ae749db..5bece505e 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -97,7 +97,7 @@ node Attributes: or - The BMC password. + The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -153,7 +153,7 @@ node Attributes: or - The BMC userid. + The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -471,7 +471,7 @@ node Attributes: \ **kcmdline**\ (bootparams.kcmdline) - Arguments to be passed to the kernel + (Deprecated, use addkcmdline instead) Arguments to be passed to the kernel. diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 670fd0fc9..8e1b0906e 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -330,7 +330,7 @@ passed as argument rather than by table value', 'node' => 'The node or group name', 'kernel' => 'The kernel that network boot actions should currently acquire and use. Note this could be a chained boot loader such as memdisk or a non-linux boot loader', 'initrd' => 'The initial ramdisk image that network boot actions should use (could be a DOS floppy or hard drive image if using memdisk as kernel)', - 'kcmdline' => 'Arguments to be passed to the kernel', + 'kcmdline' => '(Deprecated, use addkcmdline instead) Arguments to be passed to the kernel.', 'addkcmdline' => 'User specified kernel options for os provision process(no prefix) or the provisioned os(with prefix "R::"). The options should be delimited with spaces(" ")', 'dhcpstatements' => 'xCAT manipulated custom dhcp statements (not intended for user manipulation)', 'adddhcpstatements' => 'Custom dhcp statements for administrator use (not implemneted yet)', @@ -452,8 +452,8 @@ passed as argument rather than by table value', bmc => 'The hostname of the BMC adapter.', consport => 'The console port for OpenBMC.', taggedvlan => 'bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.', - username => 'The BMC userid.', - password => 'The BMC password.', + username => 'The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default.', + password => 'The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default.', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, From a8ef70dea6d37bb82b96d6595e1d2b4d6ff3d4c5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 3 May 2021 10:46:22 -0400 Subject: [PATCH 61/82] Regression testcase improvements --- xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle | 1 - xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_weekly.bundle | 1 - .../installation/reg_linux_diskless_installation_hierarchy | 6 ++++++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 3a0443bda..f904d1a1b 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -253,3 +253,4 @@ xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab go_xcat_devel_from_repo +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index ddfa86713..f023a4d57 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -18,4 +18,3 @@ reg_linux_diskfull_installation_flat compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs -reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index 0b1d3e307..f46da8963 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -252,3 +252,4 @@ xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab go_xcat_devel_from_repo +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index a523a0746..d0859c03f 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -18,4 +18,3 @@ reg_linux_diskfull_installation_flat compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs -reg_linux_statelite_installation_flat 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 f05480679..09fca6e28 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -107,6 +107,9 @@ cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 +# Remove diskless image to free up disk space +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 end start:reg_linux_diskless_installation_hierarchy_squashfs @@ -206,5 +209,8 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconserverc cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 +# Remove diskless image to free up disk space +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 end From 1a47868599233ecd15cd7678eecdd56940ad981d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 8 Aug 2018 19:56:46 -0400 Subject: [PATCH 62/82] Use ip instead of deprecated netstat --- xCAT-server/lib/xcat/plugins/networks.pm | 40 +++++++++--------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 5bd4141c8..e56b4dd60 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -370,19 +370,16 @@ sub donets # For Linux systems my @ip6table = split /\n/, `/sbin/ip -6 route`; - my @rtable = split /\n/, `/bin/netstat -rn`; - my @mtable = split /\n/, `/bin/netstat -i`; - - splice @rtable, 0, 2; - splice @mtable, 0, 2; + my @rtable = split /\n/, `/sbin/ip -4 route`; + my @mtable = split /\n/, `/sbin/ip link|grep BROADCAST`; my %netgw = (); foreach my $rtent (@rtable) { my @entarr = split /\s+/, $rtent; - if ($entarr[3] eq 'UG') + if ($entarr[1] eq 'via' ) { - $netgw{ $entarr[0] }{ $entarr[2] } = $entarr[1]; + $netgw{$entarr[0]} = $entarr[2]; } } @@ -466,16 +463,17 @@ sub donets next; } - if ($ent[3] eq 'U') + if ($ent[1] eq 'dev') { - $net = $ent[0]; - $mask = $ent[2]; - $mgtifname = $ent[7]; - if (defined($netgw{'0.0.0.0'}{'0.0.0.0'})) + $netandmask = $ent[0]; + $mgtifname = $ent[2]; + ($net, $mask) = split('/', $netandmask); + $mask = xCAT::NetworkUtils::formatNetmask($mask, 1, 0); + if (defined($netgw{'default'})) { - if (xCAT::NetworkUtils->ishostinsubnet($netgw{'0.0.0.0'}{'0.0.0.0'}, $mask, $net)) + if (xCAT::NetworkUtils->ishostinsubnet($netgw{'default'}, $mask, $net)) { - $gw = $netgw{'0.0.0.0'}{'0.0.0.0'}; #default gatetway + $gw = $netgw{'default'}; #default gatetway } } @@ -531,7 +529,7 @@ sub donets foreach (grep /\s*$mgtifname\b/, @mtable) { @rowm = split(/\s+/, $_); - $mtu = $rowm[1]; + $mtu = $rowm[4]; } if ($::DISPLAY) { @@ -563,7 +561,7 @@ sub donets my $tent=$nethash{$netname}; unless ($tent and $tent->{tftpserver}) { - my $netdev = $ent[7]; + my $netdev = $ent[2]; my @netlines = split /\n/, `/sbin/ip addr show dev $netdev`; foreach (grep /\s*inet\b/, @netlines) { @@ -599,16 +597,6 @@ sub donets #Nothing much sane to do for the other fields at the moment? } - elsif ($ent[3] eq 'UG') - { - - #TODO: networks through gateway. and how we might care.. - } - else - { - - #TODO: anything to do with such entries? - } if ($::DISPLAY) { From 2bad8de18e8391a97c78a4d1fa8f260e09d89329 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 3 May 2021 15:05:27 -0400 Subject: [PATCH 63/82] Fix formatting and grammar for makenetworks man page --- .../references/man8/makenetworks.8.rst | 26 ++++++++++++------- xCAT-client/pods/man8/makenetworks.8.pod | 14 +++++----- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst index 6cead8f4d..0ee0733c3 100644 --- a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst @@ -35,9 +35,9 @@ The \ **makenetworks**\ command can be used to gather network information from Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save that information in the xCAT database. -You can use the "-d" option to display the network information without writing it to the database. +You can use the \ **-d**\ option to display the network information without writing it to the database. You can also redirect the output to a file that can be used with the xCAT \ **mkdef**\ command to define the networks. @@ -53,9 +53,9 @@ For example: This features allows you to verify and modify the network information before writing it to the database. -When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the mkdef, chdef, lsdef, and rmdef commands to manage this data. +When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the \ **mkdef**\ , \ **chdef**\ , \ **lsdef**\ , and \ **rmdef**\ commands to manage this data. -The default naming convention is to use a hyphen separated "net" and "mask" value with the "." replace by "_". (ex. "8_124_47_64-255_255_255_0") +The default naming convention is to use a hyphen separated "net" and "mask" values with the "." replaced by "_". (ex. "8_124_47_64-255_255_255_0") You can also modify the xCAT "networks" database table directly using the xCAT \ **tabedit**\ command. @@ -121,13 +121,19 @@ EXAMPLES makenetworks -d - The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the lsdef, mkdef, chdef and rmdef commands. + The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the \ **lsdef**\ , \ **mkdef**\ , \ **chdef**\ and \ **rmdef**\ commands. + + + .. code-block:: perl + + 9_114_37_0-255_255_255_0: + objtype=network + gateway=9.114.37.254 + mask=255.255.255.0 + net=9.114.37.0 + mgtifname=ens3 + mtu=1500 - 9_114_37_0-255_255_255_0: - objtype=network - gateway=9.114.37.254 - mask=255.255.255.0 - net=9.114.37.0 diff --git a/xCAT-client/pods/man8/makenetworks.8.pod b/xCAT-client/pods/man8/makenetworks.8.pod index 402873c43..f7c4f3173 100644 --- a/xCAT-client/pods/man8/makenetworks.8.pod +++ b/xCAT-client/pods/man8/makenetworks.8.pod @@ -16,9 +16,9 @@ The B command can be used to gather network information from an xC Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save that information in the xCAT database. -You can use the "-d" option to display the network information without writing it to the database. +You can use the B<-d> option to display the network information without writing it to the database. You can also redirect the output to a file that can be used with the xCAT B command to define the networks. @@ -30,9 +30,9 @@ For example: This features allows you to verify and modify the network information before writing it to the database. -When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the mkdef, chdef, lsdef, and rmdef commands to manage this data. +When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the B, B, B, and B commands to manage this data. -The default naming convention is to use a hyphen separated "net" and "mask" value with the "." replace by "_". (ex. "8_124_47_64-255_255_255_0") +The default naming convention is to use a hyphen separated "net" and "mask" values with the "." replaced by "_". (ex. "8_124_47_64-255_255_255_0") You can also modify the xCAT "networks" database table directly using the xCAT B command. @@ -77,13 +77,15 @@ Display cluster network information but do not write the network definitions to makenetworks -d -The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the lsdef, mkdef, chdef and rmdef commands. +The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the B, B, B and B commands. -9_114_37_0-255_255_255_0: + 9_114_37_0-255_255_255_0: objtype=network gateway=9.114.37.254 mask=255.255.255.0 net=9.114.37.0 + mgtifname=ens3 + mtu=1500 =back From c4dc079e7e643d341c6043793f68436e395556e6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 4 May 2021 11:49:02 -0400 Subject: [PATCH 64/82] Add makenetworks testcase to daily bundles --- xCAT-test/autotest/bundle/rhels_ppc_daily.bundle | 1 + xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/rhels_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle | 1 + 7 files changed, 7 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 92129c212..50a0de914 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -141,6 +141,7 @@ makeknownhosts_node_d tabdump_servicenode makentp_h makentp_v +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index f8b4cb4ad..a39991440 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -142,6 +142,7 @@ makehosts_null makeknownhosts_node_d makentp_h makentp_v +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index b5f2fadc0..608e862ee 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -142,6 +142,7 @@ makehosts_null makeknownhosts_node_d makentp_h makentp_v +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 3a0443bda..db5fb3832 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -102,6 +102,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index 0b1d3e307..33c28f32a 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -102,6 +102,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 753958701..92a9daad8 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -71,6 +71,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 83ba17e6a..712a82052 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -71,6 +71,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip From ff37c2fd6ac30f460cc10b98f88314ff954d4810 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 11 Oct 2019 10:25:38 -0400 Subject: [PATCH 65/82] Extend timeout for xcatd Particularly on service nodes, it takes longer to startup and systemd needs to be more patient. --- xCAT-server/etc/init.d/xcatd.service | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/etc/init.d/xcatd.service b/xCAT-server/etc/init.d/xcatd.service index 74cbfa1c8..0ec230f0b 100644 --- a/xCAT-server/etc/init.d/xcatd.service +++ b/xCAT-server/etc/init.d/xcatd.service @@ -12,6 +12,7 @@ LimitNOFILE=16000 RemainAfterExit=no Restart=on-failure RestartSec=5s +TimeoutStartSec=600 [Install] WantedBy=multi-user.target From 90b37073413e700f1f1448667cd41f253a84afd4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 4 May 2021 14:00:14 -0400 Subject: [PATCH 66/82] Undo bundle changes --- xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 - xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 - xCAT-test/autotest/bundle/sles_x86_weekly.bundle | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index f904d1a1b..3a0443bda 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -253,4 +253,3 @@ xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab go_xcat_devel_from_repo -reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index f023a4d57..ddfa86713 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -18,3 +18,4 @@ reg_linux_diskfull_installation_flat compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index f46da8963..0b1d3e307 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -252,4 +252,3 @@ xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab go_xcat_devel_from_repo -reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index d0859c03f..a523a0746 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -18,3 +18,4 @@ reg_linux_diskfull_installation_flat compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs +reg_linux_statelite_installation_flat From 72efeba8814badbcaf1f2ec2f81d33a89d8efad3 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 4 May 2021 14:06:20 -0400 Subject: [PATCH 67/82] Improve verification of makentp_extntpserver_value --- xCAT-test/autotest/testcase/makentp/cases0 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index b807e4893..de84b8ed5 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -54,12 +54,8 @@ cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock -w;else hwclock -w check:rc==0 cmd:makentp check:rc==0 -check:output=~configuring management node: $$MN cmd:makentp -V -check:rc==0 -check:output=~configuring management node: $$MN -check:output=~Calling ... /install/postscripts/setupntp -check:output=~Daemon chronyd configured +check:output!~Error cmd:curryear=`cat /tmp/currentyear`;date | grep $curryear check:rc==0 check:output=~\d From 42db72b38cc540dea2f2ad30103ce4efe0b9c125 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 5 May 2021 11:09:43 -0400 Subject: [PATCH 68/82] Remove makentp -V --- xCAT-test/autotest/testcase/makentp/cases0 | 2 -- 1 file changed, 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index de84b8ed5..cf5a27d64 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -54,8 +54,6 @@ cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock -w;else hwclock -w check:rc==0 cmd:makentp check:rc==0 -cmd:makentp -V -check:output!~Error cmd:curryear=`cat /tmp/currentyear`;date | grep $curryear check:rc==0 check:output=~\d From a9f00e50985a017df9834cdfbbba6682375231fa Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 5 May 2021 13:53:32 -0400 Subject: [PATCH 69/82] Exclude processing host entries for makenetworks --- xCAT-server/lib/xcat/plugins/networks.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index e56b4dd60..4a906e778 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -458,7 +458,13 @@ sub donets my $firstoctet = $ent[0]; $firstoctet =~ s/^(\d+)\..*/$1/; - if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239) or $ent[0] eq "127.0.0.0") + # Do not process network entries that + # match 169.254.0.0 or 127.0.0.0 + # OR + # in range 224.x.x.x thru 239.x.x.x + # OR + # do not contain '/' + if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239) or $ent[0] eq "127.0.0.0" or $ent[0] !~ "/") { next; } From fb34d2b9ff06910c8cba56fcdbb8695e001481a0 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 5 May 2021 17:23:03 -0400 Subject: [PATCH 70/82] Cumulus bin file to be recognized correctly on RHEL 8.x --- xCAT-server/lib/xcat/plugins/copycds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index 3f6bf14ad..62b2e6ed5 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -115,7 +115,7 @@ sub process_request { return; } - if (grep /$file: data/, @filestat) { + if ((grep /$file: data/, @filestat) || (grep /$file: .* \(binary data/, @filestat)) { if ($xcatdebugmode) { $callback->({ info => "run copydata for data file = $file" }); } From 9c13a7712f2466ca69efabbba14f3196021c29f3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 7 May 2021 13:19:39 -0400 Subject: [PATCH 71/82] Add Oracle Linux to go-xcat --- xCAT-server/share/xcat/tools/go-xcat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index b4e41e529..69a7d4ed1 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.47 +# Version 1.0.48 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -34,6 +34,8 @@ # go-xcat --xcat-version=stable install # 2021-02-18 Mark Gurevich # - On Ubuntu remove packages one at a time +# 2021-05-07 Mark Gurevich +# - Add support for Oracle Linux # @@ -1397,6 +1399,7 @@ function add_xcat_dep_repo_yum_or_zypper() local distro="${GO_XCAT_LINUX_DISTRO}${GO_XCAT_LINUX_VERSION%%.*}" case "${distro}" in "centos"*) distro="rh${distro#centos}" ;; + "ol"*) distro="rh${distro#ol}" ;; "fedora10"|"fedora11") distro="fedora9" ;; "fedora1"[678]) distro="rh6" ;; "fedora19"|"fedora2"?) distro="rh7" ;; @@ -2096,7 +2099,7 @@ Version: ${GO_XCAT_LINUX_VERSION} EOF case "${GO_XCAT_LINUX_DISTRO}" in -"centos"|"fedora"|"rhel"|"sles"|"ubuntu") +"centos"|"fedora"|"rhel"|"sles"|"ubuntu"|"ol") ;; *) warn_if_bad 1 "${GO_XCAT_LINUX_DISTRO}: unsupported Linux distro" From b8f9c70fd25a54df83eb3491be4b53ec06d5ef00 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 7 May 2021 16:39:54 -0400 Subject: [PATCH 72/82] Process .bin files correctly by nodeset on RHEL 8.x --- xCAT-server/lib/xcat/plugins/onie.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/onie.pm b/xCAT-server/lib/xcat/plugins/onie.pm index 35cae4d6d..ccd49f4e1 100644 --- a/xCAT-server/lib/xcat/plugins/onie.pm +++ b/xCAT-server/lib/xcat/plugins/onie.pm @@ -306,7 +306,7 @@ sub nodeset { my $flag=0; if (-r $image_pkgdir) { my @filestat = `file $image_pkgdir`; - if (grep /$image_pkgdir: data/, @filestat) { + if ((grep /$image_pkgdir: data/, @filestat) || (grep /$image_pkgdir: .* \(binary data/, @filestat)) { $flag=1; } } From 5cca49607d9239a9450a3648d291a21ac8af0c10 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 11 May 2021 14:59:06 -0400 Subject: [PATCH 73/82] Support Oracle Linux in SN_setup_case testcase --- xCAT-test/autotest/testcase/installation/SN_setup_case | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 2061dcdb3..3d5628ef8 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -46,13 +46,13 @@ check:rc==0 cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo . check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";path2="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";path2="rh";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path2$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; check:rc==0 #add support python in sn @@ -106,7 +106,7 @@ check:rc==0 cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN "rpm -qa|grep python2-greenlet"; else echo "there is no xCAT-openbmc-py installed in MN, skip check python2-greenlet installation in SN"; exit 0;fi check:rc==0 cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" -cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi +cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" || "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi check:rc==0 cmd:makentp -a check:rc==0 From 01cd4bbeb0ec1a12f56d76cea955f42cef2bbd44 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 12 May 2021 11:46:40 -0400 Subject: [PATCH 74/82] Testcase install of squashfs for Oracle Linux --- .../installation/reg_linux_diskless_installation_hierarchy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 09fca6e28..6f483fbfd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -156,8 +156,8 @@ cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netb cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -#Make sure squashfs-tools rpm is installed on RHEL -cmd:if [[ "$$OS" =~ "rhel" ]]; then yum install -y squashfs-tools; fi +#Make sure squashfs-tools rpm is installed on RHEL and OL +cmd:if [[ "$$OS" =~ "rhel" || "$$OS" =~ "ol" ]]; then yum install -y squashfs-tools; fi #Make sure squashfs-tools rpm is installed on Ubuntu cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi From 3a621267002a2e57abf01560aebef6cb6a31736c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 14 May 2021 09:37:14 -0400 Subject: [PATCH 75/82] Fix xdcp man page formatting --- .../guides/admin-guides/references/man1/xdcp.1.rst | 10 +++++----- xCAT-client/pods/man1/xdcp.1.pod | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst index 49732546a..7ec1fd495 100644 --- a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst @@ -19,7 +19,7 @@ xdcp.1 **************** -\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command] [\ \*\*-R\*\*\ ] [\ \*\*-t\*\*\ \ \*timeout\*\ ] [\ \*\*-T\*\*\ ] [\ \*\*-v\*\*\ ] [\ \*\*-q\*\*\ ] [\ \*\*-X\*\*\ \ \*env_list\*\ ] \ \*sourcefile.... targetpath\*\ *\ +\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *user_ID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command*\ ] [\ **-R**\ ] [\ **-t**\ \ *timeout*\ ] [\ **-T**\ ] [\ **-v**\ ] [\ **-q**\ ] [\ **-X**\ \ *env_list*\ ] \ *sourcefile.... targetpath*\ \ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsynclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] @@ -46,7 +46,7 @@ If the Management Node is target node, it must be defined in the xCAT database w \ **REMOTE**\ \ **USER**\ : -A user_ID can be specified for the remote copy command. Remote user +A \ *user_ID*\ can be specified for the remote copy command. Remote user specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. See the \ **xdsh**\ command for more information. @@ -165,8 +165,8 @@ standard output or standard error is displayed. \ **-P | -**\ **-pull**\ Pulls (copies) the files from the targets and places them in - the \ *targetpath*\ directory on the local host. The \ *targetpath*\ - must be a directory. Files pulled from remote machines have + the \ *targetpath*\ directory on the local host. The \ *targetpath*\ must + be a directory. Files pulled from remote machines have \ **._target**\ appended to the file name to distinguish between them. When the \ **-P**\ flag is used with the \ **-R**\ flag, \ **._target**\ is appended to the directory. Only one file per invocation of the @@ -201,7 +201,7 @@ standard output or standard error is displayed. -\ **-R | -**\ **-recursive**\ \ *recursive*\ +\ **-R | -**\ **-recursive**\ Recursively copies files from a local directory to the remote targets, or when specified with the \ **-P**\ flag, recursively pulls diff --git a/xCAT-client/pods/man1/xdcp.1.pod b/xCAT-client/pods/man1/xdcp.1.pod index bd41741bc..3ce346d34 100644 --- a/xCAT-client/pods/man1/xdcp.1.pod +++ b/xCAT-client/pods/man1/xdcp.1.pod @@ -4,7 +4,7 @@ B - Concurrently copies files to or from multiple nodes. In addition, prov =head1 B -B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I +B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-R>] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I B I [B<-F> I] [B<-r> I] @@ -28,7 +28,7 @@ If the Management Node is target node, it must be defined in the xCAT database w B B: -A user_ID can be specified for the remote copy command. Remote user +A I can be specified for the remote copy command. Remote user specification is identical for the B and B commands. See the B command for more information. @@ -130,8 +130,8 @@ the configured remote copy command. =item B<-P>|B<--pull> Pulls (copies) the files from the targets and places them in -the I directory on the local host. The I -must be a directory. Files pulled from remote machines have +the I directory on the local host. The I must +be a directory. Files pulled from remote machines have B<._target> appended to the file name to distinguish between them. When the B<-P> flag is used with the B<-R> flag, B<._target> is appended to the directory. Only one file per invocation of the @@ -162,7 +162,7 @@ Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B 3) if the destination file specified in synclist file is an existing directory on target node, B will fail with "scp: : Is a directory" -=item B<-R>|B<--recursive> I +=item B<-R>|B<--recursive> Recursively copies files from a local directory to the remote targets, or when specified with the B<-P> flag, recursively pulls From 783618dea5e567929620ca87f6070bcf308db9fa Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 14 May 2021 15:06:35 -0400 Subject: [PATCH 76/82] Add timeout to confignetwork testcases --- xCAT-test/autotest/testcase/confignetwork/cases0 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 10be8284a..132aff547 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -790,7 +790,7 @@ check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 -cmd:updatenode $$CN -P confignetwork +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 @@ -798,7 +798,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;chdef $$CN nicnetworks.br0=confignetworks_test3 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=$br0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet check:rc==0 -cmd:updatenode $$CN -P confignetwork +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 @@ -846,7 +846,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 -cmd:updatenode $$CN -P confignetwork +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 @@ -855,7 +855,7 @@ check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;br33ip=$var2$var3;chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=confignetworks_test3 nicnetworks.br33=confignetworks_test4 nicips.br22=$br22ip nicips.br33=$br33ip nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 -cmd:updatenode $$CN -P confignetwork +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 From 6f02e510ec2407ad3c2badac5c6e87c2e7d95d36 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 17 May 2021 18:01:04 -0400 Subject: [PATCH 77/82] Add 2.16.2 Release to the csv file --- docs/source/overview/_files/2.16.x.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index ae69165bc..f70bd4f0c 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,3 +1,4 @@ Version,Release Date,New OS Supported,Release Notes +2.16.2,2021-05-21,"RHEL 8.3",`2.16.2 Release Notes `_ 2.16.1,2020-11-06,"RHEL 8.2",`2.16.1 Release Notes `_ 2.16.0,2020-06-17,"RHEL 8.1,SLES 15",`2.16.0 Release Notes `_ From 63ebc1497b555cb1c2adff93d8f291548a6702b2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 19 May 2021 14:07:29 -0400 Subject: [PATCH 78/82] Extract full version information --- xCAT-client/bin/mysqlsetup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 0b8f87ee4..f3449ea6b 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -146,7 +146,8 @@ if (-e "/etc/debian_version") { } # determine whether redhat or sles -$::linuxos = xCAT::Utils->osver(); +$::linuxos = xCAT::Utils->osver("all"); # returns "name,version.release" +$::linuxos =~ tr/,//d; # remove comma separating release name and version numbers # is this MariaDB or MySQL $::MariaDB = 0; From 934b66df9148749a082b5c78678120979955dda8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 19 May 2021 14:30:36 -0400 Subject: [PATCH 79/82] Use non-interactive flag when calling zypper install --- xCAT-test/autotest/testcase/migration/sles_migration | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a0afec2a5..f11c55662 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -45,7 +45,7 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "rm -rf /oldxcat" cmd:xdsh $$CN "mkdir -p /oldxcat" check:rc==0 -cmd:xdsh $$CN "zypper install bzip2" +cmd:xdsh $$CN "zypper -n install bzip2" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION1_DEP" check:rc==0 @@ -164,7 +164,7 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "rm -rf /oldxcat" cmd:xdsh $$CN "mkdir -p /oldxcat" check:rc==0 -cmd:xdsh $$CN "zypper install bzip2" +cmd:xdsh $$CN "zypper -n install bzip2" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION2_CORE" check:rc==0 From d8bb3ea2db7dacdc5f91e2f11a7ee569d7c25c30 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 19 May 2021 15:30:49 -0400 Subject: [PATCH 80/82] Link file for all OSes --- xCAT-client/bin/mysqlsetup | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index f3449ea6b..3d0cd6fcf 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -146,8 +146,7 @@ if (-e "/etc/debian_version") { } # determine whether redhat or sles -$::linuxos = xCAT::Utils->osver("all"); # returns "name,version.release" -$::linuxos =~ tr/,//d; # remove comma separating release name and version numbers +$::linuxos = xCAT::Utils->osver(); # is this MariaDB or MySQL $::MariaDB = 0; @@ -901,14 +900,12 @@ sub initmysqldb } $cmd = "$sqlcmd --user=mysql"; - #on rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip, - #but it's available at the /usr/bin/resolveip - if ($::linuxos eq "rhels7.7") { - my $resolveip="/usr/libexec/resolveip"; - if (!(-x ($resolveip))) { - my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; - xCAT::Utils->runcmd($linkcmd, 0); - } + # On rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip + # Link it to /usr/bin/resolveip for all OSes, just in case some future releases have the same requirement + my $resolveip="/usr/libexec/resolveip"; + if (!(-x ($resolveip))) { + my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; + xCAT::Utils->runcmd($linkcmd, 0); } } xCAT::Utils->runcmd($cmd, 0); From 61bbd59ecf6f63d435ed76098a25e16b3f51fe32 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 20 May 2021 09:20:50 -0400 Subject: [PATCH 81/82] Use correct substring operator in migration testcase --- xCAT-test/autotest/testcase/migration/sles_migration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index f11c55662..2a606a2d2 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -189,7 +189,7 @@ check:rc==0 cmd:xdsh $$CN "zypper -n install xCAT" check:rc==0 # Name of createrepo package on sles15 is different from sles12 -cmd:if [ "__GETNODEATTR($$CN,os)__" = "sle15" ]; then xdsh $$CN "zypper -n install createrepo_c"; else xdsh $$CN "zypper -n install createrepo";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "sle15" ]]; then xdsh $$CN "zypper -n install createrepo_c"; else xdsh $$CN "zypper -n install createrepo";fi check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh" check:rc==0 From 2c63aa83cc5c36f840250c9e938c29f19de628ac Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 20 May 2021 10:37:54 -0400 Subject: [PATCH 82/82] Change the 2.16.2 release date --- docs/source/overview/_files/2.16.x.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index f70bd4f0c..9e9a9778c 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,4 +1,4 @@ Version,Release Date,New OS Supported,Release Notes -2.16.2,2021-05-21,"RHEL 8.3",`2.16.2 Release Notes `_ +2.16.2,2021-05-25,"RHEL 8.3",`2.16.2 Release Notes `_ 2.16.1,2020-11-06,"RHEL 8.2",`2.16.1 Release Notes `_ 2.16.0,2020-06-17,"RHEL 8.1,SLES 15",`2.16.0 Release Notes `_