From c58a9ab092c1d7d7a1670fd1681e580af41f7354 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 2 Mar 2020 15:34:39 -0500 Subject: [PATCH 001/102] Fix a typo from xcat-inventory to xcat_inventory --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 7cc2a4641..f95a839b9 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1761,7 +1761,7 @@ sub get_files_recursive next if ($direntry eq '..'); my $target = "$dir/$direntry"; if (-d $target) { - unless ($target =~ /xcat-inventory\/templates/){ + unless ($target =~ /xcat_inventory\/templates/){ get_files_recursive($target, $files_path_ref); } } else { From 8ed951b02dd047bea13017647a5f1a27b8787b41 Mon Sep 17 00:00:00 2001 From: Lachlan Simpson Date: Thu, 5 Mar 2020 09:36:14 +1100 Subject: [PATCH 002/102] Minor documentation fixes: spelling, grammar; configib indentation --- .../domain_name_resolution.rst | 4 +- .../network/cfg_network_extra_param.rst | 2 +- xCAT/postscripts/configib | 54 +++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index 03eaeaad3..063be13f2 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -301,7 +301,7 @@ nicips example: :: NOTE: The management interface **(eth0)**, that the **compute02** IP is configured on, is not included in the list of additional nics. Although adding it to the list of nics would do no harm. -This **nicips** value indicates that there are two additional interfaces to be configured on node compute02,eth1 and eth2. The **eth1** interface will get the IP address **11.10.1.2**. The **eth2** interface will get two IP addresses, **"80.0.0.2" and "70.0.0.2"**. +This **nicips** value indicates that there are two additional interfaces to be configured on node compute02, eth1 and eth2. The **eth1** interface will get the IP address **11.10.1.2**. The **eth2** interface will get two IP addresses, **"80.0.0.2" and "70.0.0.2"**. nichostnamesuffixes example: :: @@ -329,7 +329,7 @@ nicnetworks example: :: chdef -t node -o compute02 nicnetworks.eth1=clstrnet11 nicnetworks.eth2='clstrnet80|clstrnet-lab' -In this example we are saying that the IP address of "eth0" (ie. compute02-eth1 -> 11.10.1.2) is part of the xCAT network named **"clstrnet11"**. **"compute02-eth2"** is in network **"clstrnet80"** and **"compute02-eth2-lab"** is in **"clstrnet-lab"**. +In this example we are saying that the IP address of **"eth1"** (ie. compute02-eth1 -> 11.10.1.2) is part of the xCAT network named **"clstrnet11"**. **"compute02-eth2"** is in network **"clstrnet80"** and **"compute02-eth2-lab"** is in **"clstrnet-lab"**. By default the xCAT code will attempt to match the interface IP to one of the xCAT network definitions. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst index 6934cbec2..1e5adbcec 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst @@ -9,7 +9,7 @@ Use ``nicextraparams`` to customize attributes in NIC configuration file. For ex chdef cn1 nicextraparams.eth1="MTU=1456 ONBOOT=no" - #. After ``confignetwork`` is executed in ``cn1``, ``nicexraparams`` will overwrite the original value in ``/etc/sysconfig/network-scripts/ifcfg-eth1`` as :: + #. After ``confignetwork`` is executed in ``cn1``, ``nicextraparams`` will overwrite the original value in ``/etc/sysconfig/network-scripts/ifcfg-eth1`` as :: DEVICE=eth1 IPADDR=13.1.89.7 diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 41271ccf8..bcddc25e7 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -192,38 +192,38 @@ then rm -f $dir/ifcfg-$nic 2>&1 1>/dev/null done - else - interfaces="/etc/network/interfaces" + else + interfaces="/etc/network/interfaces" - for tmp in `sed -n "/auto ib/=" ${interfaces}` + for tmp in `sed -n "/auto ib/=" ${interfaces}` + do + startline=`sed -n "/auto ib/=" ${interfaces}| head -n 1` + endline=`sed -n "$startline,/^auto/p" ${interfaces} |wc -l` + + if sed -n "$startline,/^auto/p" ${interfaces} |sed '$!d' |grep "auto" >/dev/null;then + endline=`expr $startline + $endline - 2` + else + endline=`expr $startline + $endline - 1` + fi + + ((startline--)) + temp=`sed -n ${startline}p ${interfaces}` + while [[ $temp =~ ^# ]] do - startline=`sed -n "/auto ib/=" ${interfaces}| head -n 1` - endline=`sed -n "$startline,/^auto/p" ${interfaces} |wc -l` - - if sed -n "$startline,/^auto/p" ${interfaces} |sed '$!d' |grep "auto" >/dev/null;then - endline=`expr $startline + $endline - 2` - else - endline=`expr $startline + $endline - 1` - fi - ((startline--)) temp=`sed -n ${startline}p ${interfaces}` - while [[ $temp =~ ^# ]] - do - ((startline--)) - temp=`sed -n ${startline}p ${interfaces}` - done - ((startline++)) - - temp=`sed -n ${endline}p ${interfaces}` - while [[ $temp =~ ^# ]] - do - ((endline--)) - temp=`sed -n ${endline}p ${interfaces}` - done - - sed -i ${startline},${endline}d ${interfaces} done + ((startline++)) + + temp=`sed -n ${endline}p ${interfaces}` + while [[ $temp =~ ^# ]] + do + ((endline--)) + temp=`sed -n ${endline}p ${interfaces}` + done + + sed -i ${startline},${endline}d ${interfaces} + done fi else loop_number=`lsdev | grep "IP over Infiniband Network Interface" | wc -l` From 64cf00a8aca2d4c3560bc0293624f73e413efa98 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 5 Mar 2020 14:00:40 -0500 Subject: [PATCH 003/102] Update version from 2.15.1 to 2.15.2 --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 3b1fc7950..07d875c2d 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.15.1 +2.15.2 From 8e30c79eddede06af6ff23357fd5a90097e3ca84 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 5 Mar 2020 14:01:56 -0500 Subject: [PATCH 004/102] Update version from 2.15.1 to 2.15.2 --- 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 0a3d8b2c3..9ea646c4c 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.15.1' +release = '2.15.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From f58645bcb970eefac5b8900393ea91fe8a09ac66 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 6 Mar 2020 13:37:24 -0500 Subject: [PATCH 005/102] go-xcat testcase enhancements --- .../testcase/commoncmd/retry_install.sh | 2 +- xCAT-test/autotest/testcase/go_xcat/case3 | 20 +++++++++++-------- xCAT-test/autotest/testcase/rpower/cases0 | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index 770033781..540ff7c6a 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -24,7 +24,7 @@ do if [[ ! -z $vmhost ]];then # Display memory and active VMs on VM host, when installing on VM echo "Memory on vmhost $vmhost" - ssh $vmhost free -g + ssh $vmhost free -m echo "Active VMs on vmhost $vmhost" ssh $vmhost virsh list fi diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 42edb9024..a50aa9f8a 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -4,8 +4,9 @@ label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Service not did not boot after 5 min, reprovision it +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute @@ -39,8 +40,9 @@ label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Service not did not boot after 5 min, reprovision it +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute @@ -74,8 +76,9 @@ label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Service not did not boot after 5 min, reprovision it +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute @@ -119,8 +122,9 @@ label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Service not did not boot after 5 min, reprovision it +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 1d413dd2d..52e86422f 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -43,7 +43,7 @@ cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do slee cmd:rpower $$CN stat check:output=~Not Activated|off # Display active VMs and memory on VM host -cmd:vmhost=`lsdef $$CN -i vmhost -c | cut -d '=' -f 2`; if [[ ! -z $vmhost ]]; then echo "Memory on vmhost $vmhost"; ssh $vmhost free -g; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi +cmd:vmhost=`lsdef $$CN -i vmhost -c | cut -d '=' -f 2`; if [[ ! -z $vmhost ]]; then echo "Memory on vmhost $vmhost"; ssh $vmhost free -m; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi cmd:rpower $$CN boot check:rc==0 cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done From 05ea25c377ea565895746cf3c376aa4ec481c85c Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 6 Mar 2020 13:54:36 -0500 Subject: [PATCH 006/102] Failed to set hostname on sle15 statelite compute node --- xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh | 2 +- .../testcase/installation/reg_linux_statelite_installation_flat | 2 +- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 +- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh index f52312e38..c004d623c 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh @@ -160,7 +160,7 @@ STARTMODE='auto' EOF if [ -f $NEWROOT/etc/hostname ]; then - echo `hostname -s` > $NEWROOT/etc/hostname + echo "$ME" > $NEWROOT/etc/hostname fi if [ ! -z "$ifname" ]; then diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index a7f5223bc..3b9075dc9 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -48,7 +48,7 @@ check:rc==0 cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow check:rc==0 -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir.regbak; mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=nfs 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 187d837b7..64e3fca66 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 @@ -59,7 +59,7 @@ check:rc==0 cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow check:rc==0 -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir.regbak; mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute 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 bc49996a9..6337a694f 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 @@ -57,7 +57,7 @@ check:rc==0 cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow check:rc==0 -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir.regbak; mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=ramdisk check:rc==0 From cf8bc784ef6dc61f5b6a7671869c0748f4e8aca2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 9 Mar 2020 15:16:08 -0400 Subject: [PATCH 007/102] Bump up VM disk space for some regression tests --- xCAT-test/autotest/testcase/installation/setup_vm | 4 ++-- xCAT-test/autotest/testcase/rmimage/case0 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index a9613d522..0747600d0 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -1,7 +1,7 @@ start:setup_vm description:reset up vm environment if need label:others -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ];then echo "CN node $$CN is a vm which mgt is __GETNODEATTR($$CN,mgt)__, start to recreate the vm now"; echo "rpower $$CN off"; rpower $$CN off; sleep 3; echo "rpower $$CN stat"; rpower $$CN stat; var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`; echo "The disk create way of $$CN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$CN"; mkvm $$CN; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN"; mkvm $$CN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$CN -s 20G -f"; mkvm $$CN -s 20G -f; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN -s 20G -f"; mkvm $$CN -s 20G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me"; exit 2; else echo "unsupported disk creation way"; exit 3;fi;else echo "CN node $$CN is a non-VM; do not need to recreate it";fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ];then echo "CN node $$CN is a VM, mgt is __GETNODEATTR($$CN,mgt)__, starting to recreate the vm"; echo "rpower $$CN off"; rpower $$CN off; sleep 3; echo "rpower $$CN stat"; rpower $$CN stat; var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`; echo "The disk type of $$CN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$CN"; mkvm $$CN; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN"; mkvm $$CN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$CN -s 25G -f"; mkvm $$CN -s 25G -f; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN -s 25G -f"; mkvm $$CN -s 25G -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 "CN node $$CN is not a VM; do not need to recreate it";fi check:rc==0 cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then echo "CN node is a vm, need to repower it on"; echo "rpower $$CN on"; rpower $$CN on; else echo "CN node $$CN is a non-VM; do not need to repower on it"; fi @@ -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 which mgt is __GETNODEATTR($$SN,mgt)__, start to recreate the vm now"; 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 create way 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 20G -f"; mkvm $$SN -s 20G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 20G -f"; mkvm $$SN -s 20G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me"; exit 2; else echo "unsupported disk creation way"; exit 3;fi;else echo "SN node $$SN is a non-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 25G -f"; mkvm $$SN -s 25G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 25G -f"; mkvm $$SN -s 25G -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 diff --git a/xCAT-test/autotest/testcase/rmimage/case0 b/xCAT-test/autotest/testcase/rmimage/case0 index 7e3795f01..3f115f1e8 100644 --- a/xCAT-test/autotest/testcase/rmimage/case0 +++ b/xCAT-test/autotest/testcase/rmimage/case0 @@ -1,7 +1,7 @@ start:rmimage_diskless description:This case is to test rmimage could work correctly to remove all image files. -cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi label:others,packaging +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi cmd:copycds $$ISO check:rc==0 cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute From 2ecddf949d467d374edb782e44db7633ff06a5ef Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 9 Mar 2020 16:13:54 -0400 Subject: [PATCH 008/102] mkdef manpage new example --- .../admin-guides/references/man1/mkdef.1.rst | 55 ++++++++++++++----- xCAT-client/pods/man1/mkdef.1.pod | 44 ++++++++++----- 2 files changed, 69 insertions(+), 30 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst index 066084735..79f305bb7 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -This command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The force option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created. +The \ **mkdef**\ command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The \ **-**\ **-force**\ option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created. ******* @@ -40,15 +40,15 @@ OPTIONS \ *attr=val [attr=val ...]*\ - Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. Use the help option to get a list of valid attributes for each object type. + Specifies one or more "attribute equals value" pairs, separated by spaces. \ *attr=val*\ pairs must be specified last on the command line. Use the \ **-**\ **-help**\ option to get a list of valid attributes for each object type. - Note: when creating node object definitions, the 'groups' attribute is required. + Note: when creating node object definitions, the \ **groups**\ attribute is required. \ **-d|-**\ **-dynamic**\ - Use the dynamic option to create dynamic node groups. This option must be used with -w option. + Use the dynamic option to create dynamic node groups. This option must be used with \ **-w**\ option. @@ -66,7 +66,7 @@ OPTIONS \ *noderange*\ - A set of comma delimited node names and/or group names. (must be the first parameter) See the "noderange" man page for details on supported formats. + A set of comma delimited node names and/or group names. (must be the first parameter) See the man page for details on supported formats. @@ -78,7 +78,7 @@ OPTIONS \ **-t**\ \ *object-types*\ - A set of comma delimited object types. Use the help option to get a list of valid object types. + A set of comma delimited object types. Use the \ **-**\ **-help**\ option to get a list of valid object types. @@ -96,30 +96,43 @@ OPTIONS \ **-w**\ \ *attr==val*\ \ **-w**\ \ *attr=~val*\ ... - Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. + Use one or multiple \ **-w**\ flags to specify the selection string that can be used to select objects. The operators \ **==**\ , \ **!=**\ , \ **=~**\ and \ **!~**\ are available. For \ **mkdef**\ command, the \ **-w**\ flag only makes sense for creating dynamic node group. Use the \ **-**\ **-help**\ option to get a list of valid attributes for each object type. Operator descriptions: - == Select nodes where the attribute value is exactly this value. - != Select nodes where the attribute value is not this specific value. - =~ Select nodes where the attribute value matches this regular expression. - !~ Select nodes where the attribute value does not match this regular expression. - Note: if the "val" fields includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is "!~", the "attrval" needs to be quoted using single quote. + + \ **==**\ Select nodes where the attribute value is exactly this value. + + + + \ **!=**\ Select nodes where the attribute value is not this specific value. + + + + \ **=~**\ Select nodes where the attribute value matches this regular expression. + + + + \ **!~**\ Select nodes where the attribute value does not match this regular expression. + + + + Note: if the "val" field includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is \ **!~**\ , the "attrval" needs to be quoted using single quote. \ **-z|-**\ **-stanza**\ - Indicates that the file being piped to the command is in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files. + Indicates that the file being piped to the command is in stanza format. See the \ **xcatstanzafile**\ man page for details on using xCAT stanza files. \ **-u**\ - Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search "/install/custom/" directory first, and then "/opt/xcat/share/". + Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search \ **/install/custom/**\ directory first, and then \ **/opt/xcat/share/**\ . The \ *provmethod*\ and \ *profile*\ must be specified. If \ *osvers*\ or \ *osarch*\ is not specified, the corresponding value of the management node will be used. - Note: this option only works for objtype \ **osimage**\ . + Note: this option only works for object type \ **osimage**\ . @@ -310,6 +323,18 @@ EXAMPLES +15. + + To create a dynamic group definition based on nodename, which will include all nodes named "fs2vm\*" + + + .. code-block:: perl + + mkdef -t group mg_vms -d -w node=~"/fs2vm.*" + + + + ***** FILES diff --git a/xCAT-client/pods/man1/mkdef.1.pod b/xCAT-client/pods/man1/mkdef.1.pod index e712674f1..8fa91996f 100644 --- a/xCAT-client/pods/man1/mkdef.1.pod +++ b/xCAT-client/pods/man1/mkdef.1.pod @@ -11,7 +11,7 @@ B [B<-V>|B<--verbose>] [B<-t> I] [B<--template> I command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The B<--force> option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created. =head1 OPTIONS @@ -20,13 +20,13 @@ This command is used to create xCAT object definitions which are stored in the x =item I -Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. Use the help option to get a list of valid attributes for each object type. +Specifies one or more "attribute equals value" pairs, separated by spaces. I pairs must be specified last on the command line. Use the B<--help> option to get a list of valid attributes for each object type. -Note: when creating node object definitions, the 'groups' attribute is required. +Note: when creating node object definitions, the B attribute is required. =item B<-d|--dynamic> -Use the dynamic option to create dynamic node groups. This option must be used with -w option. +Use the dynamic option to create dynamic node groups. This option must be used with B<-w> option. =item B<-f|--force> @@ -38,7 +38,7 @@ Display usage message. =item I -A set of comma delimited node names and/or group names. (must be the first parameter) See the "noderange" man page for details on supported formats. +A set of comma delimited node names and/or group names. (must be the first parameter) See the man page for details on supported formats. =item B<-o> I @@ -46,7 +46,7 @@ A set of comma delimited object names. =item B<-t> I -A set of comma delimited object types. Use the help option to get a list of valid object types. +A set of comma delimited object types. Use the B<--help> option to get a list of valid object types. =item B<--template> I @@ -58,26 +58,34 @@ Verbose mode. =item B<-w> I B<-w> I ... -Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. +Use one or multiple B<-w> flags to specify the selection string that can be used to select objects. The operators B<==>, B, B<=~> and B are available. For B command, the B<-w> flag only makes sense for creating dynamic node group. Use the B<--help> option to get a list of valid attributes for each object type. Operator descriptions: - == Select nodes where the attribute value is exactly this value. - != Select nodes where the attribute value is not this specific value. - =~ Select nodes where the attribute value matches this regular expression. - !~ Select nodes where the attribute value does not match this regular expression. -Note: if the "val" fields includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is "!~", the "attrval" needs to be quoted using single quote. +=over 3 + +=item B<==> Select nodes where the attribute value is exactly this value. + +=item B Select nodes where the attribute value is not this specific value. + +=item B<=~> Select nodes where the attribute value matches this regular expression. + +=item B Select nodes where the attribute value does not match this regular expression. + +=back + +Note: if the "val" field includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is B, the "attrval" needs to be quoted using single quote. =item B<-z|--stanza> -Indicates that the file being piped to the command is in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files. +Indicates that the file being piped to the command is in stanza format. See the B man page for details on using xCAT stanza files. =item B<-u> -Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search "/install/custom/" directory first, and then "/opt/xcat/share/". +Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search B directory first, and then B. The I and I must be specified. If I or I is not specified, the corresponding value of the management node will be used. -Note: this option only works for objtype B. +Note: this option only works for object type B. =back @@ -179,6 +187,12 @@ To create a node definition from an existing node definition "cn1" mkdef -t node cn2 --template cn1 ip=1.1.1.2 mac=42:3d:0a:05:27:0c +=item 15. + +To create a dynamic group definition based on nodename, which will include all nodes named "fs2vm*" + + mkdef -t group mg_vms -d -w node=~"/fs2vm.*" + =back From 34161b240b54f1bd76ed8d152ae6fe8b386e5ba2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 9 Mar 2020 16:29:33 -0400 Subject: [PATCH 009/102] RHEL8 disk partition template --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index c98667d42..37d2851e5 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -277,15 +277,7 @@ echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/ echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile -if [ "${DISKSIZE}" -lt "62914560" ] -then - echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --percent=86" >>/tmp/partitionfile -else - echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=10240 --maxsize=20480" >>/tmp/partitionfile - echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile - echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile - echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile -fi +echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg size=1024 --grow " >>/tmp/partitionfile # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader" From d6fb685030f4645ea35cbe498f8955eefd63a753 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 10 Mar 2020 11:50:23 -0400 Subject: [PATCH 010/102] Size flag error when partitioning RHEL8 --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 37d2851e5..2cc63fbcb 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -277,7 +277,7 @@ echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/ echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile -echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg size=1024 --grow " >>/tmp/partitionfile +echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --size=1024 --grow " >>/tmp/partitionfile # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader" From bead8ba117cfaf45982143c13b70ceff2b9a2ff4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 12 Mar 2020 11:15:02 -0400 Subject: [PATCH 011/102] Partitioning of disk too large --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 2cc63fbcb..204d73a8e 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -273,7 +273,7 @@ DISKSIZE="$(getdisksize "${instdisk}")" # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=1024" >>/tmp/partitionfile -echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile +echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=1024" >>/tmp/partitionfile echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile From a1f8f56b02733ee90b230ae994f49ccb645513c3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 16 Mar 2020 12:20:07 -0400 Subject: [PATCH 012/102] Testcase debug for rmimage_diskless --- xCAT-test/autotest/testcase/rmimage/case0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rmimage/case0 b/xCAT-test/autotest/testcase/rmimage/case0 index 3f115f1e8..602ff5df7 100644 --- a/xCAT-test/autotest/testcase/rmimage/case0 +++ b/xCAT-test/autotest/testcase/rmimage/case0 @@ -2,12 +2,13 @@ start:rmimage_diskless description:This case is to test rmimage could work correctly to remove all image files. label:others,packaging cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +cmd:df -H cmd:cp -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.gz check:rc==0 cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute From 2bf294c93cb10c229e39e3ab8b793a3321921ee9 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 16 Mar 2020 14:43:32 -0400 Subject: [PATCH 013/102] Remove debug output from kdump testcase --- .../autotest/testcase/kdump/linux_diskless_kdump | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 6cb63db13..a4bb8ebdc 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -61,7 +61,8 @@ cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ne check:rc==0 check:output=~Provision node\(s\)\: $$CN -# Verify kdump related attributes showup in tftpboot file +# Verify kdump related attributes showup in tftpboot file and file was changed +cmd:ls -l /tftpboot/boot/grub2/$$CN cmd:cat /tftpboot/boot/grub2/$$CN cmd:sleep 300 @@ -92,8 +93,10 @@ cmd:xdsh $$CN df -H # Verify kdump parameters are in /proc/cmdline file cmd:xdsh $$CN cat /proc/cmdline -# Verify enablekdump postscript was executed on the compute node -cmd:xdsh $$CN cat /var/log/xcat/xcat.log | grep "kdump" +# Verify no error configuring kdump server +cmd:xdsh $$CN cat /var/log/xcat/xcat.log | grep "The kdump server is not configured" +check:output!="The kdump server is not configured" +check:rc!=0 cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" cmd:sleep 300 @@ -101,9 +104,6 @@ cmd:sleep 300 cmd:vmcorefile=`find /opt/xcat/share/xcat/tools/autotest/kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "vmcore file is not empty";else echo "vmcore file is empty"; fi check:output=~not empty -# Check for errors in messages log file -cmd:xdsh $$CN grep "kdump" /var/log/messages - cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;mv -f $exlistfile.bak $exlistfile cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile From 9c6698856dd7a55057b0ebc547677bf54fff8f55 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 18 Mar 2020 15:01:00 -0400 Subject: [PATCH 014/102] Service node doc typo --- .../hierarchy/define_service_nodes.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index 5e1d14785..259a748a0 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -3,7 +3,7 @@ Define Service Nodes This next part shows how to configure a xCAT Hierarchy and provision xCAT service nodes from an existing xCAT cluster. -*The document assumes that the compute nodes that are part of your cluster have already been defined into the xCAT database and you have successfully provisioned the compute nodes using xCAT* +.. note:: The document assumes that the compute nodes that are part of your cluster have already been defined into the xCAT database and you have successfully provisioned the compute nodes using xCAT The following table illustrates the cluster being used in this example: @@ -42,7 +42,7 @@ The following table illustrates the cluster being used in this example: chdef -t node -o r1n01,r2n01 -p groups=service -#. When ``copycds`` was run against the ISO image, several osimages are created into the ``osimage`` table. The ones named ``*-service`` are provided by easily help provision xCAT service nodes. :: +#. When ``copycds`` was run against the ISO image, several osimages were created into the ``osimage`` table. The ones named ``*-service`` are provided to easily help provision xCAT service nodes. :: # lsdef -t osimage | grep rhels7.1 rhels7.1-ppc64le-install-compute (osimage) @@ -58,14 +58,14 @@ The following table illustrates the cluster being used in this example: setupconserver=2 **Tips/Hint** - * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to 0, otherwise xCAT will not recognize the node as a service node + * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to ``0``, otherwise xCAT will not recognize the node as a service node * See the ``setup*`` attributes in the node definition man page for the list of available services: ``man node`` - * For clusters with subnetted management networks, you might want to set ``setupupforward=1`` + * For clusters with subnetted management networks, you might want to set ``setupipforward=1`` * For the ``setupconserver`` attribute, if ``conserver`` is used, set to ``1``, if ``goconserver`` is used, set to ``2`` #. Add additional postscripts for Service Nodes (optional) - By default, xCAT will execute the ``servicenode`` postscript when installed or diskless booted. This postscript will set up the necessary credentials and installs the xCAT software on the Service Nodes. If you have additional postscripts that you want to execute on the service nodes, copy to ``/install/postscripts`` and run the following: :: + By default, xCAT will execute the ``servicenode`` postscript when installed or diskless booted. This postscript will set up the necessary credentials and install the xCAT software on the Service Nodes. If you have additional postscripts that you want to execute on the service nodes, copy to ``/install/postscripts`` and run the following: :: chdef -t group -o service -p postscripts= @@ -76,21 +76,21 @@ The following table illustrates the cluster being used in this example: * ``servicenode`` - defines which Service Node the **Management Node** should send commands to (e.g ``xdsh``) and should be set to the hostname or IP address of the service node that the management node can contact it by. * ``xcatmaster`` - defines which Service Node the **Compute Node** should boot from and should be set to the hostname or IP address of the service node that the compute node can contact it by. - You must set both ``servicenode`` and ``xcatmaster`` regardless of whether or not you are using service node pools, for most scenarios, the value will be identical. :: + You must set both ``servicenode`` and ``xcatmaster`` regardless of whether or not you are using service node pools. For most scenarios, the value will be identical. :: chdef -t group -o rack1 servicenode=r1n01 xcatmaster=r1n01 chdef -t group -o rack2 servicenode=r2n01 xcatmaster=r2n01 -#. Set the conserver and monserver attributes +#. Set the ``conserver`` and ``monserver`` attributes - Set which service node should run the conserver (console) and monserver (monitoring) daemon for the nodes in the group. The most typical setup is to have the service node also ad as it's conserver and monserver. :: + Set which service node should run the conserver (console) and monserver (monitoring) daemon for the nodes in the group. The most typical setup is to have the service node also act as it's conserver and monserver. :: chdef -t group -o rack1 conserver=r1n01 monserver=r1n01 chdef -t group -o rack2 conserver=r2n01 monserver=r2n01 #. Choose location of ``/install`` and ``/tftpboot`` directories (optional). - The ``site`` table attributes ``installloc`` and ``sharedtftp`` control mounting of ``/install`` and ``/tftpboot`` directories from Management Node to Service node. + The ``site`` table attributes ``installloc`` and ``sharedtftp`` control mounting of ``/install`` and ``/tftpboot`` directories from Management Node to Service Node. To mount ``/install`` and ``/tftpboot`` directories from Management node to each Service Node: :: From 258f7cfd3c38275a7ac312e5312e3b0f9578318a Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 18 Mar 2020 16:36:02 -0400 Subject: [PATCH 015/102] add more package to diskless package list for rhels8.1 --- .../netboot/rh/compute.rhels8.ppc64le.pkglist | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index 3777e6445..ae709f861 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -1,9 +1,17 @@ @minimal-environment +bash +openssl +dhclient +openssh-server +openssh-clients chrony +vim-minimal +ntp +rpm +iputils kernel net-tools nfs-utils -openssh-server rsync tar util-linux @@ -11,4 +19,15 @@ wget python3 tar bzip2 +gzip +grub2 +grub2-tools bc +dracut +dracut-network +hostname +parted +e2fsprogs +ethtool +rsyslog +lsvpd From e7f4d72873a06cd92f600a8044485d6ceb57a456 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 19 Mar 2020 16:06:10 -0400 Subject: [PATCH 016/102] Add more package for x86_64 and service pkglist --- .../xcat/netboot/rh/compute.rhels8.x86_64.pkglist | 15 +++++++++++++++ .../netboot/rh/service.rhels8.ppc64le.pkglist | 15 +++++++++++++++ .../xcat/netboot/rh/service.rhels8.x86_64.pkglist | 15 +++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 3777e6445..cbeb2b5ab 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -12,3 +12,18 @@ python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils + diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index 4544f99e2..4bb432301 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -14,3 +14,18 @@ python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils + diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index 4544f99e2..4bb432301 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -14,3 +14,18 @@ python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils + From d1e642c54cf70ba22d346a5e3eabb455fc968922 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 20 Mar 2020 16:57:32 -0400 Subject: [PATCH 017/102] Revert "Remove perl-IO-Stty requirement from xCAT spec" --- xCAT/xCAT.spec | 4 +--- xCATsn/xCATsn.spec | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 93c0ff9cb..f52bb3a90 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -58,12 +58,10 @@ Requires: /usr/bin/ssh %if %nots390x Requires: /usr/sbin/in.tftpd Requires: xCAT-buildkit -# Stty is only needed for rcons on ppc64 nodes -%ifarch ppc64 +# Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty %endif %endif -%endif %ifos linux Requires: goconserver diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index 31775b764..6e10a4756 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -41,12 +41,10 @@ Requires: /usr/sbin/dhcpd Requires: /usr/bin/ssh %ifnarch s390x Requires: /usr/sbin/in.tftpd -# Stty is only needed for rcons on ppc64 nodes -%ifarch ppc64 +# Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty %endif %endif -%endif %ifos linux Requires: goconserver From f72b5af2ca6fe6041470d067023b7afa01982644 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 23 Mar 2020 11:02:23 -0400 Subject: [PATCH 018/102] Diskless kdump testcase debug --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index a4bb8ebdc..29095fc0f 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -16,7 +16,7 @@ cmd:makedhcp -a check:rc==0 cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi @@ -57,13 +57,14 @@ check:rc==0 cmd:lsdef -t node $$CN -i postscripts,postbootscripts cmd:lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -i crashkernelsize,dump -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -V check:rc==0 check:output=~Provision node\(s\)\: $$CN # Verify kdump related attributes showup in tftpboot file and file was changed cmd:ls -l /tftpboot/boot/grub2/$$CN cmd:cat /tftpboot/boot/grub2/$$CN +check:output=dump cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done From 66d5d6cc4c74db4792f7d9db4bc4f6f9931959e7 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 23 Mar 2020 14:58:27 -0400 Subject: [PATCH 019/102] arrange the pkglist --- .../netboot/rh/compute.rhels8.ppc64le.pkglist | 28 +++++++++---------- .../netboot/rh/service.rhels8.ppc64le.pkglist | 9 ++++-- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index ae709f861..a39a09128 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -1,17 +1,9 @@ @minimal-environment -bash -openssl -dhclient -openssh-server -openssh-clients chrony -vim-minimal -ntp -rpm -iputils kernel net-tools nfs-utils +openssh-server rsync tar util-linux @@ -19,15 +11,23 @@ wget python3 tar bzip2 -gzip -grub2 -grub2-tools bc dracut dracut-network +rsyslog hostname -parted e2fsprogs ethtool -rsyslog +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils +gzip +grub2 +grub2-tools +ntp lsvpd diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index 4bb432301..1fea86a57 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -8,8 +8,6 @@ rsync tar util-linux wget -perl-DBD-MySQL -perl-DBD-Pg python3 tar bzip2 @@ -28,4 +26,11 @@ bash vim-minimal rpm iputils +gzip +grub2 +grub2-tools +ntp +lsvpd +perl-DBD-MySQL +perl-DBD-Pg From a1ad50c94b2d87614405cd9e268e0d46f33174ca Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 24 Mar 2020 10:27:41 -0400 Subject: [PATCH 020/102] Do not hide output of apt-key add --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 948f0863a..71b947961 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1355,7 +1355,7 @@ function add_xcat_core_repo_apt() local tmp="${TMP_DIR}/tmp_xcat.key" download_file "${url}" "${tmp}" warn_if_bad "$?" "download xcat apt key failed" || return 1 - apt-key add "${tmp}" >/dev/null 2>&1 + apt-key add "${tmp}" warn_if_bad "$?" "import xcat apt key failed" || return 1 case "${ver}" in "devel") From 87adeb608c687b171ea144ca2aac5ec92c2eec1d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 25 Mar 2020 08:49:06 -0400 Subject: [PATCH 021/102] Additional packages for Ubuntu go-xcat testcases --- xCAT-test/autotest/testcase/go_xcat/case3 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index a50aa9f8a..7b6afd7bd 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -22,6 +22,9 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" check:rc==0 @@ -58,6 +61,9 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -94,6 +100,9 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -140,6 +149,9 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 From 9381e8a2dcc30830416698ae73e58aad582ba813 Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 25 Mar 2020 12:08:50 -0400 Subject: [PATCH 022/102] remove ntp from rhel8 pkglist --- xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist | 1 - xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist | 1 - 2 files changed, 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index a39a09128..a3ac65d01 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -29,5 +29,4 @@ iputils gzip grub2 grub2-tools -ntp lsvpd diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index 1fea86a57..cf9df1421 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -29,7 +29,6 @@ iputils gzip grub2 grub2-tools -ntp lsvpd perl-DBD-MySQL perl-DBD-Pg From 7a3fb4ffa7738ae6a7109919cb4b6ea8d0a0d952 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 26 Mar 2020 11:10:35 -0400 Subject: [PATCH 023/102] Replace sources.list file for go-xcat testcase on Ubuntu --- xCAT-test/autotest/testcase/go_xcat/case3 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 7b6afd7bd..850c1bd3b 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -25,6 +25,9 @@ cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yu #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" check:rc==0 @@ -64,6 +67,9 @@ cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yu #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -103,6 +109,9 @@ cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yu #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -152,6 +161,9 @@ cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yu #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 From 8bf192e30b15a91eed2210888af3d9f2b0148a26 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 30 Mar 2020 11:33:44 -0400 Subject: [PATCH 024/102] More disk space needed for regression VMs --- xCAT-test/autotest/testcase/installation/setup_vm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index 0747600d0..312e12854 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -1,7 +1,7 @@ start:setup_vm description:reset up vm environment if need label:others -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ];then echo "CN node $$CN is a VM, mgt is __GETNODEATTR($$CN,mgt)__, starting to recreate the vm"; echo "rpower $$CN off"; rpower $$CN off; sleep 3; echo "rpower $$CN stat"; rpower $$CN stat; var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`; echo "The disk type of $$CN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$CN"; mkvm $$CN; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN"; mkvm $$CN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$CN -s 25G -f"; mkvm $$CN -s 25G -f; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN -s 25G -f"; mkvm $$CN -s 25G -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 "CN node $$CN is not a VM; do not need to recreate it";fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ];then echo "CN node $$CN is a VM, mgt is __GETNODEATTR($$CN,mgt)__, starting to recreate the vm"; echo "rpower $$CN off"; rpower $$CN off; sleep 3; echo "rpower $$CN stat"; rpower $$CN stat; var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`; echo "The disk type of $$CN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$CN"; mkvm $$CN; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN"; mkvm $$CN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$CN -s 30G -f"; mkvm $$CN -s 30G -f; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN -s 30G -f"; mkvm $$CN -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 "CN node $$CN is not a VM; do not need to recreate it";fi check:rc==0 cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then echo "CN node is a vm, need to repower it on"; echo "rpower $$CN on"; rpower $$CN on; else echo "CN node $$CN is a non-VM; do not need to repower on it"; fi @@ -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 25G -f"; mkvm $$SN -s 25G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 25G -f"; mkvm $$SN -s 25G -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 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 check:rc==0 From 7724225681c5148c57c051b58b3b63e2916d5483 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 31 Mar 2020 10:03:40 -0400 Subject: [PATCH 025/102] Power off compute node before rinstall in kdump testcase --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 29095fc0f..53a7a2cdf 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -57,6 +57,7 @@ check:rc==0 cmd:lsdef -t node $$CN -i postscripts,postbootscripts cmd:lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -i crashkernelsize,dump +cmd rpower $$CN off cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -V check:rc==0 check:output=~Provision node\(s\)\: $$CN From 4ce180fcb5b7d89dbb42fa762361c232db3c85dd Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 31 Mar 2020 14:25:31 -0400 Subject: [PATCH 026/102] Throw away confusing zypper message --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 71b947961..b088c7104 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1285,7 +1285,7 @@ function remove_repo_zypper() { type zypper >/dev/null 2>&1 || return 255 local repo_id="$1" - zypper removerepo "${repo_id}" + zypper removerepo "${repo_id}" > /dev/null case "${repo_id}" in "xcat-core") mv /etc/zypp/repos.d/xCAT-core.repo{,.nouse} 2>/dev/null From d459ba0e69f960caeb3377aedbe4fe60066a2dbe Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 31 Mar 2020 15:08:34 -0400 Subject: [PATCH 027/102] Add go-xcat testcases to Ubuntu daily bundles --- xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle | 2 ++ xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 5da3ac5fe..a3e1facaf 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -228,3 +228,5 @@ xdsh_permission_denied xdsh_q xdsh_regular_command xdsh_t +go_xcat_devel_from_repo +go_xcat_stable_from_repo diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 46ff09f19..e61c5e1ef 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -228,3 +228,5 @@ xdsh_permission_denied xdsh_q xdsh_regular_command xdsh_t +go_xcat_devel_from_repo +go_xcat_stable_from_repo From 774ce0a1945a382c8528df02dea34fd780e9b1eb Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 1 Apr 2020 12:29:11 -0400 Subject: [PATCH 028/102] stderr messages to discard --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index b088c7104..2b3750d66 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1285,7 +1285,7 @@ function remove_repo_zypper() { type zypper >/dev/null 2>&1 || return 255 local repo_id="$1" - zypper removerepo "${repo_id}" > /dev/null + zypper removerepo "${repo_id}" 2> /dev/null case "${repo_id}" in "xcat-core") mv /etc/zypp/repos.d/xCAT-core.repo{,.nouse} 2>/dev/null From 9964c1e0a01bbd9f3841531a0c11f35acdaab661 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 2 Apr 2020 12:29:25 -0400 Subject: [PATCH 029/102] Fewer install retries for go-xcat testcases on Ubuntu --- xCAT-test/autotest/testcase/go_xcat/case3 | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 850c1bd3b..65fe94760 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -3,13 +3,13 @@ description:test go-xcat devel on a newly provisioned node label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi +cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi #Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -45,13 +45,13 @@ description:test go-xcat GA on a newly provisioned node label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi +cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi #Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -87,13 +87,13 @@ description:test go-xcat GA on a newly provisioned node upgrade to devel label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi +cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi #Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -139,13 +139,13 @@ description:test go-xcat GA on a newly provisioned node, remove, install devel label:go_xcat os:Linux #Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi +cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi #Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service; fi +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status From 533e4b3b5da6de71758327a6560fbd4646475e94 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 3 Apr 2020 13:24:49 -0400 Subject: [PATCH 030/102] Retry rpower command in testcases --- xCAT-test/autotest/testcase/rpower/cases0 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 52e86422f..37837a98e 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -16,7 +16,10 @@ start:rpower_stat description:This case is to test stat option could show the power status of nodes Attribute: $$CN-The operation object of rpower command label:cn_bmc_ready,hctrl_general -cmd:rpower $$CN on + +#If rpower fails on the first try, try again with smaller memory +cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi + cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 5 ];then break;fi done cmd:rpower $$CN stat check:rc==0 @@ -89,8 +92,11 @@ cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat check:output=~Not Activated|off -cmd:rpower $$CN on + +#If rpower fails on the first try, try again with smaller memory +cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi check:rc==0 + cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat check:output=~Running|on From 2ba46a0e912c1a71263d36a3276c19d378ab159f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 6 Apr 2020 17:08:50 -0400 Subject: [PATCH 031/102] Do not reprovision SN for go-xcat testcases on Ubuntu --- xCAT-test/autotest/testcase/go_xcat/case3 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 65fe94760..c2d9cb2ef 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -5,8 +5,8 @@ os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi +#Service not did not boot after 5 min, reprovision it if not on Ubuntu +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 @@ -47,8 +47,8 @@ os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi +#Service not did not boot after 5 min, reprovision it if not on Ubuntu +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 @@ -89,8 +89,8 @@ os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi +#Service not did not boot after 5 min, reprovision it if not on Ubuntu +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 @@ -141,8 +141,8 @@ os:Linux #Make sure service node is not off, if it is, power it on cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi +#Service not did not boot after 5 min, reprovision it if not on Ubuntu +cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 From e3ca710b8330fca6840cb066ed2fa5cc7d49ab64 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 6 Apr 2020 13:25:56 -0400 Subject: [PATCH 032/102] linux_diskless_kdump testcase typo --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 53a7a2cdf..6491014eb 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -57,7 +57,7 @@ check:rc==0 cmd:lsdef -t node $$CN -i postscripts,postbootscripts cmd:lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -i crashkernelsize,dump -cmd rpower $$CN off +cmd:rpower $$CN off cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -V check:rc==0 check:output=~Provision node\(s\)\: $$CN From e5c6039855972a259a0acc8a34ef2771c25bdafa Mon Sep 17 00:00:00 2001 From: adorsey-NOAA Date: Tue, 7 Apr 2020 12:45:51 -0400 Subject: [PATCH 033/102] Update bmcsetup --- xCAT-genesis-scripts/usr/bin/bmcsetup | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index 6883855cf..218ac2704 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -433,15 +433,16 @@ for user in $BMCUS; do if [ -z "$USERSLOT" ]; then USERSLOT=$((`ipmitool raw 6 0x44 1 1|awk '{print $3}'` + 1)) fi - if [ "$USERSLOT" == 0 -o -z "$LOCKEDUSERS" ]; then USERSLOT=2; fi - # automatically find first unlocked user slot - for slot in {1..16}; do - USERLOCKED=`ipmitool channel getaccess $LANCHAN $slot | grep Fixed | awk '{print $4}'` - if [ "$USERLOCKED" == "No" ]; then - USERSLOT=$slot - break - fi - done + if [ "$USERSLOT" == 0 -o -z "$LOCKEDUSERS" ]; then + # automatically find first unlocked user slot + for slot in {1..16}; do + USERLOCKED=`ipmitool channel getaccess $LANCHAN $slot | grep Fixed | awk '{print $4}'` + if [ "$USERLOCKED" == "No" ]; then + USERSLOT=$slot + break + fi + done + fi if [ "$ISITE" = 1 ]; then allowcred.awk & CREDPID=$! From 76ef2ba9477f0b325a37ee6f97c8633d35a13da0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 7 Apr 2020 17:02:07 -0400 Subject: [PATCH 034/102] go-xcat testcase on Ubuntu to accept default package installation --- xCAT-test/autotest/testcase/go_xcat/case3 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index c2d9cb2ef..7a080c28c 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -28,6 +28,9 @@ cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEB #Replace sources.list file on Ubuntu cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" check:rc==0 @@ -70,6 +73,9 @@ cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEB #Replace sources.list file on Ubuntu cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -112,6 +118,9 @@ cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEB #Replace sources.list file on Ubuntu cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -164,6 +173,9 @@ cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEB #Replace sources.list file on Ubuntu cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 From 996b05ce6afded7f284341817239d297cc6cc98b Mon Sep 17 00:00:00 2001 From: adorsey-NOAA Date: Wed, 8 Apr 2020 11:07:25 -0400 Subject: [PATCH 035/102] Update bmcsetup Don't check $LOCKEDUSERS at all, instead fall back to userslot 2 as a last resort if the user doesn't already exist, and the automatic slot detection doesn't find an unlocked slot. This is essentially what was happening in the older version of the script before #6380 as $LOCKEDUSERS was only ever referenced here. Also move setting the username before setting privileges and access levels, as those steps fail if done before username is set for the slot. --- xCAT-genesis-scripts/usr/bin/bmcsetup | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index 218ac2704..b93a7663c 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -433,7 +433,7 @@ for user in $BMCUS; do if [ -z "$USERSLOT" ]; then USERSLOT=$((`ipmitool raw 6 0x44 1 1|awk '{print $3}'` + 1)) fi - if [ "$USERSLOT" == 0 -o -z "$LOCKEDUSERS" ]; then + if [ "$USERSLOT" == 0 ]; then # automatically find first unlocked user slot for slot in {1..16}; do USERLOCKED=`ipmitool channel getaccess $LANCHAN $slot | grep Fixed | awk '{print $4}'` @@ -443,6 +443,8 @@ for user in $BMCUS; do fi done fi + # fall back to userslot 2 as a last resort + if [ "$USERSLOT" == 0 ]; then $USERSLOT = 2; fi if [ "$ISITE" = 1 ]; then allowcred.awk & CREDPID=$! @@ -476,6 +478,15 @@ for user in $BMCUS; do done ipmitool raw 6 0x43 $(($LANCHAN|176)) $USERSLOT 4 + TRIES=0 + if [ "$CURRENTUSER" != "$user" ]; then + # Change the user name, if necessary + while ! ipmitool -d $idev user set name $USERSLOT "$user"; do + sleep 1 + let TRIES=TRIES+1 + if [ $TRIES -gt $TIMEOUT ]; then break; fi + done + fi TRIES=0 # Last param in ipmitool user priv is the channel to set it on. @@ -507,15 +518,6 @@ for user in $BMCUS; do if [ $TRIES -gt $TIMEOUT ]; then break; fi done - TRIES=0 - if [ "$CURRENTUSER" != "$user" ]; then - # Change the user name, if necessary - while ! ipmitool -d $idev user set name $USERSLOT "$user"; do - sleep 1 - let TRIES=TRIES+1 - if [ $TRIES -gt $TIMEOUT ]; then break; fi - done - fi let idev=idev-1 done From 10fe1b81f621605d8a9b0fee847e7f717d92cecc Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 9 Apr 2020 17:09:12 -0400 Subject: [PATCH 036/102] Add execute permision to all files recursively under /xcatpost on the Compute Node. --- xCAT-server/share/xcat/install/scripts/post.xcat.ng | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat.ng b/xCAT-server/share/xcat/install/scripts/post.xcat.ng index 53a2fe878..255298db8 100644 --- a/xCAT-server/share/xcat/install/scripts/post.xcat.ng +++ b/xCAT-server/share/xcat/install/scripts/post.xcat.ng @@ -145,7 +145,10 @@ then /tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed" sleep infinity fi -find /xcatpost -type f -maxdepth 1 -exec chmod 0755 {} + + +# Add execute permision to all files recursively under /xcatpost. +chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` + msgutil_r "$MASTER_IP" "info" "postscripts downloaded successfully" "/var/log/xcat/xcat.log" "$log_label" # Get the precreated mypostscript file From ddf982f2d8ebb5d401f5a19cd7a4c264ea6d4340 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 15 Apr 2020 16:28:31 -0400 Subject: [PATCH 037/102] Add dir1/dir2/dir3/foo.bar (permision 755) to /install/postscripts on the management node before diskless and diskfull OS provisioning to a compute node to verify that the execute permission of foo.bar is preserved after provisioning. Failure of doing so will prevent some postscripts under multiple levels of sub-directories from running during the postscript phase. --- .../reg_linux_diskfull_installation_hierarchy | 28 +++++++++++++++++++ .../reg_linux_diskless_installation_hierarchy | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index f78bf840a..9e02f0119 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -18,6 +18,15 @@ check:rc==0 cmd:chtab key=nameservers site.value="" check:rc==0 +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 +check:rc==0 +cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0" +check:rc==0 + cmd:makedns -n check:rc==0 cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN;fi @@ -75,4 +84,23 @@ check:rc==0 cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi 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)__-install-compute synclists= + +cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" +check:rc==0 +cmd:xdsh $$CN "grep \"The number is ONE\" /var/log/xcat/xcat.log" +check:rc==0 +check:output=~ The number is ONE +cmd:xdsh $$CN "grep \"The number is NOT 1\" /var/log/xcat/xcat.log" +check:rc==0 +check:output=~ The number is NOT 1 +cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" +check:rc==0 +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 1,dir1/dir2/dir3/foo.bar 0" +check:rc==0 end 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 bd8fe4876..4906881ab 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -14,6 +14,15 @@ cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpser cmd:chdef -t node $$SN groups=service,all check:rc==0 +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 +check:rc==0 +cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0" +check:rc==0 + cmd:makedns -n check:rc==0 cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi @@ -82,4 +91,23 @@ 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 + +cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" +check:rc==0 +cmd:xdsh $$CN "grep \"The number is ONE\" /var/log/xcat/xcat.log" +check:rc==0 +check:output=~ The number is ONE +cmd:xdsh $$CN "grep \"The number is NOT 1\" /var/log/xcat/xcat.log" +check:rc==0 +check:output=~ The number is NOT 1 +cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" +check:rc==0 +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 1,dir1/dir2/dir3/foo.bar 0" +check:rc==0 end From 9920a4c7d91041e293eb6ace74f518df14eeb87f Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 16 Apr 2020 11:53:19 -0400 Subject: [PATCH 038/102] updatenode_postscripts_permission is used to test that postscripts in nested sub-directories can execute on CN by running "updatenode -P" on MN (xcat-core issue #6579). A diskless or a diskfull image has been installed on CN at the point of testing. --- xCAT-test/autotest/testcase/updatenode/cases0 | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 59281087e..28b9db19c 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -665,7 +665,33 @@ cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstd check:rc==0 end - - - - +start:updatenode_postscripts_permission +label:others,updatenode +description:This is to test that postscripts in nested sub-directories can execute on CN by running "updatenode -P" on MN (xcat-core issue #6579). +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 +check:rc==0 +cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0" +check:rc==0 +cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar 1" +check:rc==0 +check:output=~ The number is ONE +cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar 0" +check:rc==0 +check:output=~ The number is NOT 1 +cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" +check:rc==0 +cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" +check:rc==0 +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 1,dir1/dir2/dir3/foo.bar 0" +check:rc==0 +end From e864af7855c347480193680879a0e44966d296db Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 16 Apr 2020 17:55:17 -0400 Subject: [PATCH 039/102] Simplify foo.bar and invoke and test it one time without input value. --- xCAT-test/autotest/testcase/updatenode/cases0 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 28b9db19c..ae24382a2 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -670,18 +670,14 @@ label:others,updatenode description:This is to test that postscripts in nested sub-directories can execute on CN by running "updatenode -P" on MN (xcat-core issue #6579). cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 check:rc==0 -cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar +cmd:echo -e '#!/bin/bash\n\necho \"Execute permission is set.\"\nexit 0'> /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 -cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0" +cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar" check:rc==0 -cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar 1" +check:output=~ Execute permission is set check:rc==0 -check:output=~ The number is ONE -cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar 0" -check:rc==0 -check:output=~ The number is NOT 1 cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" check:rc==0 cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar @@ -692,6 +688,4 @@ cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" check:rc==0 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 1,dir1/dir2/dir3/foo.bar 0" -check:rc==0 end From 2679f5354872cbb8a70e86b5b233a2e9bbb62976 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 16 Apr 2020 18:00:47 -0400 Subject: [PATCH 040/102] Simplify foo.bar and invoke it and test it only one time for each test case without an input value. --- .../reg_linux_diskfull_installation_hierarchy | 13 +++++-------- .../reg_linux_diskless_installation_hierarchy | 13 +++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index 9e02f0119..cfcd0832a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -20,11 +20,11 @@ check:rc==0 cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 check:rc==0 -cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar +cmd:echo -e '#!/bin/bash\n\necho \"Execute permission is set.\"\nexit 0'> /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 -cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0" +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 cmd:makedns -n @@ -87,12 +87,9 @@ cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-inst cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" check:rc==0 -cmd:xdsh $$CN "grep \"The number is ONE\" /var/log/xcat/xcat.log" +cmd:xdsh $$CN "grep \"Execute permission is set\" /var/log/xcat/xcat.log" check:rc==0 -check:output=~ The number is ONE -cmd:xdsh $$CN "grep \"The number is NOT 1\" /var/log/xcat/xcat.log" -check:rc==0 -check:output=~ The number is NOT 1 +check:output=~ Execute permission is set cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 @@ -101,6 +98,6 @@ cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" check:rc==0 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 1,dir1/dir2/dir3/foo.bar 0" +cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 end 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 4906881ab..6dd07c8a8 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -16,11 +16,11 @@ check:rc==0 cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 check:rc==0 -cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar +cmd:echo -e '#!/bin/bash\n\necho \"Execute permission is set.\"\nexit 0'> /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 -cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0" +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 cmd:makedns -n @@ -94,12 +94,9 @@ check:rc==0 cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" check:rc==0 -cmd:xdsh $$CN "grep \"The number is ONE\" /var/log/xcat/xcat.log" +cmd:xdsh $$CN "grep \"Execute permission is set\" /var/log/xcat/xcat.log" check:rc==0 -check:output=~ The number is ONE -cmd:xdsh $$CN "grep \"The number is NOT 1\" /var/log/xcat/xcat.log" -check:rc==0 -check:output=~ The number is NOT 1 +check:output=~ Execute permission is set cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar check:rc==0 cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 @@ -108,6 +105,6 @@ cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" check:rc==0 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 1,dir1/dir2/dir3/foo.bar 0" +cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 end From 371a15686b75533da6ae8c0c3103202cee7f118b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 17 Apr 2020 11:37:43 -0400 Subject: [PATCH 041/102] Verify second parameter to rcons is a host --- xCAT-client/bin/rcons | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 610b20101..1fc8418b5 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -36,11 +36,17 @@ for parameter in $@; do if [ $param_n -eq 2 ]; then if [ "$parameter" != "-f" ] && [ "$parameter" != "-s" ]; then CONSERVER=$parameter + # verify the specified CONSERVER can be resolved + host $CONSERVER > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Error: cannot recognize parameter or conserver host \"$parameter\". Run \"rcons -h\" for usage." + exit 1 + fi fi fi if [ $param_n -ge 2 ]; then - if [ "$parameter" = "-f" ] || [ "$parameter" = "-s" ]; then + if [ "$parameter" == "-f" ] || [ "$parameter" == "-s" ]; then if [ -z "$FORCE" ]; then FORCE=$parameter elif [ "$FORCE" != "$parameter" ]; then @@ -52,7 +58,7 @@ for parameter in $@; do if [ $param_n -ge 3 ]; then if [ "$parameter" != "-f" ] && [ "$parameter" != "-s" ]; then - echo "Error: cannot recognize parameter \"$parameter\"." + echo "Error: cannot recognize parameter \"$parameter\". Run \"rcons -h\" for usage." exit 1 fi fi From f0b5b63660ff4a64e6061b1f6754a3962b10ad76 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 17 Apr 2020 16:19:33 -0400 Subject: [PATCH 042/102] Modify updatenode_P_script1 to test execute permission of postscripts under multiple levels of sub-directories under /xcatpost on CN. --- xCAT-test/autotest/testcase/updatenode/cases0 | 45 ++++++------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index ae24382a2..fbce9a6cc 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -303,15 +303,15 @@ end start:updatenode_P_script1 label:others,updatenode -cmd:echo "echo hello > /tmp/updatenode_P_script" > /tmp/script1 +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 check:rc==0 -cmd:chmod a+x /tmp/script1 +cmd:echo "echo hello > /tmp/updatenode_P_script" > /install/postscripts/dir1/dir2/dir3/script1 check:rc==0 -cmd:cp /tmp/script1 /install/postscripts +cmd:chmod a+x /install/postscripts/dir1/dir2/dir3/script1 check:rc==0 -cmd:chdef $$CN postscripts=script1 +cmd:chdef $$CN postscripts=dir1/dir2/dir3/script1 check:rc==0 -cmd:updatenode $$CN -P script1 +cmd:updatenode $$CN -P dir1/dir2/dir3/script1 check:rc==0 check:output=~script1 cmd:xdsh $$CN "ls -l /tmp/updatenode_P_script" @@ -321,7 +321,15 @@ check:rc==0 check:output=~hello cmd:chdef $$CN postscripts= check:rc==0 -cmd:rm -f /install/script1 +cmd:rm -f /install/postscripts/dir1/dir2/dir3/script1 +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm /tmp/updatenode_P_script" +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/script1" +check:rc==0 +cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 end @@ -664,28 +672,3 @@ check:rc==0 cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist check:rc==0 end - -start:updatenode_postscripts_permission -label:others,updatenode -description:This is to test that postscripts in nested sub-directories can execute on CN by running "updatenode -P" on MN (xcat-core issue #6579). -cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 -check:rc==0 -cmd:echo -e '#!/bin/bash\n\necho \"Execute permission is set.\"\nexit 0'> /install/postscripts/dir1/dir2/dir3/foo.bar -check:rc==0 -cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar -check:rc==0 -cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar" -check:rc==0 -check:output=~ Execute permission is set -check:rc==0 -cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" -check:rc==0 -cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar -check:rc==0 -cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 -check:rc==0 -cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" -check:rc==0 -cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" -check:rc==0 -end From 86638eaef7747f3228d4deeb442092379d32c76b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 20 Apr 2020 10:13:33 -0400 Subject: [PATCH 043/102] Better diagnostic message from nodeset_runimg testcase --- xCAT-test/autotest/testcase/genesis/genesistest.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 3efbdc71a..44ab44580 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -261,13 +261,15 @@ sub testxdsh { $checkstring = "destiny=shell"; $checkfile = "/proc/cmdline"; } + my $xdsh_command="xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring"; if (($value == 1) || ($value == 2) || ($value == 3)) { - `xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring `; + `$xdsh_command`; if ($?) { - foreach (1 .. 10) { + my @i = (1..10); + for (@i) { sleep 300; - send_msg(1,"try to run xdsh $noderange to check the results again"); - `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; + send_msg(1,"[$_] Running \"$xdsh_command\" to check the results again"); + `$xdsh_command`; last if ($? == 0); } } From 8edd2f2886c1b58a13daed92b8b8c09732ac2df4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 20 Apr 2020 10:31:11 -0400 Subject: [PATCH 044/102] Only retry 3 times to provision --- xCAT-test/autotest/testcase/packimg/cases0 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index d04d92940..72d7f8d99 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -76,7 +76,7 @@ check:output=~archive method:cpio check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -125,7 +125,7 @@ check:output=~archive method:cpio check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -170,7 +170,7 @@ check:output=~archive method:cpio check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -219,7 +219,7 @@ check:output=~archive method:tar check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -275,7 +275,7 @@ check:output=~archive method:tar check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -331,7 +331,7 @@ check:output=~archive method:tar check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done From 7b2ae3ecd7b0595939be4732d3daf69e53aaf467 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 20 Apr 2020 12:47:50 -0400 Subject: [PATCH 045/102] Support hostname from nicalias regular expression --- xCAT-server/lib/xcat/plugins/hosts.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 1eb234ab6..d84b5d155 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -790,6 +790,11 @@ sub donics next; } + # for example: nicaliases.ib0=|maestro-(\d+)$|m($1)-ib0| + if ($aliases =~ /^\|\S*\|$/) { + $aliases = xCAT::Table::transRegexAttrs($node, $aliases); + } + if ($aliases =~ /\|/) { my @names = split(/\|/, $aliases); my $index = 0; From a5e02ed06f6b966abe999ed06f6aa2b50b31e680 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 20 Apr 2020 16:04:31 -0400 Subject: [PATCH 046/102] Change retry_install default for number of attempts --- .../autotest/testcase/commoncmd/retry_install.sh | 2 +- xCAT-test/autotest/testcase/packimg/cases0 | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index 540ff7c6a..fe3cb44c9 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -12,7 +12,7 @@ then times=$3+1 echo "Try to rinstall for $3 times ......" else - times=6 + times=4 echo "Try to rinstall for 5 times ......" fi diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index 72d7f8d99..d04d92940 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -76,7 +76,7 @@ check:output=~archive method:cpio check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -125,7 +125,7 @@ check:output=~archive method:cpio check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -170,7 +170,7 @@ check:output=~archive method:cpio check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -219,7 +219,7 @@ check:output=~archive method:tar check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -275,7 +275,7 @@ check:output=~archive method:tar check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -331,7 +331,7 @@ check:output=~archive method:tar check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute 3 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done From 1fdbbe65eb932d93a68625a4c24e57b7a2497eba Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 20 Apr 2020 18:15:42 -0400 Subject: [PATCH 047/102] More clear default --- xCAT-test/autotest/testcase/commoncmd/retry_install.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index fe3cb44c9..f49f69f92 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -6,18 +6,16 @@ declare -i tryreinstall=1 node=$1 osimage=$2 vmhost=`lsdef $node -i vmhost -c | cut -d '=' -f 2` +times=3 if [ $# -eq 3 ]; then - times=$3+1 - echo "Try to rinstall for $3 times ......" -else - times=4 - echo "Try to rinstall for 5 times ......" + times=$3 fi +echo "Try to rinstall for $times times ......" -for (( tryreinstall = 1 ; tryreinstall < $times ; ++tryreinstall )) +for (( tryreinstall = 1 ; tryreinstall <= $times ; ++tryreinstall )) do echo "[$tryreinstall] Trying to install $node with $osimage ..." From 72cf0e15d3cf9390677fe083ccf91bafa6d13604 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 21 Apr 2020 09:37:23 -0400 Subject: [PATCH 048/102] Fix flags for squashfs for centos --- xCAT-server/lib/xcat/plugins/packimage.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index c37c48bf7..2cf3f9e1f 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -580,7 +580,7 @@ sub process_request { $flags = "-be"; } - if ($osver =~ /rhels/ && $osver !~ /rhels5/) { + if (($osver =~ /rhels/ && $osver !~ /rhels5/) || ($osver =~ /centos/)) { $flags = ""; } @@ -588,9 +588,10 @@ sub process_request { $callback->({ error => ["mksquashfs not found, squashfs-tools rpm should be installed on the management node"], errorcode => [1] }); return 1; } - my $rc = system("mksquashfs $temppath ../rootimg.sfs $flags"); + my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; + my $rc = system("$mksquashfs_command"); if ($rc) { - $callback->({ error => ["mksquashfs could not be run successfully"], errorcode => [1] }); + $callback->({ error => ["Command \"$mksquashfs_command\" failed"], errorcode => [1] }); return 1; } $rc = system("rm -rf $temppath"); From 424dcfcbf0122923467bc0c55c4a84cb553cf213 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 21 Apr 2020 09:56:46 -0400 Subject: [PATCH 049/102] Update packimage documentations --- .../references/man1/packimage.1.rst | 35 +++++++++++++++---- xCAT-client/pods/man1/packimage.1.pod | 26 ++++++++++---- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/packimage.1.rst b/docs/source/guides/admin-guides/references/man1/packimage.1.rst index 6af0c9223..4c8568b15 100644 --- a/docs/source/guides/admin-guides/references/man1/packimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/packimage.1.rst @@ -23,7 +23,7 @@ SYNOPSIS \ **packimage [-v| -**\ **-version]**\ -\ **packimage**\ [\ **-m | -**\ **-method**\ \ *cpio|tar*\ ] [\ **-c | -**\ **-compress**\ \ *gzip|pigz|xz*\ ] [\ **-**\ **-nosyncfiles**\ ] \ *imagename*\ +\ **packimage**\ [\ **-m | -**\ **-method**\ \ **cpio|tar|squashfs**\ ] [\ **-c | -**\ **-compress**\ \ **gzip|pigz|xz**\ ] [\ **-**\ **-nosyncfiles**\ ] \ *imagename*\ *********** @@ -33,7 +33,7 @@ DESCRIPTION Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot. -Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running. +Note: For an osimage that is deployed on a cluster, running \ **packimage**\ will overwrite the existing rootimage file and be unavailable to the compute nodes while \ **packimage**\ is running. ********** @@ -49,15 +49,36 @@ OPTIONS ******* -\ **-h**\ Display usage message. -\ **-v**\ Command Version. +\ **-h**\ + + Display usage message. + -\ **-m| -**\ **-method**\ Archive Method (cpio,tar,squashfs, default is cpio) -\ **-c| -**\ **-compress**\ Compress Method (pigz,gzip,xz, default is pigz/gzip) +\ **-v**\ + + Command Version. + + + +\ **-m| -**\ **-method**\ + + Archive Method (cpio, tar, squashfs (requires overlayFS or aufs modules during provisioning), default is cpio) + + + +\ **-c| -**\ **-compress**\ + + Compress Method (pigz, gzip, xz, default is pigz/gzip) + + + +\ **-**\ **-nosyncfiles**\ + + Bypass of syncfiles requested, will not sync files to root image directory + -\ **-**\ **-nosyncfiles**\ Bypass of syncfiles requested, will not sync files to root image directory ************ diff --git a/xCAT-client/pods/man1/packimage.1.pod b/xCAT-client/pods/man1/packimage.1.pod index dbca7c266..32e91d9f7 100644 --- a/xCAT-client/pods/man1/packimage.1.pod +++ b/xCAT-client/pods/man1/packimage.1.pod @@ -8,13 +8,13 @@ B B -B [B<-m>|B<--method> I] [B<-c>|B<--compress> I] [B<--nosyncfiles>] I +B [B<-m>|B<--method> B] [B<-c>|B<--compress> B] [B<--nosyncfiles>] I =head1 DESCRIPTION Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot. -Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running. +Note: For an osimage that is deployed on a cluster, running B will overwrite the existing rootimage file and be unavailable to the compute nodes while B is running. =head1 PARAMETERS @@ -22,17 +22,29 @@ I specifies the name of a OS image definition to be used. The specifi =head1 OPTIONS +=over 10 -B<-h> Display usage message. +=item B<-h> -B<-v> Command Version. +Display usage message. -B<-m| --method> Archive Method (cpio,tar,squashfs, default is cpio) +=item B<-v> -B<-c| --compress> Compress Method (pigz,gzip,xz, default is pigz/gzip) +Command Version. -B<--nosyncfiles> Bypass of syncfiles requested, will not sync files to root image directory +=item B<-m| --method> +Archive Method (cpio, tar, squashfs (requires overlayFS or aufs modules during provisioning), default is cpio) + +=item B<-c| --compress> + +Compress Method (pigz, gzip, xz, default is pigz/gzip) + +=item B<--nosyncfiles> + +Bypass of syncfiles requested, will not sync files to root image directory + +=back =head1 RETURN VALUE From 770be38f0cd1e50b049498b76f543ab7a9b9a900 Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 22 Apr 2020 15:44:35 -0400 Subject: [PATCH 050/102] Support xfs filesystem for statelite images --- .../share/xcat/netboot/add-on/statelite/rc.localdisk | 8 ++++---- .../share/xcat/netboot/rh/dracut_047/install.netboot | 2 +- .../share/xcat/netboot/rh/dracut_047/install.statelite | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk index 7676e73ce..7d78fc847 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk @@ -212,18 +212,18 @@ doconfigure () { # create the filesystem if [ x$fstype = x ]; then - fstype=ext3 + fstype=ext4 fi partnum=`expr $partnum + 1` partdev=$dev$partnum echo "Create filesystem $fstype on $partdev" >>$LOG - echo "mke2fs -q $partdev -t $fstype" >>$LOG - `mke2fs -q $partdev -t $fstype > /dev/null` + echo "mkfs.$fstype -q $partdev" >>$LOG + `mkfs.$fstype -q $partdev > /dev/null` sleep 1 done elif [ $localspace -eq 1 ]; then if [ x$fstype = x ]; then - fstype=ext3 + fstype=ext4 fi echo "Mount $dev to $LOCAL with $fstype" >>$LOG echo "mount -t $fstype $dev $MNTDIR$LOCAL" >>$LOG diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot index 5ac651c5f..422138e65 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot @@ -3,7 +3,7 @@ echo $drivers dracut_install curl tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite index 36929bf89..8d7413778 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite @@ -2,7 +2,7 @@ echo $drivers dracut_install curl cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig hostname awk egrep grep dirname expr -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" From a002157251d7c2291a078b451840ea20a111ec9c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 22 Apr 2020 16:03:29 -0400 Subject: [PATCH 051/102] Use overlay mount type for squashfs diskless images --- .../xcat/netboot/fedora/dracut_009/xcatroot | 20 ++++++++++++++----- .../share/xcat/netboot/rh/dracut/xcatroot | 20 ++++++++++++++----- .../share/xcat/netboot/rh/dracut_033/xcatroot | 20 ++++++++++++++----- .../share/xcat/netboot/rh/dracut_047/xcatroot | 20 ++++++++++++++----- .../xcat/netboot/sles/dracut_033/xcatroot | 18 +++++++++++++---- .../share/xcat/netboot/ubuntu/dracut/xcatroot | 20 ++++++++++++++----- 6 files changed, 89 insertions(+), 29 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot index 470d27ab7..5bed21474 100755 --- a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot @@ -52,11 +52,21 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modinfo overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + modprobe overlay + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.gz ]; then echo Setting up RAM-root tmpfs. if [ -z $rootlimit ];then diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index d70a64323..c3c469902 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -62,11 +62,21 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modinfo overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + modprobe overlay + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg downloaded,setting up RAM-root tmpfs...." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index 1531756fd..dc8910aa0 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -69,11 +69,21 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modinfo overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + modprobe overlay + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot index 9f2b4182b..0aeaa51d4 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot @@ -69,11 +69,21 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modinfo overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + modprobe overlay + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index 4b6c9aeaf..a3f6c373a 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -66,10 +66,20 @@ if [ -r /rootimg.sfs ]; then mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modinfo overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + modprobe overlay + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot index 0dec68081..4a3f0745a 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot @@ -34,11 +34,21 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modinfo overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + modprobe overlay + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then echo Setting up RAM-root tmpfs. mount -t tmpfs -o mode=755 rootfs $NEWROOT From e22130a46bc4d9c36edf54cb9acf5cf9328e7653 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 23 Apr 2020 12:35:49 -0400 Subject: [PATCH 052/102] add mkfs.xfs to older version of dracut --- xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk | 4 ++-- xCAT-server/share/xcat/netboot/rh/dracut/install.netboot | 2 +- xCAT-server/share/xcat/netboot/rh/dracut/install.statelite | 2 +- xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot | 2 +- .../share/xcat/netboot/rh/dracut_033/install.statelite | 2 +- .../share/xcat/netboot/sles/dracut_033/install.netboot | 2 +- .../share/xcat/netboot/sles/dracut_033/install.statelite | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk index 7d78fc847..73a1f7e83 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk @@ -217,8 +217,8 @@ doconfigure () { partnum=`expr $partnum + 1` partdev=$dev$partnum echo "Create filesystem $fstype on $partdev" >>$LOG - echo "mkfs.$fstype -q $partdev" >>$LOG - `mkfs.$fstype -q $partdev > /dev/null` + echo "mkfs.$fstype -f -q $partdev" >>$LOG + `mkfs.$fstype -f -q $partdev > /dev/null` sleep 1 done elif [ $localspace -eq 1 ]; then diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot index dd6fb9a6b..9b5da98ff 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot @@ -4,7 +4,7 @@ dracut_install wget tar cpio gzip dash modprobe touch echo cut wc xz dracut_install -o ctorrent dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite index b8bf69a46..df2bf5bc4 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite @@ -3,7 +3,7 @@ echo $drivers dracut_install wget tar cpio gzip dash modprobe wc touch echo cut dracut_install -o ctorrent dracut_install grep ifconfig hostname awk egrep grep dirname expr -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot index 2a62a66c6..b6be1168b 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot @@ -3,7 +3,7 @@ echo $drivers dracut_install wget tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite index 07e24fee4..8ded72c3c 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite @@ -2,7 +2,7 @@ echo $drivers dracut_install wget cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig hostname awk egrep grep dirname expr -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot index d98aa6c54..7fad93458 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot @@ -3,7 +3,7 @@ echo $drivers dracut_install wget tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig ip hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite index ccbdc49cf..f63f58b18 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite @@ -2,7 +2,7 @@ echo $drivers dracut_install wget cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig ip hostname awk egrep grep dirname expr logger -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh" From 4da1015c0be05daac47a6860904842ea4a88b7c2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 24 Apr 2020 10:34:10 -0400 Subject: [PATCH 053/102] Add two testcases to test squashfs diskless mount --- .../autotest/bundle/rhels_ppcle_daily.bundle | 1 + .../autotest/bundle/rhels_ppcle_weekly.bundle | 1 + .../autotest/bundle/rhels_x86_daily.bundle | 1 + .../autotest/bundle/rhels_x86_weekly.bundle | 1 + .../autotest/bundle/sles_ppcle_daily.bundle | 1 + .../autotest/bundle/sles_ppcle_weekly.bundle | 1 + .../autotest/bundle/sles_x86_daily.bundle | 1 + .../autotest/bundle/sles_x86_weekly.bundle | 1 + .../autotest/bundle/ubuntu_ppcle_daily.bundle | 1 + .../autotest/bundle/ubuntu_x86_daily.bundle | 1 + .../reg_linux_diskless_installation_flat | 87 ++++++++++++++++++ .../reg_linux_diskless_installation_hierarchy | 88 +++++++++++++++++++ 12 files changed, 185 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 9254f0613..9c45ac82c 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index f6c619655..e8b5b87d9 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -24,6 +24,7 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat rmimage_diskless rpower_reset diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 2bd2749c6..51c605833 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index b33107385..267fabddb 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -24,6 +24,7 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat rmimage_diskless rpower_reset diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 4e15bb1ca..4579ab45b 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index 557c79214..388887cd4 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -16,4 +16,5 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat 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 a7ec89506..ac69cd322 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index 8792401aa..76767fa1f 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -16,4 +16,5 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index a3e1facaf..2ac01f264 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,4 +1,5 @@ reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat 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 e61c5e1ef..5e4ffac31 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,4 +1,5 @@ reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index b048d547a..a1daa46f0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -84,3 +84,90 @@ cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 end + +start:reg_linux_diskless_installation_flat_squashfs +os:Linux +label:flat_cn_diskless,provision +cmd:fdisk -l +cmd:df -T +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi +check:rc==0 +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 + +cmd:makedns -n +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +check:rc==0 +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi +check:rc==0 +cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; +cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist +check:rc==0 +cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi +cmd:mount |sort > /tmp/mountoutput/file.org +cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ ppc64(el|le) ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:mount |sort > /tmp/mountoutput/file.new +cmd:cat /tmp/mountoutput/file.new +cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-lines="fusectl" +check:rc==0 +cmd:rm -rf /tmp/mountoutput +cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~archive method:squashfs + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~Provision node\(s\)\: $$CN + +cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi + +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +check:output=~on / type tmpfs +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi +check:rc==0 +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd:xdsh $$CN "cat /test.synclist" +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi +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 +end 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 6dd07c8a8..1a8ed863c 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -108,3 +108,91 @@ check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 end + +start:reg_linux_diskless_installation_hierarchy_squashfs +os:Linux +#stop:yes +label:hierarchy_cn_diskless,provision +cmd:xdsh $$SN fdisk -l +cmd:xdsh $$SN df -T +cmd:xdsh $$SN "echo "test"> /test.hierarchy" +check:rc==0 +cmd:xdsh $$SN cat /test.hierarchy +check:rc==0 +check:output=~test +cmd:output=$(xdsh $$SN ls -al / |grep test.hierarchy);if [[ $? -eq 0 ]];then xdsh $$SN rm -rf /test.hierarchy;fi +cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN +cmd:chdef -t node $$SN groups=service,all +check:rc==0 + +cmd:makedns -n +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +check:rc==0 +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:service dhcpd restart +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +check:rc==0 +cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; +cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist +check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:packimage -m squashfs__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~archive method:squashfs + +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 + +cmd:updatenode $$CN -f +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~Provision node\(s\)\: $$CN + +cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" + +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +check:output=~on / type tmpfs +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +check:output=~SERVICEGROUP=$$SN +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi +check:rc==0 +cmd:xdsh $$CN "cat /test.synclist" +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi +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 + +end From c6969d9ee96538f3bfc2039f9d3f29f8fb12cc7a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 27 Apr 2020 09:56:24 -0400 Subject: [PATCH 054/102] Make sure squashfs-tools installed on Ubuntu for squashfs testcase --- .../installation/reg_linux_diskless_installation_flat | 4 ++++ .../installation/reg_linux_diskless_installation_hierarchy | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index a1daa46f0..dbc91f768 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -129,6 +129,10 @@ cmd:cat /tmp/mountoutput/file.new cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-lines="fusectl" check:rc==0 cmd:rm -rf /tmp/mountoutput + +#Make sure squashfs-tools rpm is installed on Ubuntu +cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi + cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs 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 1a8ed863c..8e863f65a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -152,7 +152,11 @@ cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR( cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:packimage -m squashfs__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute + +#Make sure squashfs-tools rpm is installed on Ubuntu +cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi + +cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs From 6743873e89982710db70f47833ed00ece3838e38 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 29 Apr 2020 09:06:57 -0400 Subject: [PATCH 055/102] Use ext4 filesystem instead of ext3 --- .../setup_ha_mgmt_node_with_shared_data.rst | 12 ++++---- .../common/deployment/cfg_partition.rst | 30 +++++++++---------- .../common/deployment/enable_localdisk.rst | 4 +-- .../share/xcat/install/SL/compute.tmpl | 2 +- .../share/xcat/install/centos/all.tmpl | 4 +-- .../share/xcat/install/centos/iscsi.tmpl | 2 +- .../share/xcat/install/centos/storage.tmpl | 4 +-- .../share/xcat/install/centos/xen.tmpl | 2 +- .../share/xcat/install/debian/compute.tmpl | 8 ++--- xCAT-server/share/xcat/install/esx/esx.tmpl | 4 +-- .../xcat/install/fedora/compute.ppc64.tmpl | 4 +-- .../share/xcat/install/fedora/compute.tmpl | 2 +- .../share/xcat/install/fedora/iscsi.tmpl | 2 +- .../share/xcat/install/fedora/service.tmpl | 2 +- .../share/xcat/install/rh/compute.ppc64.tmpl | 2 +- .../share/xcat/install/rh/compute.tmpl | 2 +- xCAT-server/share/xcat/install/rh/iscsi.tmpl | 2 +- xCAT-server/share/xcat/install/rh/kvm.tmpl | 4 +-- .../share/xcat/install/rh/service.ppc64.tmpl | 2 +- .../share/xcat/install/rh/service.tmpl | 2 +- .../share/xcat/install/rh/storage.tmpl | 4 +-- xCAT-server/share/xcat/install/scripts/pre.rh | 2 +- .../share/xcat/install/scripts/pre.rh.rhels7 | 2 +- .../share/xcat/install/scripts/pre.ubuntu | 8 ++--- xCAT/postscripts/setupscratch | 6 ++-- 25 files changed, 59 insertions(+), 59 deletions(-) diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst index ab574af45..9c6ff0d2a 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst @@ -499,13 +499,13 @@ The operating system is installed on the internal disks. #. Create file systems on shared disks - Run the ``mkfs.ext3`` command on the primary management node to create file systems on the shared disk that will contain the xCAT data. For example: :: + Run the ``mkfs.ext4`` command on the primary management node to create file systems on the shared disk that will contain the xCAT data. For example: :: - mkfs.ext3 -v /dev/sdc1 - mkfs.ext3 -v /dev/sdc2 - mkfs.ext3 -v /dev/sdc3 - mkfs.ext3 -v /dev/sdc4 - mkfs.ext3 -v /dev/sdc5 + mkfs.ext4 -v /dev/sdc1 + mkfs.ext4 -v /dev/sdc2 + mkfs.ext4 -v /dev/sdc3 + mkfs.ext4 -v /dev/sdc4 + mkfs.ext4 -v /dev/sdc5 If you place entries for the disk in ``/etc/fstab``, which is not required, ensure that the entries do not have the system automatically mount the disk. 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 cc170bd82..346f73ce9 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 @@ -107,7 +107,7 @@ Here is partition definition file example for SLES standard partition in X86_64 true - ext3 + ext4 true / path @@ -131,7 +131,7 @@ The following is an example of a partition definition file for a SLES LVM Partit true false - ext3 + ext4 true false device @@ -148,7 +148,7 @@ The following is an example of a partition definition file for a SLES LVM Partit true false - ext3 + ext4 true false /boot @@ -211,7 +211,7 @@ The following is an example of a partition definition file for a SLES LVM Partit true false - ext3 + ext4 true false root @@ -248,7 +248,7 @@ Here is partition definition file example for SLES standard partition in ppc64 m true false - ext3 + ext4 false false device @@ -274,7 +274,7 @@ Here is partition definition file example for SLES standard partition in ppc64 m true false - ext3 + ext4 true acl,user_xattr false @@ -328,19 +328,19 @@ Here is partition definition file example for Ubuntu standard partition in x86_6 filesystem{ vfat } mountpoint{ /boot/efi } . - 256 256 512 ext3 + 256 256 512 ext4 $primary{ } method{ format } format{ } use_filesystem{ } - filesystem{ ext3 } + filesystem{ ext4 } mountpoint{ /boot } . 64 512 300% linux-swap method{ swap } format{ } . - 512 1024 4096 ext3 + 512 1024 4096 ext4 $primary{ } method{ format } format{ } @@ -348,7 +348,7 @@ Here is partition definition file example for Ubuntu standard partition in x86_6 filesystem{ ext4 } mountpoint{ / } . - 100 10000 1000000000 ext3 + 100 10000 1000000000 ext4 method{ format } format{ } use_filesystem{ } @@ -403,7 +403,7 @@ Here is an example of the partition script on RedHat and SLES, the partitioning else FSTYPE=ext3 fi - BOOTFSTYPE=ext3 + BOOTFSTYPE=ext4 EFIFSTYPE=vfat if uname -r|grep ^3.*el7 > /dev/null; then FSTYPE=xfs @@ -438,12 +438,12 @@ The following is an example of the partition script on Ubuntu, the partitioning echo " ." >> /tmp/partitionfile else echo "ubuntu-boot ::" > /tmp/partitionfile - echo "100 50 100 ext3" >> /tmp/partitionfile - echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /boot }' >> /tmp/partitionfile + echo "100 50 100 ext4" >> /tmp/partitionfile + echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile fi - echo "500 10000 1000000000 ext3" >> /tmp/partitionfile - echo " method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / }" >> /tmp/partitionfile + echo "500 10000 1000000000 ext4" >> /tmp/partitionfile + echo " method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / }" >> /tmp/partitionfile echo " ." >> /tmp/partitionfile echo "2048 512 300% linux-swap" >> /tmp/partitionfile echo " method{ swap } format{ }" >> /tmp/partitionfile diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst index 73d966f58..7d848eb9b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst @@ -40,7 +40,7 @@ An example ``localdisk`` configuration file: :: [localspace] dev=/dev/sda1 - fstype=ext3 + fstype=ext4 [swapspace] dev=/dev/sda2 @@ -55,7 +55,7 @@ The ``[disk]`` section is used to configure how to partition a hard disk: * dev: The path of the device file. * clear: If set to ``yes`` it will clear all the existing partitions on this disk. * ptype: The partition table type of the disk. For example, ``msdos`` or ``gpt``, and ``msdos`` is the default. - * fstype: The file system type for the new created partitions. ``ext3`` is the default. + * fstype: The file system type for the new created partitions. ``ext4`` is the default. * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If set to ``50``, 50% of the disk space will be assigned to that partition. The ``[localspace]`` section is used to specify which partition will be used as local storage for the node. diff --git a/xCAT-server/share/xcat/install/SL/compute.tmpl b/xCAT-server/share/xcat/install/SL/compute.tmpl index e21976494..669c02793 100644 --- a/xCAT-server/share/xcat/install/SL/compute.tmpl +++ b/xCAT-server/share/xcat/install/SL/compute.tmpl @@ -36,7 +36,7 @@ key --skip #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/all.tmpl b/xCAT-server/share/xcat/install/centos/all.tmpl index 68453ddfa..6e1957872 100644 --- a/xCAT-server/share/xcat/install/centos/all.tmpl +++ b/xCAT-server/share/xcat/install/centos/all.tmpl @@ -34,9 +34,9 @@ clearpart --all --initlabel #XCAT_PARTITION_START# #No RAID -part /boot --size 50 --ondisk sda --fstype ext3 +part /boot --size 50 --ondisk sda --fstype ext4 part swap --size 1024 --ondisk sda -part / --size 6000 --grow --ondisk sda --fstype ext3 +part / --size 6000 --grow --ondisk sda --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/iscsi.tmpl b/xCAT-server/share/xcat/install/centos/iscsi.tmpl index 0fdae7dcb..5d0e3f3a1 100644 --- a/xCAT-server/share/xcat/install/centos/iscsi.tmpl +++ b/xCAT-server/share/xcat/install/centos/iscsi.tmpl @@ -39,7 +39,7 @@ iscsi --ipaddr #TABLE:iscsi:$NODE:server# --user "#TABLEBLANKOKAY:iscsi:$NODE:us #No RAID #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/storage.tmpl b/xCAT-server/share/xcat/install/centos/storage.tmpl index eb16fa341..79624cf56 100644 --- a/xCAT-server/share/xcat/install/centos/storage.tmpl +++ b/xCAT-server/share/xcat/install/centos/storage.tmpl @@ -36,9 +36,9 @@ clearpart --all --initlabel #XCAT_PARTITION_START# #No RAID -part /boot --size 100 --ondisk sda --fstype ext3 +part /boot --size 100 --ondisk sda --fstype ext4 part swap --size 2048 --ondisk sda -part / --size 6000 --grow --ondisk sda --fstype ext3 +part / --size 6000 --grow --ondisk sda --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/xen.tmpl b/xCAT-server/share/xcat/install/centos/xen.tmpl index f2042c88f..b75924668 100644 --- a/xCAT-server/share/xcat/install/centos/xen.tmpl +++ b/xCAT-server/share/xcat/install/centos/xen.tmpl @@ -36,7 +36,7 @@ clearpart --all --initlabel #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/debian/compute.tmpl b/xCAT-server/share/xcat/install/debian/compute.tmpl index 38c26403d..266436a4e 100644 --- a/xCAT-server/share/xcat/install/debian/compute.tmpl +++ b/xCAT-server/share/xcat/install/debian/compute.tmpl @@ -44,15 +44,15 @@ d-i partman-md/device_remove_md boolean true d-i partman-auto/expert_recipe string \ boot-root :: \ - 40 50 100 ext3 \ + 40 50 100 ext4 \ $primary{ } $bootable{ } \ method{ format } format{ } \ - use_filesystem{ } filesystem{ ext3 } \ + use_filesystem{ } filesystem{ ext4 } \ mountpoint{ /boot } \ . \ - 500 10000 1000000000 ext3 \ + 500 10000 1000000000 ext4 \ method{ format } format{ } \ - use_filesystem{ } filesystem{ ext3 } \ + use_filesystem{ } filesystem{ ext4 } \ mountpoint{ / } \ . \ 64 512 300% linux-swap \ diff --git a/xCAT-server/share/xcat/install/esx/esx.tmpl b/xCAT-server/share/xcat/install/esx/esx.tmpl index 3003bd7fd..2acb242ae 100644 --- a/xCAT-server/share/xcat/install/esx/esx.tmpl +++ b/xCAT-server/share/xcat/install/esx/esx.tmpl @@ -15,8 +15,8 @@ reboot url --url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch# zerombr yes clearpart --all --initlabel --drives=sda -part /boot --fstype ext3 --size=100 --ondisk=sda -part / --fstype ext3 --size=2048 --ondisk=sda +part /boot --fstype ext4 --size=100 --ondisk=sda +part / --fstype ext4 --size=2048 --ondisk=sda part swap --size=2048 --ondisk=sda part None --fstype vmfs3 --size=900 --ondisk=sda --grow part None --fstype vmkcore --size=100 --ondisk=sda diff --git a/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl b/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl index b652d29c9..4287dd921 100644 --- a/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl +++ b/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl @@ -36,9 +36,9 @@ clearpart --all --initlabel #No RAID #/boot really significant for this sort of setup nowadays? part None --fstype "PPC PReP Boot" --size 8 -part /boot --size 50 --fstype ext3 +part /boot --size 50 --fstype ext4 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/fedora/compute.tmpl b/xCAT-server/share/xcat/install/fedora/compute.tmpl index 9d777c923..1dae337d2 100644 --- a/xCAT-server/share/xcat/install/fedora/compute.tmpl +++ b/xCAT-server/share/xcat/install/fedora/compute.tmpl @@ -37,7 +37,7 @@ clearpart --all --initlabel #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/fedora/iscsi.tmpl b/xCAT-server/share/xcat/install/fedora/iscsi.tmpl index 2a6604cc8..2fbfe89b5 100644 --- a/xCAT-server/share/xcat/install/fedora/iscsi.tmpl +++ b/xCAT-server/share/xcat/install/fedora/iscsi.tmpl @@ -39,7 +39,7 @@ iscsi --ipaddr #TABLE:iscsi:$NODE:server# --user "#TABLEBLANKOKAY:iscsi:$NODE:us #No RAID #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/fedora/service.tmpl b/xCAT-server/share/xcat/install/fedora/service.tmpl index 9d777c923..1dae337d2 100644 --- a/xCAT-server/share/xcat/install/fedora/service.tmpl +++ b/xCAT-server/share/xcat/install/fedora/service.tmpl @@ -37,7 +37,7 @@ clearpart --all --initlabel #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl b/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl index ea3996a68..a6d020d60 100644 --- a/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl @@ -40,7 +40,7 @@ key --skip part None --fstype "PPC PReP Boot" --size 8 #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/compute.tmpl b/xCAT-server/share/xcat/install/rh/compute.tmpl index 5ec90dd22..6a027a9d2 100644 --- a/xCAT-server/share/xcat/install/rh/compute.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.tmpl @@ -39,7 +39,7 @@ key --skip #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/iscsi.tmpl b/xCAT-server/share/xcat/install/rh/iscsi.tmpl index 0fdae7dcb..5d0e3f3a1 100644 --- a/xCAT-server/share/xcat/install/rh/iscsi.tmpl +++ b/xCAT-server/share/xcat/install/rh/iscsi.tmpl @@ -39,7 +39,7 @@ iscsi --ipaddr #TABLE:iscsi:$NODE:server# --user "#TABLEBLANKOKAY:iscsi:$NODE:us #No RAID #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/kvm.tmpl b/xCAT-server/share/xcat/install/rh/kvm.tmpl index f18d88c54..a62a1b7af 100644 --- a/xCAT-server/share/xcat/install/rh/kvm.tmpl +++ b/xCAT-server/share/xcat/install/rh/kvm.tmpl @@ -42,9 +42,9 @@ key --skip #XCAT_PARTITION_START# #No RAID #/boot really significant for this sort of setup nowadays? -#part /boot --size 50 --fstype ext3 +#part /boot --size 50 --fstype ext4 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl b/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl index 19f5bc545..c49f938bc 100644 --- a/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl +++ b/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl @@ -39,7 +39,7 @@ part None --fstype "PPC PReP Boot" --size 8 #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/service.tmpl b/xCAT-server/share/xcat/install/rh/service.tmpl index 87757ab8e..e066f9f67 100644 --- a/xCAT-server/share/xcat/install/rh/service.tmpl +++ b/xCAT-server/share/xcat/install/rh/service.tmpl @@ -37,7 +37,7 @@ key --skip #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/storage.tmpl b/xCAT-server/share/xcat/install/rh/storage.tmpl index eb16fa341..79624cf56 100644 --- a/xCAT-server/share/xcat/install/rh/storage.tmpl +++ b/xCAT-server/share/xcat/install/rh/storage.tmpl @@ -36,9 +36,9 @@ clearpart --all --initlabel #XCAT_PARTITION_START# #No RAID -part /boot --size 100 --ondisk sda --fstype ext3 +part /boot --size 100 --ondisk sda --fstype ext4 part swap --size 2048 --ondisk sda -part / --size 6000 --grow --ondisk sda --fstype ext3 +part / --size 6000 --grow --ondisk sda --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index 99eeaacee..064aa89a8 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -260,7 +260,7 @@ elif grep ext4 /proc/filesystems > /dev/null; then else FSTYPE=ext3 fi -BOOTFSTYPE=ext3 +BOOTFSTYPE=ext4 EFIFSTYPE=vfat msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label" if [ `uname -m` = "ppc64" ]; then diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 index 3f9aca9b6..aaf7b4fad 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 @@ -226,7 +226,7 @@ elif grep ext4 /proc/filesystems > /dev/null; then else FSTYPE=ext3 fi -BOOTFSTYPE=ext3 +BOOTFSTYPE=ext4 EFIFSTYPE=vfat if uname -r|grep -q '^3.*el7'; then diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu b/xCAT-server/share/xcat/install/scripts/pre.ubuntu index f528eec91..1f8d6a1cf 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu @@ -195,12 +195,12 @@ if [ -d /sys/firmware/efi ]; then echo " ." >> /tmp/partitionfile else echo "ubuntu-boot ::" > /tmp/partitionfile - echo "256 256 512 ext3" >> /tmp/partitionfile - echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /boot }' >> /tmp/partitionfile + echo "256 256 512 ext4" >> /tmp/partitionfile + echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile fi -echo "500 10000 1000000000 ext3" >> /tmp/partitionfile -echo " method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / }" >> /tmp/partitionfile +echo "500 10000 1000000000 ext4" >> /tmp/partitionfile +echo " method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / }" >> /tmp/partitionfile echo " ." >> /tmp/partitionfile echo "2048 512 300% linux-swap" >> /tmp/partitionfile echo " method{ swap } format{ }" >> /tmp/partitionfile diff --git a/xCAT/postscripts/setupscratch b/xCAT/postscripts/setupscratch index 244e65847..3c5e7427d 100755 --- a/xCAT/postscripts/setupscratch +++ b/xCAT/postscripts/setupscratch @@ -45,7 +45,7 @@ fi echo Creating Partition logger -t $log_label -p local4.info $ME Creating Partition parted -s /dev/sda mklabel gpt -parted -s -- /dev/sda mkpart primary ext3 0 -0 +parted -s -- /dev/sda mkpart primary ext4 0 -0 if grep sda1 /proc/partitions >/dev/null 2>&1 then sleep 5 @@ -58,8 +58,8 @@ else exit 1 fi -echo Creating new ext3 filesystem: /dev/sda1 -logger -t $log_label -p local4.info $ME Creating new ext3 filesystem: /dev/sda1 +echo Creating new ext4 filesystem: /dev/sda1 +logger -t $log_label -p local4.info $ME Creating new ext4 filesystem: /dev/sda1 mke2fs -j /dev/sda1 mkdir -p $mydir echo mounting new /dev/sda1 to $mydir From 53d3d915d1d8d4b6779df25bdb5cff3bf29f0a54 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 29 Apr 2020 14:17:51 -0400 Subject: [PATCH 056/102] Make sure squashfs installed on SLES for squashfs testcase --- xCAT-server/lib/xcat/plugins/packimage.pm | 6 +++++- .../installation/reg_linux_diskless_installation_flat | 3 +++ .../installation/reg_linux_diskless_installation_hierarchy | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 2cf3f9e1f..9dbb6f04b 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -585,7 +585,11 @@ sub process_request { } if (!-x "/sbin/mksquashfs" && !-x "/usr/bin/mksquashfs") { - $callback->({ error => ["mksquashfs not found, squashfs-tools rpm should be installed on the management node"], errorcode => [1] }); + if ($osver =~ /sle/) { + $callback->({ error => ["mksquashfs not found, squashfs rpm should be installed on the management node"], errorcode => [1] }); + } else { + $callback->({ error => ["mksquashfs not found, squashfs-tools rpm should be installed on the management node"], errorcode => [1] }); + } return 1; } my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index dbc91f768..56d2fdfcc 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -133,6 +133,9 @@ cmd:rm -rf /tmp/mountoutput #Make sure squashfs-tools rpm is installed on Ubuntu cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi +#Make sure squashfs rpm is installed on SLES +cmd:if [ "$$OS" = "sle" ];then zypper install -y squashfs; fi + cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs 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 8e863f65a..411c9f37f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -156,6 +156,9 @@ check:rc==0 #Make sure squashfs-tools rpm is installed on Ubuntu cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi +#Make sure squashfs rpm is installed on SLES +cmd:if [ "$$OS" = "sle" ];then zypper install -y squashfs; fi + cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs From be359b1899aefa76d9ddd75bd84b5deaeabd70fe Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 30 Apr 2020 13:58:35 -0400 Subject: [PATCH 057/102] Testcase and packimage fixes for squashfs --- xCAT-server/lib/xcat/plugins/packimage.pm | 16 +++++++--------- .../reg_linux_diskless_installation_flat | 9 ++++++--- .../reg_linux_diskless_installation_hierarchy | 9 ++++++--- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 9dbb6f04b..aa783fd86 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -573,15 +573,13 @@ sub process_request { chmod 0644, "$destdir/rootimg.$suffix"; umask $oldmask; } elsif ($method =~ /squashfs/) { - my $flags; - if ($arch =~ /x86/) { - $flags = "-le"; - } elsif ($arch =~ /ppc/) { - $flags = "-be"; - } - - if (($osver =~ /rhels/ && $osver !~ /rhels5/) || ($osver =~ /centos/)) { - $flags = ""; + my $flags = ""; + if ($osver =~ /rhels5/) { + if ($arch =~ /x86/) { + $flags = "-le"; + } elsif ($arch =~ /ppc/) { + $flags = "-be"; + } } if (!-x "/sbin/mksquashfs" && !-x "/usr/bin/mksquashfs") { diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 56d2fdfcc..ab39cd496 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -130,11 +130,14 @@ cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-l check:rc==0 cmd:rm -rf /tmp/mountoutput +#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 Ubuntu -cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi +cmd:if [ "$$OS" =~ "ubuntu" ];then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES -cmd:if [ "$$OS" = "sle" ];then zypper install -y squashfs; fi +cmd:if [ "$$OS" =~ "sle" ];then zypper install -y squashfs; fi cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -157,7 +160,7 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 -check:output=~on / type tmpfs +check:output=~on / type overlay cmd:xdsh $$CN cat /opt/xcat/xcatinfo check:rc==0 check:output=~NODE=$$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 411c9f37f..7a399e7b0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -153,11 +153,14 @@ 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 Ubuntu -cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi +cmd:if [ "$$OS" =~ "ubuntu" ];then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES -cmd:if [ "$$OS" = "sle" ];then zypper install -y squashfs; fi +cmd:if [ "$$OS" =~ "sle" ];then zypper install -y squashfs; fi cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -185,7 +188,7 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 -check:output=~on / type tmpfs +check:output=~on / type overlay cmd:xdsh $$CN cat /opt/xcat/xcatinfo check:rc==0 check:output=~NODE=$$CN From 573966c85022ba71eb02195d0ae98eb988206ed8 Mon Sep 17 00:00:00 2001 From: nicmays Date: Thu, 30 Apr 2020 16:21:55 -0400 Subject: [PATCH 058/102] handled an edge case to treat a 'stable' flag as a latest flag in a cmd call go-xcat install --xcat-version=stable. --- xCAT-server/share/xcat/tools/go-xcat | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 2b3750d66..d6ba38bdd 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1322,6 +1322,12 @@ function add_xcat_core_repo_yum_or_zypper() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" + + if [[ ${ver} == "stable" ]] + then + ver="latest" + fi + if [[ -z "${url}" ]] then case "${ver}" in @@ -1348,6 +1354,12 @@ function add_xcat_core_repo_apt() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" + + if [[ ${ver} == "stable" ]] + then + ver="latest" + fi + if [[ -z "${url}" ]] then # get the apt.key @@ -1382,6 +1394,12 @@ function add_xcat_dep_repo_yum_or_zypper() local url="$1" local ver="$2" [[ -z "${ver}" ]] && ver="latest" + + if [[ ${ver} == "stable" ]] + then + ver="latest" + fi + local tmp="" local install_path="${GO_XCAT_DEFAULT_INSTALL_PATH}" local distro="${GO_XCAT_LINUX_DISTRO}${GO_XCAT_LINUX_VERSION%%.*}" @@ -1450,6 +1468,12 @@ function add_xcat_dep_repo_apt() local url="$1" local ver="$2" [[ -z "${ver}" ]] && ver="latest" + + if [[ ${ver} == "stable" ]] + then + ver="latest" + fi + [[ -z "${url}" ]] && url="${GO_XCAT_DEFAULT_BASE_URL}/apt/${ver}/xcat-dep" add_repo_by_url_apt "${url}" "xcat-dep" From f7dbd08b96d07e2e3347e0d9fe1146a9c3093b54 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 1 May 2020 12:33:11 -0400 Subject: [PATCH 059/102] Testcase and genimage fixes for squashfs --- xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot | 2 +- .../installation/reg_linux_diskless_installation_flat | 6 +++--- .../installation/reg_linux_diskless_installation_hierarchy | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index a3f6c373a..bc244e073 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -65,7 +65,6 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT modinfo overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" @@ -75,6 +74,7 @@ if [ -r /rootimg.sfs ]; then mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT mkdir -p $NEWROOT/ro mkdir -p $NEWROOT/rw mount --move /ro $NEWROOT/ro diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index ab39cd496..b07c66ed2 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -131,13 +131,13 @@ check:rc==0 cmd:rm -rf /tmp/mountoutput #Make sure squashfs-tools rpm is installed on RHEL -cmd:if [ "$$OS" =~ "rhel" ];then yum install -y squashfs-tools; fi +cmd:if [[ "$$OS" =~ "rhel" ]]; 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 +cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES -cmd:if [ "$$OS" =~ "sle" ];then zypper install -y squashfs; fi +cmd:if [[ "$$OS" =~ "sle" ]]; then zypper install -y squashfs; fi cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 7a399e7b0..5586630d4 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -154,13 +154,13 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 #Make sure squashfs-tools rpm is installed on RHEL -cmd:if [ "$$OS" =~ "rhel" ];then yum install -y squashfs-tools; fi +cmd:if [[ "$$OS" =~ "rhel" ]]; 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 +cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES -cmd:if [ "$$OS" =~ "sle" ];then zypper install -y squashfs; fi +cmd:if [[ "$$OS" =~ "sle" ]]; then zypper install -y squashfs; fi cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 From fa86dd4fbb6f0b7932117b4b680ef9f76beed98a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 1 May 2020 14:12:30 -0400 Subject: [PATCH 060/102] Use XML::LibXML::Simple instead of XML::Simple --- xCAT-server/sbin/xcatd | 22 +++++++++++++++++++--- xCAT-server/xCAT-server.spec | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 8f31e4f83..0549ef122 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -119,6 +119,7 @@ use IO::Handle; use IO::Select; use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; +use XML::LibXML; use xCAT::Table; my $dbmaster; use xCAT::ExtTab; @@ -691,7 +692,12 @@ sub do_discovery_process { IO::Uncompress::Gunzip::gunzip(\$data, \$bigdata); $data = $bigdata; } - my $req = eval { XMLin($data, SuppressEmpty => undef, ForceArray => 1) }; + my $req = eval { XMLin($data, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ + load_ext_dtd => 0, + ext_ent_handler => undef, + no_network => 1, + expand_entities => 0, + ]) }; 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; @@ -2714,7 +2720,12 @@ 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 => 1); + 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, + ]); cmdlog_collectlog($cmdlog_rsp); # ----used for command log end -------- @@ -2771,7 +2782,12 @@ sub get_request { return undef; } } - return eval { XMLin($request, SuppressEmpty => undef, ForceArray => 1) }; + return eval { XMLin($request, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ + load_ext_dtd => 0, + ext_ent_handler => undef, + no_network => 1, + expand_entities => 0, + ]) }; } elsif ($encode eq "storable") { my $return = eval { fd_retrieve($sock); }; # suppres end of stream err return $return; diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index a406d654f..91819f16d 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -37,7 +37,7 @@ BuildArch: noarch %if %s390x Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser %else -Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) +Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) perl-XML-LibXML-Simple %endif Obsoletes: atftp-xcat %endif From 9b99c07d0da0052f484c005346b33f13958f832b Mon Sep 17 00:00:00 2001 From: nicmays Date: Mon, 4 May 2020 12:09:17 -0400 Subject: [PATCH 061/102] added some tracing. --- xCAT-server/share/xcat/tools/go-xcat | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index d6ba38bdd..e6f2a705f 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1322,6 +1322,8 @@ function add_xcat_core_repo_yum_or_zypper() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" + + echo "\nim here!!!!!\n" if [[ ${ver} == "stable" ]] then @@ -1355,6 +1357,8 @@ function add_xcat_core_repo_apt() local tmp="" [[ -z "${ver}" ]] && ver="latest" + echo "\nim here2!!!!!\n" + if [[ ${ver} == "stable" ]] then ver="latest" @@ -1395,6 +1399,8 @@ function add_xcat_dep_repo_yum_or_zypper() local ver="$2" [[ -z "${ver}" ]] && ver="latest" + echo "\nim here3!!!!!\n" + if [[ ${ver} == "stable" ]] then ver="latest" @@ -1469,6 +1475,8 @@ function add_xcat_dep_repo_apt() local ver="$2" [[ -z "${ver}" ]] && ver="latest" + echo "\nim here4!!!!!\n" + if [[ ${ver} == "stable" ]] then ver="latest" From 7bdad3e2fc96497aa1f7f1b3e8c10868dfbecba5 Mon Sep 17 00:00:00 2001 From: nicmays Date: Mon, 4 May 2020 12:57:54 -0400 Subject: [PATCH 062/102] Attempting to default to latest if stable is specified in the main program versus the function calls. --- xCAT-server/share/xcat/tools/go-xcat | 33 +++++----------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index e6f2a705f..bf37f8326 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1322,13 +1322,6 @@ function add_xcat_core_repo_yum_or_zypper() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" - - echo "\nim here!!!!!\n" - - if [[ ${ver} == "stable" ]] - then - ver="latest" - fi if [[ -z "${url}" ]] then @@ -1356,13 +1349,6 @@ function add_xcat_core_repo_apt() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" - - echo "\nim here2!!!!!\n" - - if [[ ${ver} == "stable" ]] - then - ver="latest" - fi if [[ -z "${url}" ]] then @@ -1399,13 +1385,6 @@ function add_xcat_dep_repo_yum_or_zypper() local ver="$2" [[ -z "${ver}" ]] && ver="latest" - echo "\nim here3!!!!!\n" - - if [[ ${ver} == "stable" ]] - then - ver="latest" - fi - local tmp="" local install_path="${GO_XCAT_DEFAULT_INSTALL_PATH}" local distro="${GO_XCAT_LINUX_DISTRO}${GO_XCAT_LINUX_VERSION%%.*}" @@ -1475,13 +1454,6 @@ function add_xcat_dep_repo_apt() local ver="$2" [[ -z "${ver}" ]] && ver="latest" - echo "\nim here4!!!!!\n" - - if [[ ${ver} == "stable" ]] - then - ver="latest" - fi - [[ -z "${url}" ]] && url="${GO_XCAT_DEFAULT_BASE_URL}/apt/${ver}/xcat-dep" add_repo_by_url_apt "${url}" "xcat-dep" @@ -2049,6 +2021,11 @@ do shift done +if [[ ${GO_XCAT_VERSION} == "stable" ]] + then + ${GO_XCAT_VERSION} = "latest" +fi + case "${GO_XCAT_ACTION}" in "away") GO_XCAT_YES=("-y") From a2cb534bb6f5b1fc2b7ca75e5156f3c9f554cebf Mon Sep 17 00:00:00 2001 From: root Date: Mon, 4 May 2020 14:54:38 -0400 Subject: [PATCH 063/102] Changed code to handle the stable flag inside the swtich statement where we parse the command in the main program. --- xCAT-server/share/xcat/tools/go-xcat | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index bf37f8326..355e2e089 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1993,9 +1993,17 @@ do "-x"|"--xcat-version") shift GO_XCAT_VERSION="$1" + if [ "${GO_XCAT_VERSION}" = "stable" ]; + then + GO_XCAT_VERSION="latest" + fi ;; "--xcat-version="*) GO_XCAT_VERSION="${1##--xcat-version=}" + if [ "${GO_XCAT_VERSION}" = "stable" ]; + then + GO_XCAT_VERSION="latest" + fi ;; "-y"|"--yes") GO_XCAT_YES=("-y") @@ -2021,11 +2029,6 @@ do shift done -if [[ ${GO_XCAT_VERSION} == "stable" ]] - then - ${GO_XCAT_VERSION} = "latest" -fi - case "${GO_XCAT_ACTION}" in "away") GO_XCAT_YES=("-y") From a9e059d90fc01c2e083cb7aa2d307446063efcec Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 4 May 2020 16:23:42 -0400 Subject: [PATCH 064/102] Do not use modinfo to test module availability --- xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot | 3 +-- xCAT-server/share/xcat/netboot/rh/dracut/xcatroot | 3 +-- xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot | 3 +-- xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot | 3 +-- xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot | 3 +-- xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot index 5bed21474..7811cf0fb 100755 --- a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot @@ -52,12 +52,11 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - modinfo overlay + modprobe overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" mkdir -p /rw/upper mkdir -p /rw/work - modprobe overlay mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index c3c469902..423ab6d36 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -62,12 +62,11 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - modinfo overlay + modprobe overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" mkdir -p /rw/upper mkdir -p /rw/work - modprobe overlay mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index dc8910aa0..b52b49035 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -69,12 +69,11 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - modinfo overlay + modprobe overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" mkdir -p /rw/upper mkdir -p /rw/work - modprobe overlay mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot index 0aeaa51d4..b851865b5 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot @@ -69,12 +69,11 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - modinfo overlay + modprobe overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" mkdir -p /rw/upper mkdir -p /rw/work - modprobe overlay mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index bc244e073..c05a3e793 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -65,12 +65,11 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - modinfo overlay + modprobe overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" mkdir -p /rw/upper mkdir -p /rw/work - modprobe overlay mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" diff --git a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot index 4a3f0745a..46575db55 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot @@ -34,12 +34,11 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - modinfo overlay + modprobe overlay if [ $? -eq 0 ]; then echo "Mounting $NEWROOT with type overlay" mkdir -p /rw/upper mkdir -p /rw/work - modprobe overlay mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT else echo "Mounting $NEWROOT with type aufs" From 5b1dc8a509727507542db18211b83f19d9792077 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 5 May 2020 16:26:48 -0400 Subject: [PATCH 065/102] Add output verification to kdump testcase --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 6491014eb..515ff35af 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -91,6 +91,7 @@ check:rc==0 # Verify that kdump directory from management node is still mounted on the compute node cmd:xdsh $$CN df -H +check:output=~/opt/xcat/share/xcat/tools/autotest/kdumpdir # Verify kdump parameters are in /proc/cmdline file cmd:xdsh $$CN cat /proc/cmdline From e0469145ebd9bd23a0a4749bcd7b8b047d6243b2 Mon Sep 17 00:00:00 2001 From: nicmays Date: Tue, 5 May 2020 17:23:28 -0400 Subject: [PATCH 066/102] redacting the if statement for -x specifications. --- xCAT-server/share/xcat/tools/go-xcat | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 355e2e089..39a09751d 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1993,10 +1993,6 @@ do "-x"|"--xcat-version") shift GO_XCAT_VERSION="$1" - if [ "${GO_XCAT_VERSION}" = "stable" ]; - then - GO_XCAT_VERSION="latest" - fi ;; "--xcat-version="*) GO_XCAT_VERSION="${1##--xcat-version=}" From e542c012c96893e920a0706a63605dbfe41063c5 Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 6 May 2020 15:24:36 -0400 Subject: [PATCH 067/102] Remove ldd messages from ubuntu genimage command --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index f8203ef02..7fa290960 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -889,6 +889,11 @@ sub getlibs { my @libs = split /\n/, $liblist; my @return; foreach (@libs) { + # vdso is a shared library that's embedded in the kernel + # automatically loaded whenever a new process is exec-ed + if ( $_ =~ /linux-vdso64/ ) { + next; + } if (/statically linked/ or /not a dynamic executable/) { return; } @@ -1152,7 +1157,6 @@ PATH="\$PATH:/usr/sbin:/sbin" export PATH echo "Creating device nodes with udev" -/sbin/udevd --daemon if [ -f "/sbin/udevadm" ] then /sbin/udevadm trigger @@ -1648,7 +1652,7 @@ EOMS } # add extra commands for initrd - foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevd", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/xz", "bin/gzip", "bin/tar") { + foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/xz", "bin/gzip", "bin/tar") { getlibs($_); push @filestoadd, $_; } From 792aca18dce12f573a3ddcaf57cfbc5e4d450440 Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 6 May 2020 17:03:47 -0400 Subject: [PATCH 068/102] Discover Dell Switch via switchdiscover command --- perl-xCAT/xCAT/data/switchinfo.pm | 2 ++ xCAT-server/lib/xcat/plugins/switchdiscover.pm | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm index 7cf372ac9..7ef864390 100644 --- a/perl-xCAT/xCAT/data/switchinfo.pm +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -47,6 +47,8 @@ our %global_switch_type = ( sLEN => "irpdu", sIBM => "irpdu", coral => "crpdu" + Dell => "Dell" + dell => "Dell" ); diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 04aee5670..342c55ff0 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -981,14 +981,9 @@ sub get_snmpvendorinfo { push @comm_list, 'public'; foreach $comms(@comm_list) { - #for pdu: get vendor info from sysDescr - #for switches: get vendor info from entPhysicalDescr + # get vendor info from sysDescr my $ccmd; - if (exists($globalopt{pdu})) { - $ccmd = "snmpwalk -Os -v1 -c $comms $ip 1.3.6.1.2.1.1.1"; - } else { - $ccmd = "snmpwalk -Os -v1 -c $comms $ip 1.3.6.1.2.1.47.1.1.1.1.2.1"; - } + $ccmd = "snmpwalk -Os -v1 -c $comms $ip 1.3.6.1.2.1.1.1"; if (exists($globalopt{verbose})) { send_msg($request, 0, "Process command: $ccmd\n"); } From 13e0ef144dd61e35ec7a022f664fba9b59b96723 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 6 May 2020 17:08:30 -0400 Subject: [PATCH 069/102] Remove squashfs testcases from Ubuntu regression bundles --- xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle | 1 - xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle | 1 - 2 files changed, 2 deletions(-) diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 2ac01f264..a3e1facaf 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,5 +1,4 @@ reg_linux_diskless_installation_flat -reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat 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 5e4ffac31..e61c5e1ef 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,5 +1,4 @@ reg_linux_diskless_installation_flat -reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat assign_certain_command_permission bmcdiscover_help From 369aff6549b3e24392480477dcef1e49fcf6dced Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 6 May 2020 17:26:27 -0400 Subject: [PATCH 070/102] fix syntax errors --- perl-xCAT/xCAT/data/switchinfo.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm index 7ef864390..429285cbd 100644 --- a/perl-xCAT/xCAT/data/switchinfo.pm +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -46,8 +46,8 @@ our %global_switch_type = ( Edgecore => "onie", sLEN => "irpdu", sIBM => "irpdu", - coral => "crpdu" - Dell => "Dell" + coral => "crpdu", + Dell => "Dell", dell => "Dell" ); From ce92aab9e37ef7c4353a95a9524cc039a8aec5ad Mon Sep 17 00:00:00 2001 From: nicmays Date: Thu, 7 May 2020 12:17:41 -0400 Subject: [PATCH 071/102] updated the file header and version number with the enhancement, added an example to the examples section. --- xCAT-server/share/xcat/tools/go-xcat | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 39a09751d..9d8e76abd 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.45 +# Version 1.0.46 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -29,8 +29,12 @@ # - Display a list of packages that could not be uninstalled # 2019-11-05 Mark Gurevich # - Display a list of packages that will be installed before "Continue?" +# 2020-5-7 Nic Mays +# - Handles 'stable' as a flag to install latest version via the command: +# go-xcat --xcat-version=stable install # + function usage() { local script="${0##*/}" @@ -72,6 +76,7 @@ function usage() ${script} --yes install ${script} -x 2.12 -y install ${script} --xcat-version=devel install + ${script} --xcat-version=stable install ${script} --xcat-core=/path/to/xcat-core.tar.bz2 \\ --xcat-dep=/path/to/xcat-dep.tar.bz2 install ${script} --xcat-core=http://xcat.org/path/to/xcat-core.tar.bz2 \\ From 7fab544d9846b5ce26cde986a6071a08134ad310 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 7 May 2020 14:35:26 -0400 Subject: [PATCH 072/102] Ubuntu support for squashfs --- .../share/xcat/netboot/ubuntu/genimage | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 7fa290960..ab53db7f9 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -199,9 +199,9 @@ if ($netdriver) { } } else { if ($arch eq 'x86' or $arch eq 'x86_64') { - @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en virtio_net/; + @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en virtio_net overlay/; } elsif ($arch eq 'ppc64el') { - @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net/; + @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net overlay/; } elsif ($arch eq 'ppc64') { @ndrivers = qw/e1000 e1000e igb ibmveth ehea/; } elsif ($arch eq 's390x') { @@ -1465,11 +1465,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot \$NEWROOT - mkdir -p \$NEWROOT/ro - mkdir -p \$NEWROOT/rw - mount --move /ro \$NEWROOT/ro - mount --move /rw \$NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo Mounting \$NEWROOT with type overlay + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot \$NEWROOT + else + echo Mounting \$NEWROOT with type aufs + mount -t aufs -o dirs=/rw:/ro mergedroot \$NEWROOT + mkdir -p \$NEWROOT/ro + mkdir -p \$NEWROOT/rw + mount --move /ro \$NEWROOT/ro + mount --move /rw \$NEWROOT/rw + fi EOMS print $inifile "elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then\n"; print $inifile " logger -t \$log_label -p info \"Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]...\"\n"; From a50de858a9ece169000565872fd59f554c9e83c6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 7 May 2020 16:46:34 -0400 Subject: [PATCH 073/102] Revert "Remove squashfs testcases from Ubuntu regression bundles" --- xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index a3e1facaf..2ac01f264 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,4 +1,5 @@ reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat 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 e61c5e1ef..5e4ffac31 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,4 +1,5 @@ reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat assign_certain_command_permission bmcdiscover_help From 9faeff5999cba70c4efc60672828c68176fc8f1a Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Sun, 10 May 2020 21:18:50 -0400 Subject: [PATCH 074/102] Remove duplicates: post_host from restapi/service/cases0 and lskitcomp_C gfrom liskitcomp/case0. It turns out many duplicates identified earlier have different OSes, so they are left unchanged. --- xCAT-test/autotest/testcase/lskitcomp/case0 | 32 ------------------- .../autotest/testcase/restapi/service/cases0 | 7 ---- 2 files changed, 39 deletions(-) diff --git a/xCAT-test/autotest/testcase/lskitcomp/case0 b/xCAT-test/autotest/testcase/lskitcomp/case0 index bfd0d394c..fedca5036 100644 --- a/xCAT-test/autotest/testcase/lskitcomp/case0 +++ b/xCAT-test/autotest/testcase/lskitcomp/case0 @@ -55,38 +55,6 @@ cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1 cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits end -start:lskitcomp_C -label:others,KIT -os:Linux -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp;buildkit create mykits -check:rc==0 -check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits directory -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildrepo all -check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildtar -check:rc==0 -cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 -check:rc==0 -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C basename $compname -check:rc==0 -check:output=~basename -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitcompname $compname -check:output=~kitcompname -check:rc==0 -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitreponame $compname -check:rc==0 -check:output=~kitreponame -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C serverroles $compname -check:rc==0 -check:output=~serverroles -cmd:rmkit mykits-1.0-1 -check:rc==0 -cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits -end - - start:lskitcomp_S label:others,KIT os:Linux diff --git a/xCAT-test/autotest/testcase/restapi/service/cases0 b/xCAT-test/autotest/testcase/restapi/service/cases0 index 88c491b28..bd515386e 100644 --- a/xCAT-test/autotest/testcase/restapi/service/cases0 +++ b/xCAT-test/autotest/testcase/restapi/service/cases0 @@ -19,13 +19,6 @@ cmd:restapitest -m POST -r /services/host check:rc==201 end -start:post_host -description: post_host -label:others,restapi -cmd:restapitest -m POST -r /services/host -check:rc==201 -end - start:get_slpnodes description: get_slpnodes label:others,restapi From 93c1b83f6616ea95153afd5457b2507d8563aacd Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Sun, 10 May 2020 21:29:15 -0400 Subject: [PATCH 075/102] Add testing of nicips and nicaliases for xcat-core Issue 6676 --- xCAT-test/autotest/testcase/makehosts/cases0 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index acdc1a4b6..d64a42f3e 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -20,18 +20,30 @@ label:mn_only,ci_test,dns cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=nouse_compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 +cmd:chtab node=nouse_compute nics.nicaliases='ib0!|node(\d+)|m($1)-ib0|' nics.nicips='ib0!|node(\d+)|10.0.0.($1+20)|' +check:rc==0 cmd:mkdef -t node -o node01,node02 groups="nouse_compute" check:rc==0 -cmd:sleep 30 cmd:XCATBYPASS=1 makehosts check:rc==0 -cmd:sleep 30 +cmd:sleep 10 cmd:cat /etc/hosts -check:output=~1.2.3.2 check:output=~1.2.3.1 +check:rc==0 +check:output=~1.2.3.2 +check:rc==0 check:output=~node01 +check:rc==0 +check:output=~m01-ib0 +check:rc==0 check:output=~node02 +check:rc==0 +check:output=~m01-ib0 +check:rc==0 +check:output=~10.0.0.22 +check:rc==0 cmd:chtab -d node=nouse_compute hosts +cmd:chtab -d node=nouse_compute nics cmd:rmdef node01 cmd:rmdef node02 cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts From 721c0bbc3b764e0c4b8522b00bcb7d949f0684d5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 11 May 2020 09:29:03 -0400 Subject: [PATCH 076/102] Spec file fix for XML::LibXML --- 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 91819f16d..5c1f487c4 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -37,7 +37,7 @@ BuildArch: noarch %if %s390x Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser %else -Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) perl-XML-LibXML-Simple +Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) perl-XML-LibXML %endif Obsoletes: atftp-xcat %endif From d41c86debffb5e23f94f4017c2bd6e9492adb45e Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 11 May 2020 12:54:41 -0400 Subject: [PATCH 077/102] correction: m01-ib0 should be m02-ib0 for node02. --- xCAT-test/autotest/testcase/makehosts/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index d64a42f3e..6740d6bb9 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -38,7 +38,7 @@ check:output=~m01-ib0 check:rc==0 check:output=~node02 check:rc==0 -check:output=~m01-ib0 +check:output=~m02-ib0 check:rc==0 check:output=~10.0.0.22 check:rc==0 From 598a75fb8643394a07f6ff143e6b7e3a12d41d76 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 12 May 2020 13:17:48 +0200 Subject: [PATCH 078/102] Properly reset nic extra params The global variables were not reset for bonds. Therefore, the nic extra params from the first bond interface were used if the second one had no nic extra params. --- xCAT/postscripts/nicutils.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index b4c6a6b6d..d142cc663 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -289,6 +289,10 @@ function load_kmod { # ################################################################# function query_extra_params { + # reset global variables + unset array_nic_params + unset array_extra_param_names + unset array_extra_param_values nic=$1 if [ -z "$nic" ]; then @@ -479,9 +483,6 @@ function create_persistent_ifcfg { local _netmask="" local _mtu="" local inattrs="" - unset array_nic_params - unset array_extra_param_names - unset array_extra_param_values # parser input arguments while [ -n "$1" ]; From 097bf969d418c5e6bdf9e2bf412ad9dfac6cc0e8 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 12 May 2020 13:22:06 +0200 Subject: [PATCH 079/102] Configure bond IP even if there is a $next_nic but also $_ipaddr Check for $_ipaddr instead of $next_nic. The followint configuration is totally valid but fails with the old logic because it does not configure any bond0 IP because $next_nic is set to bond0.10. nictypes.eno1=Ethernet nictypes.eno2=Ethernet nicdevices.bond0=eno1|eno2 nictypes.bond0=bond nicnetworks.bond0=management nicips.bond0=192.168.0.1 nicdevices.bond0.10=bond0 nictypes.bond0.10=vlan nicnetworks.bond0.10=production nicips.bond0.10=192.168.1.1 May needs some additional testing with bridges etc. --- xCAT/postscripts/nicutils.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index d142cc663..f00407d02 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -2135,7 +2135,7 @@ function create_bond_interface_nmcli { else _bonding_opts="mode=active-backup" fi - if [ -z "$next_nic" ]; then + if [ -n "$_ipaddr" ]; then # query "nicnetworks" table about its target "xcatnet" xcatnet=$(query_nicnetworks_net $bondname) log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$bondname\"." @@ -2198,7 +2198,7 @@ function create_bond_interface_nmcli { # create raw bond device log_info "create bond connection $xcat_con_name" cmd="" - if [ -n "$next_nic" ]; then + if [ -z "$_ipaddr" ]; then cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts ipv4.method disabled ipv6.method ignore autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" else cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" @@ -2286,7 +2286,7 @@ function create_bond_interface_nmcli { # bring up interface formally log_info "$nmcli con up $xcat_con_name" $nmcli con up $xcat_con_name - if [ -z "$next_nic" ]; then + if [ -n "$_ipaddr" ]; then is_connection_activate_intime $xcat_con_name is_active=$? if [ "$is_active" -eq 0 ]; then From a274097b341b09d8356762317bace48e1f2024ae Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 12 May 2020 13:41:45 +0200 Subject: [PATCH 080/102] Do not set MTU for InfiniBand slaves Slaves should have no MTU set. This should be set globally on the bond interface. Furthermore, RHEL 8.0 does not correctly set the given MTU as shown below. This breaks any IB bonds with non-default (2044) MTU. $ # IB slave with 4092 MTU $ nmcli con add type Infiniband con-name slave-ib1-mtu mtu 4092 ifname ib1 master ibbond0 slave-type bond $ # IB slave without MTU $ nmcli con add type Infiniband con-name slave-ib1-wo-mtu ifname ib1 master ibbond0 slave-type bond $ # should be 4092, but is 2044 instead $ nmcli -f infiniband.mtu con show slave-ib1-mtu infiniband.mtu: 2044 $ grep MTU /etc/sysconfig/network-scripts/ifcfg-slave-ib1-* /etc/sysconfig/network-scripts/ifcfg-slave-ib1-mtu:MTU=2044 $ # is auto :) $ nmcli -f infiniband.mtu con show slave-ib1-wo-mtu infiniband.mtu: auto --- xCAT/postscripts/nicutils.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index f00407d02..780b1da7b 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -2246,6 +2246,10 @@ function create_bond_interface_nmcli { $ip link set dev $ifslave down wait_for_ifstate $ifslave DOWN 20 2 fi + # InfiniBand slaves should have no MTU defined, only the bond interface + if [ "$slave_type" = "Infiniband" ]; then + _mtu="" + fi cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu ifname $ifslave master $xcat_con_name slave-type bond autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-retries 0" log_info $cmd $cmd From 738b147bdf05d67219bb749315e7aa4ac0d64ab7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 12 May 2020 12:02:22 -0400 Subject: [PATCH 081/102] Speedup execution of go-xcat testcases --- xCAT-test/autotest/testcase/go_xcat/case3 | 28 ++++++++++------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 7a080c28c..da64c9fe6 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -2,11 +2,10 @@ start:go_xcat_devel_from_repo description:test go-xcat devel on a newly provisioned node label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it if not on Ubuntu -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 @@ -47,11 +46,10 @@ start:go_xcat_stable_from_repo description:test go-xcat GA on a newly provisioned node label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it if not on Ubuntu -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 @@ -92,11 +90,10 @@ start:go_xcat_stable_from_repo_upgrade description:test go-xcat GA on a newly provisioned node upgrade to devel label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it if not on Ubuntu -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 @@ -147,11 +144,10 @@ start:go_xcat_stable_from_repo_reinstall_devel description:test go-xcat GA on a newly provisioned node, remove, install devel label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; echo "Service node was off, powering on, waiting for 5 min"; sleep 300; fi -#Service not did not boot after 5 min, reprovision it if not on Ubuntu -cmd:if lsdef $$SN -i status -c | grep -v "booted"; then if grep Ubuntu /etc/*release; then echo "Will not attempt to reprovision service node on Ubuntu"; else echo "Service node did not power on, trying to reprovision"; /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service 2; fi; fi +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 From f52480f70e0413e205605ec505d249e51fbb17d8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 12 May 2020 14:58:49 -0400 Subject: [PATCH 082/102] Remove doc file no longer referenced --- docs/source/QA/makehosts_qa.rst | 132 -------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 docs/source/QA/makehosts_qa.rst diff --git a/docs/source/QA/makehosts_qa.rst b/docs/source/QA/makehosts_qa.rst deleted file mode 100644 index 375c4c75b..000000000 --- a/docs/source/QA/makehosts_qa.rst +++ /dev/null @@ -1,132 +0,0 @@ -DNS,hostname and alias Q/A list -------------------------------- - -Q: When there are multiple NICs, how to generate ``/etc/hosts`` records? -```````````````````````````````````````````````````````````````````````` - -When there are multiple NICs, and you want to use ``confignetwork`` to configure these NICs, suggest to use ``hosts`` table to configure installnic and use ``nics`` table to configure secondary NICs. You can refer to the following best practice example to generate ``/etc/hosts`` records. - -**Best practice example**: - - * There are 2 networks in different domains: ``mgtnetwork`` and ``pubnetwork`` - * ``mgtnetwork`` is xCAT management network - * There are 2 adapters in system node1: ``eth0`` and ``eth1`` - * Add installnic ``eth0`` ``10.5.106.101`` record in ``/etc/hosts``, its alias is ``mgtnic`` - * hostnames ``node1-pub`` and ``node1.public.com`` are for nic ``eth1``, ip is ``192.168.30.101`` - -**Steps**: - - #. Add networks entry in ``networks`` table: :: - - chdef -t network mgtnetwork net=10.0.0.0 mask=255.0.0.0 domain=cluster.com - chdef -t network pubnetwork net=192.168.30.0 mask=255.255.255.0 domain=public.com - - #. Create ``node1`` with installnic ip ``10.5.106.101``, its alias is ``mgtnic``: :: - - chdef node1 ip=10.5.106.101 hostnames=mgtnic groups=all - - #. Configure ``eth1`` in ``nics`` table: :: - - chdef node1 nicips.eth1=192.168.30.101 nichostnamesuffixes.eth1=-pub nicaliases.eth1=node1.public.com nictypes.eth1=Ethernet nicnetworks.eth1=pubnetwork - - #. Check ``node1`` definition: :: - - lsdef node1 - Object name: node1 - groups=all - ip=10.5.106.101 - hostnames=mgtnic - nicaliases.eth1=node1.public.com - nichostnamesuffixes.eth1=-pub - nicips.eth1=192.168.30.101 - nicnetworks.eth1=pubnetwork - nictypes.eth1=Ethernet - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - - #. Execute ``makehosts -n`` to generate ``/etc/hosts`` records: :: - - makehosts -n - - #. Check results in ``/etc/hosts``: :: - - 10.5.106.101 node1 node1.cluster.com mgtnic - 192.168.30.101 node1-pub node1.public.com - - #. Edit ``/etc/resolv.conf``, xCAT management node ip like ``10.5.106.2`` is nameserver: :: - - search cluster.com public.com - nameserver 10.5.106.2 - - #. Execute ``makedns -n`` to configure DNS - -Q: How to configure aliases? -```````````````````````````` - -There are 3 methods to configure aliases: - -#. Use ``hostnames`` in ``hosts`` table to configure aliases for the installnic. -#. If you want to use script ``confignetwork`` to configure secondary NICs, suggest to use ``aliases`` in ``nics`` table to configure aliases, you can refer to :doc:`Configure Aliases <../guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_aliases>` -#. If you want to generate aliases records in ``/etc/hosts`` for secondary NICs, and don't want to use script ``confignetwork`` to configure these NICs, suggest to use ``otherinterfaces`` in ``hosts`` table to configure aliases. You can refer to following example: - - * If you want to add ``node1-hd`` ``20.1.1.1`` in ``hosts`` table, and don't use ``confignetwork`` to configure it, you can add ``otherinterfaces`` like this: :: - - chdef node1 otherinterfaces="node1-hd:20.1.1.1" - - * After executing ``makehosts -n``, you can get records in ``/etc/hosts`` like following: :: - - 20.1.1.1 node1-hd - -**Note**: If suffixes or aliases for the same IP are configured in both ``hosts`` table and ``nics`` table, will cause conflicts. ``makehosts`` will use values from ``nics`` table. The values from ``nics`` table will over-write that from ``hosts`` table to create ``/etc/hosts`` records. - -Q: How to handle the same short hostname in different domains? -`````````````````````````````````````````````````````````````` - -You can follow the best practice example. - -**Best practice example**: - - * There are 2 networks in different domains: ``mgtnetwork`` and ``pubnetwork`` - * ``mgtnetwork`` is xCAT management network - * Generate 2 records with the same hostname in ``/etc/hosts``, like: :: - - 10.5.106.101 node1.cluster.com - 192.168.20.101 node1.public.com - - * Nameserver is xCAT management node IP - -**Steps**: - - #. Add networks entry in ``networks`` table: :: - - chdef -t network mgtnetwork net=10.0.0.0 mask=255.0.0.0 domain=cluster.com - chdef -t network pubnetwork net=192.168.30.0 mask=255.255.255.0 domain=public.com - - #. Create ``node1`` with ``ip=10.5.106.101``, xCAT can manage and install this node: :: - - chdef node1 ip=10.5.106.101 groups=all - - #. Create ``node1-pub`` with ``ip=192.168.30.101``, this node is only used to generate ``/etc/hosts`` records for public network, can use ``_unmanaged`` group name to label it: :: - - chdef node1-pub ip=192.168.30.101 hostnames=node1.public.com groups=_unmanaged - - #. Execute ``makehosts -n`` to generate ``/etc/hosts`` records: :: - - makehosts -n - - #. Check results in ``/etc/hosts``: :: - - 10.5.106.101 node1 node1.cluster.com - 192.168.30.101 node1-pub node1.public.com - - #. Edit ``/etc/resolv.conf``, for example, xCAT management node IP is 10.5.106.2 : :: - - search cluster.com public.com - nameserver 10.5.106.2 - - #. Execute ``makedns -n`` to configure DNS - -Q: When to use ``hosts`` table and ``nics`` table? -`````````````````````````````````````````````````` - -``hosts`` table is used to store IP addresses and hostnames of nodes. ``makehosts`` use these data to create ``/etc/hosts`` records. ``nics`` table is used to stores secondary NICs details. Some scripts like ``confignetwork`` use data from ``nics`` table to configure secondary NICs. ``makehosts`` also use these data to create ``/etc/hosts`` records for each NIC. From da7746643f6447c2e6261cdd9f85ec51a6dffb0c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 12 May 2020 16:33:00 -0400 Subject: [PATCH 083/102] Clarify Network Interface doc --- .../network/cfg_network_ethernet_nic.rst | 14 +++++++------- .../network/cfg_network_adapter.rst | 3 +-- .../network/cfg_network_adapter.rst | 3 +-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst index cea71e849..28e141bcd 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst @@ -5,9 +5,9 @@ The following example sets the xCAT properties for compute node ``cn1`` to creat * Compute node ``cn1`` with two physical NICs: ``eth0`` and ``eth1`` * Management network is ``11.1.89.0``, application network is ``13.1.89.0`` - * The install NIC is eth0, and application NIC is eth1 - * Assign static ip ``11.1.89.7/24`` to eth0 - * Assign static ip ``13.1.89.7/24`` to eth1 + * The install NIC is ``eth0``, and application NIC is ``eth1`` + * Assign static ip ``11.1.89.7/24`` to ``eth0`` + * Assign static ip ``13.1.89.7/24`` to ``eth1`` Add/update networks into the xCAT DB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -22,11 +22,11 @@ Add/update additional networks ``net11`` and ``net13`` into ``networks`` table:: Define Adapters in the nics table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#. Provision ip is coming from DHCP, there is no need to configure install nic into ``nics`` table. Provision ip can be configured in node definition, but it is not required. :: +#. The install NIC ``eth0`` on the management network will get an IP via DHCP, which will be the value of the ``ip`` attribute in the node definition. There is no need to configure install NIC into ``nics`` table. :: chdef cn1 ip=11.1.89.7 -#. Data NIC ``eth1`` is not install NIC, configure ``eth1`` into ``nics`` table :: +#. Application NIC ``eth1`` on the application network is different from install NIC ``eth0``, and will get its IP assigned from the ``eth1`` definition in the ``nics`` table :: chdef cn1 nicips.eth1="13.1.89.7" nicnetworks.eth1="net13" nictypes.eth1="Ethernet" nichostnamesuffixes.eth1=-eth1 @@ -56,7 +56,7 @@ Configure adapters with static IPs updatenode cn1 -P "confignetwork -s" -#. If install NIC is not configured in ``nics`` table, and only configure all other NIC's data defined in ``nics`` table, execute ``confignetwork`` without ``-s`` +#. If install NIC is not configured in ``nics`` table, execute ``confignetwork`` without ``-s`` to only configure NICs defined in ``nics`` table a. Add ``confignetwork`` into postscript list to execute on reboot :: @@ -66,7 +66,7 @@ Configure adapters with static IPs updatenode cn1 -P "confignetwork" -.. note:: Option ``-s`` writes the install NIC's information into configuration file for persistence. All other NIC's data defined in ``nics`` table will be written also. Without option ``-s``, ``confignetwork`` only configures all NIC's data defined in ``nics`` table. +.. note:: Option ``-s`` writes the install NIC's information into configuration file for persistence. All other NIC's data defined in ``nics`` table will be written also. Without option ``-s``, ``confignetwork`` only configures NIC's data defined in ``nics`` table. Check result ~~~~~~~~~~~~ diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst index 57d206514..1e4f71ff2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst @@ -13,10 +13,9 @@ If configuring VLAN, BOND, or BRIDGES, ``nicdevices`` in ``nics`` table must be The following scenarios are examples to configure Ethernet adapters/BOND/VLAN/Bridge. - #. Configure Ethernet adapters: + #. Configure static install or application Ethernet adapters: * Scenario 1: :doc:`Configure Ethernet Network Interface <../../../../common/deployment/network/cfg_network_ethernet_nic>` - To configure Ethernet install NIC or other Ethernet network adapters as static #. Configure BOND **[RHEL]**: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst index 57d206514..1e4f71ff2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst @@ -13,10 +13,9 @@ If configuring VLAN, BOND, or BRIDGES, ``nicdevices`` in ``nics`` table must be The following scenarios are examples to configure Ethernet adapters/BOND/VLAN/Bridge. - #. Configure Ethernet adapters: + #. Configure static install or application Ethernet adapters: * Scenario 1: :doc:`Configure Ethernet Network Interface <../../../../common/deployment/network/cfg_network_ethernet_nic>` - To configure Ethernet install NIC or other Ethernet network adapters as static #. Configure BOND **[RHEL]**: From 1065d64c7046ee3474f175113aec1b2cb541b013 Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Thu, 14 May 2020 11:48:46 -0700 Subject: [PATCH 084/102] DSHCLI.pm: Skip noderange-specific syncfiles during local copy --- perl-xCAT/xCAT/DSHCLI.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index bbf811e93..d4a59edda 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -4996,6 +4996,11 @@ sub rsync_to_image next; } + if ($line =~ /.+ -> \(.+\) .+/) # skip syncfile entries containing noderange + { + next; + } + $line=xCAT::Utils->varsubinline($line,\%osimgenv); # process no more lines, do not exec From 97824433b4f21962592a2d67b3e9a68f5f9ece22 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 15 May 2020 10:33:00 -0400 Subject: [PATCH 085/102] Remove quoted XCATSERVER from xcatinfo --- xCAT/postscripts/xcatdsklspost | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3440250cd..98abeff80 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -429,8 +429,8 @@ if [ "$MODE" = "4" ]; then # for statelite mode done if [ -f /opt/xcat/xcatinfo ]; then - SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2` - HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2` + SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` + HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` if [ -n "$SIP" ]; then download_postscripts $SIP:${HTTPPORT} if [ $? -eq 0 ]; then @@ -498,8 +498,8 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) # if not updatenode, then look in xcatinfo for the xcatmaster if [ -f /opt/xcat/xcatinfo ]; then - SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2` - HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2` + SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` + HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` [ -z "$HTTPPORT" ] && HTTPPORT="80" if [ -n "$SIP" ]; then download_postscripts ${SIP}:${HTTPPORT} From b912917911af3b22559e7859da325ac5c316ea77 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 15 May 2020 14:44:02 -0400 Subject: [PATCH 086/102] Add option to bmcdiscover command to change default BMC password --- .../references/man1/bmcdiscover.1.rst | 18 +++++- xCAT-client/pods/man1/bmcdiscover.1.pod | 12 +++- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 58 ++++++++++++++----- .../share/xcat/scripts/BMC_change_password.sh | 13 +++-- 4 files changed, 77 insertions(+), 24 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index dd303e369..3c0b7a7c8 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -23,7 +23,7 @@ SYNOPSIS \ **bmcdiscover**\ [\ **-v | -**\ **-version**\ ] -\ **bmcdiscover**\ \ **-**\ **-range**\ \ *ip_ranges*\ [\ **-**\ **-sn**\ \ *SN_nodename*\ ] [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] +\ **bmcdiscover**\ \ **-**\ **-range**\ \ *ip_ranges*\ [\ **-**\ **-sn**\ \ *SN_nodename*\ ] [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-n**\ \ *new_bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] *********** @@ -37,7 +37,7 @@ The command uses \ **nmap**\ to scan active nodes over a specified IP range. T \ **Note:**\ The scan method currently supported is \ **nmap**\ . -\ **Note:**\ Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. \ **bmcdiscover**\ will not be able to discover such systems. Run \ */opt/xcat/share/xcat/scripts/BMC_change_password.sh*\ script to change the default password for BMCs in specified range, then rerun \ **bmcdiscover**\ with \ **-p "new bmc password"**\ flag to discover systems with the changed password. +\ **Note:**\ Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. Use \ **bmcdiscover**\ with \ **-n**\ option to specify new BMC password. ******* @@ -88,6 +88,12 @@ OPTIONS +\ **-n|-**\ **-newbmcpw**\ + + New BMC user password. + + + \ **-h|-**\ **-help**\ Display usage message @@ -165,6 +171,14 @@ Output is similar to: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z +5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanze format: + + +.. code-block:: perl + + bmcdiscover --range "10.4.22-23.100" -u root -p 0penBmc -n 0penBmc123 -z + + ******** SEE ALSO diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 6523a77ab..27f4219d5 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -8,7 +8,7 @@ B [B<-?>|B<-h>|B<--help>] B [B<-v>|B<--version>] -B B<--range> I [B<--sn> I] [B<-s> I] [B<-u> I] [B<-p> I] [B<-z>] [B<-w>] +B B<--range> I [B<--sn> I] [B<-s> I] [B<-u> I] [B<-p> I] [B<-n> I] [B<-z>] [B<-w>] =head1 DESCRIPTION @@ -20,7 +20,7 @@ The command uses B to scan active nodes over a specified IP range. The IP B The scan method currently supported is B. -B Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. B will not be able to discover such systems. Run I script to change the default password for BMCs in specified range, then rerun B with B<-p "new bmc password"> flag to discover systems with the changed password. +B Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. Use B with B<-n> option to specify new BMC password. =head1 OPTIONS @@ -54,6 +54,10 @@ BMC user name. BMC user password. +=item B<-n|--newbmcpw> + +New BMC user password. + =item B<-h|--help> Display usage message @@ -102,6 +106,10 @@ Output is similar to: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z +5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanze format: + + bmcdiscover --range "10.4.22-23.100" -u root -p 0penBmc -n 0penBmc123 -z + =head1 SEE ALSO L diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index e69b42ad1..090e287c8 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -49,14 +49,14 @@ my $bmc_pass; my $openbmc_user; my $openbmc_pass; my $done_num = 0; -$::P9_WITHERSPOON_MFG_ID = "42817"; -$::P9_WITHERSPOON_PRODUCT_ID = "16975"; -$::P9_MIHAWK_MFG_ID = "42817"; -$::P9_MIHAWK_PRODUCT_ID = "1"; +$::P9_AC922_MFG_ID = "42817"; #Witherspoon +$::P9_AC922_PRODUCT_ID = "16975"; +$::P9_IC922_MFG_ID = "42817"; #Mihawk +$::P9_IC922_PRODUCT_ID = "1"; $::CHANGE_PW_REQUIRED="The password provided for this account must be changed before access is granted"; $::NO_SESSION="Unable to establish IPMI v2 / RMCP"; -$::CHANGE_PW_INSTRUCTIONS_1="Run script '/opt/xcat/share/xcat/scripts/BMC_change_password.sh' to change default password"; -$::CHANGE_PW_INSTRUCTIONS_2="Rerun 'bmcdiscover' command with '-p new_bmc_password' flag"; +$::CHANGE_PW_INSTRUCTIONS_1="Rerun 'bmcdiscover' command with '-p default_bmc_password -n new_bmc_password' flag"; +$::PW_PAM_VALIDATION="password value failed PAM validation checks"; $::NO_MFG_OR_PRODUCT_ID="Zeros returned for Manufacturer id and Product id"; %::VPDHASH = (); my %node_in_list = (); @@ -203,7 +203,7 @@ sub bmcdiscovery_usage { push @{ $rsp->{data} }, "Usage:"; push @{ $rsp->{data} }, "\tbmcdiscover [-?|-h|--help]"; push @{ $rsp->{data} }, "\tbmcdiscover [-v|--version]"; - push @{ $rsp->{data} }, "\tbmcdiscover --range ip_range [--sn ] [-s ] [-u ] [-p ] [-z] [-w]\n"; + push @{ $rsp->{data} }, "\tbmcdiscover --range ip_range [--sn ] [-s ] [-u ] [-p ] [-n ] [-z] [-w]\n"; xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); return 0; @@ -248,6 +248,7 @@ sub bmcdiscovery_processargs { 'check' => \$::opt_C, 'bmcuser|u=s' => \$::opt_U, 'bmcpasswd|p=s' => \$::opt_P, + 'newbmcpw|n=s' => \$::opt_N, 'ipsource' => \$::opt_S, 'version|v' => \$::opt_v, 't' => \$::opt_T, @@ -749,6 +750,7 @@ sub scan_process { # Set child process default, if not the function runcmd may return error $SIG{CHLD} = 'DEFAULT'; +TRY_TO_DISCOVER: my $bmcusername; my $bmcpassword; $bmcusername = "-U $bmc_user" if ($bmc_user); @@ -767,8 +769,8 @@ sub scan_process { } if ($mc_info =~ /Manufacturer ID\s*:\s*(\d+)\s*Manufacturer Name.+\s*Product ID\s*:\s*(\d+)/) { xCAT::MsgUtils->trace(0, "D", "$log_label Found ${$live_ip}[$i] Manufacturer ID: $1 Product ID: $2"); - if (($1 eq $::P9_WITHERSPOON_MFG_ID and $2 eq $::P9_WITHERSPOON_PRODUCT_ID) or - ($1 eq $::P9_MIHAWK_MFG_ID and $2 eq $::P9_MIHAWK_PRODUCT_ID)) { + if (($1 eq $::P9_AC922_MFG_ID and $2 eq $::P9_AC922_PRODUCT_ID) or + ($1 eq $::P9_IC922_MFG_ID and $2 eq $::P9_IC922_PRODUCT_ID)) { bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command,$parent_fd,$2); $is_openbmc = 1; $is_ipmi = 0; @@ -781,8 +783,8 @@ sub scan_process { } else { # System replied to mc info but not with either - # $::P9_WITHERSPOON_MFG_ID and $::P9_WITHERSPOON_PRODUCT_ID, or - # $::P9_MIHAWK_MFG_ID and $::P9_MIHAWK_PRODUCT_ID, + # $::P9_AC922_MFG_ID and $::P9_AC922_PRODUCT_ID, or + # $::P9_IC922_MFG_ID and $::P9_IC922_PRODUCT_ID, # assume IPMI $is_openbmc = 0; $is_ipmi = 1; @@ -804,10 +806,32 @@ sub scan_process { my $redfish_session_cmd = "curl -sD - --data '{\"UserName\":\"$openbmc_user\",\"Password\":\"$openbmc_pass\"}' -k -X POST https://${$live_ip}[$i]/redfish/v1/SessionService/Sessions"; my $redfish_session_info = xCAT::Utils->runcmd($redfish_session_cmd, -1); if ($redfish_session_info =~ /$::CHANGE_PW_REQUIRED/) { - # RedFish session replied that password change is needed. Print instructions and exit + # RedFish session replied that password change is needed. xCAT::MsgUtils->message("I", { data => ["${$live_ip}[$i]: $::CHANGE_PW_REQUIRED"] }, $::CALLBACK); - xCAT::MsgUtils->message("I", { data => ["$::CHANGE_PW_INSTRUCTIONS_1"] }, $::CALLBACK); - xCAT::MsgUtils->message("I", { data => ["$::CHANGE_PW_INSTRUCTIONS_2"] }, $::CALLBACK); + if ($::opt_N) { + # New password was passed in, use it to change the default (AC922 or IC922) + my $password_change_cmd = "curl -s -u $openbmc_user:$openbmc_pass --data '{\"Password\":\"$::opt_N\"}' -k -X PATCH https://${$live_ip}[$i]/redfish/v1/AccountService/Accounts/$openbmc_user"; + my $password_changed = xCAT::Utils->runcmd($password_change_cmd, -1); + if (! $password_changed) { + # No output from change password command, assume success + xCAT::MsgUtils->message("I", { data => ["${$live_ip}[$i]: Password changed."] }, $::CALLBACK); + $openbmc_pass = $::opt_N; # Set new password + $bmc_pass = $::opt_N; # Set new password + goto TRY_TO_DISCOVER; # Attempt discover with changed password + } + elsif ($password_changed =~ /$::PW_PAM_VALIDATION/) { + # Output from change password command indicates pw validation error + xCAT::MsgUtils->message("I", { data => ["Can not change password - $::PW_PAM_VALIDATION"] }, $::CALLBACK); + } + else { + # Some unexpected output changing the password - report error and show output + xCAT::MsgUtils->message("I", { data => ["Unable to change password - $password_changed"] }, $::CALLBACK); + } + } + else { + # New password was not passed in, print instruction message and exit + xCAT::MsgUtils->message("I", { data => ["$::CHANGE_PW_INSTRUCTIONS_1"] }, $::CALLBACK); + } } } } @@ -1357,7 +1381,11 @@ sub bmcdiscovery_openbmc{ $node_data .= ",$serial"; if ($::opt_P) { if ($::opt_U) { - $node_data .= ",$::opt_U,$::opt_P"; + if ($::opt_N) { + $node_data .= ",$::opt_U,$::opt_N"; # Display the new changed password + } else { + $node_data .= ",$::opt_U,$::opt_P"; + } } else { $node_data .= ",,$::opt_P"; } diff --git a/xCAT-server/share/xcat/scripts/BMC_change_password.sh b/xCAT-server/share/xcat/scripts/BMC_change_password.sh index 54f01c855..ed9c18cd5 100755 --- a/xCAT-server/share/xcat/scripts/BMC_change_password.sh +++ b/xCAT-server/share/xcat/scripts/BMC_change_password.sh @@ -22,6 +22,9 @@ if [ $# -le 3 ]; then Change the default root or ADMIN password of the BMC to the one specified by '-n' flag. Use the same password when discovering new BMCs, by passing it with '[-p|--bmcpasswd]' option to 'bmcdiscover' command. + +Note: Starting with xCAT 2.16, the changing of default BMC passwords +can also be done with '-n' option for 'bmcdiscover' command. " echo "Usage:" echo " $0 -r -n " @@ -63,8 +66,8 @@ UNAUTHORIZED="Unauthorized" for name in `cat /tmp/$$.ip.list` do - ## Look for Witherspoon first - SYSTEM_TYPE="Witherspoon" + ## Look for OpenBMC (Witherspoon or Mihawk) first + SYSTEM_TYPE="OpenBMC" PasswordChangeNeeded=`curl -sD - --data '{"UserName":"'"$WITHERSPOON_DEFAULT_USER"'","Password":"'"$WITHERSPOON_DEFAULT_PW"'"}' -k -X POST https://$name/redfish/v1/SessionService/Sessions` if [[ "$PasswordChangeNeeded" =~ "$CHANGE_PW_REQUIRED" ]]; then @@ -74,7 +77,7 @@ do echo "$name: Can not change password for $SYSTEM_TYPE system - $PW_PAM_VALIDATION" elif [[ -z "$PasswordChanged" ]]; then # If no output, password change was successful - echo "$name: Password for $SYSTEM_TYPE system changed. It might take up to 5 minutes for the BMC to update." + echo "$name: Password for $SYSTEM_TYPE system changed." else # Some unexpected output changing the password - report error and show output echo "$name: Unable to change password for $SYSTEM_TYPE system - $PasswordChanged" @@ -83,8 +86,8 @@ do continue fi - ## Look for Boston next - SYSTEM_TYPE="Boston" + ## Look for IPMI managed (Boston) next + SYSTEM_TYPE="IPMI" PasswordChangeNeeded=`curl -sD - --data '{"UserName":"'"$BOSTON_DEFAULT_USER"'","Password":"'"$BOSTON_DEFAULT_PW"'"}' -k -X POST https://$name/redfish/v1/SessionService/Sessions` if [[ "$PasswordChangeNeeded" =~ "$CHANGE_PW_REQUIRED" ]]; then echo "$name: Password change needed for $SYSTEM_TYPE system" From 362c61fa35ad6e206bb13582f8ad74bb4fe48c33 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 19 May 2020 10:37:53 -0400 Subject: [PATCH 087/102] Improve verification of kdump testcase --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 515ff35af..3b55e4a68 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -89,8 +89,8 @@ cmd:a=`xdsh $$CN rpm -q at`;if [[ $a =~ "package at is not installed" ]]; then x cmd:xdsh $$CN "service atd start" check:rc==0 -# Verify that kdump directory from management node is still mounted on the compute node -cmd:xdsh $$CN df -H +# Verify that kdump has been configured after enablekdump postscript was ran +cmd:xdsh $$CN cat /etc/kdump.conf check:output=~/opt/xcat/share/xcat/tools/autotest/kdumpdir # Verify kdump parameters are in /proc/cmdline file From 8394f0e1ee1726be30fae7a9ab5e258502db6cd8 Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 20 May 2020 14:41:32 -0400 Subject: [PATCH 088/102] replace extra nic param instead of append --- xCAT/postscripts/configeth | 200 +++++++++++++++++++++++-------------- xCAT/postscripts/configib | 35 ++++++- 2 files changed, 154 insertions(+), 81 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 426270944..76f1ce2a2 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -68,16 +68,21 @@ function configipv4(){ if [ "$str_nic_mtu" != "$str_default_token" ]; then echo "MTU=${str_nic_mtu}" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done else echo "IPADDR_${num_v4num}=${str_v4ip}" >> $str_conf_file echo "NETMASK_${num_v4num}=${str_v4mask}" >> $str_conf_file @@ -86,16 +91,21 @@ function configipv4(){ if [ "$str_nic_mtu" != "$str_default_token" ]; then echo "MTU_${num_v4num}=${str_nic_mtu}" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done fi if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then @@ -117,16 +127,21 @@ function configipv4(){ if [ "$str_nic_mtu" != "$str_default_token" ]; then echo " mtu ${str_nic_mtu}" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo " ${name} ${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" $str_conf_file + else + echo "${name} ${value}" >> $str_conf_file + fi + i=$((i+1)) + done if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then parent_device=`echo ${str_if_name} | sed -e 's/\([a-zA-Z0-9]*\)\.[0-9]*/\1/g'` echo " vlan-raw-device ${parent_device}" >> $str_conf_file @@ -198,7 +213,12 @@ function configipv4(){ do name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" - echo "${name}=${value}" >> $str_conf_file + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi i=$((i+1)) done fi @@ -244,15 +264,20 @@ configipv6(){ fi #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done elif [ "$str_os_type" = "debian" ];then #debian or ubuntu str_conf_file="/etc/network/interfaces.d/${str_if_name}" @@ -269,15 +294,20 @@ configipv6(){ fi #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" - echo " $i: name=$name value=$value" - echo " ${name} ${value}" >> $str_conf_file - i=$((i+1)) - done + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + echo " $i: name=$name value=$value" + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" $str_conf_file + else + echo "${name} ${value}" >> $str_conf_file + fi + i=$((i+1)) + done else echo " post-up /sbin/ifconfig ${str_if_name} inet6 add ${str_v6ip}/${str_v6prefix}" >> $str_conf_file echo " pre-down /sbin/ifconfig ${str_if_name} inet6 del ${str_v6ip}/${str_v6prefix}" >> $str_conf_file @@ -302,15 +332,20 @@ configipv6(){ fi #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done fi } @@ -610,17 +645,21 @@ elif [ "$1" = "-s" ];then if [ -n "$str_inst_gateway" ];then echo " gateway $str_inst_gateway" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo " ${name} ${value}" >> $str_conf_file - i=$((i+1)) - done - + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" $str_conf_file + else + echo "${name} ${value}" >> $str_conf_file + fi + i=$((i+1)) + done hostname $NODE echo $NODE > /etc/hostname elif [ "$str_os_type" = "sles" ];then @@ -643,18 +682,21 @@ elif [ "$1" = "-s" ];then fi fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done - - + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done hostname $NODE echo $NODE > /etc/HOSTNAME else @@ -672,11 +714,12 @@ elif [ "$1" = "-s" ];then nmcli con modify $con_name connection.id $tmp_con_name fi nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 - str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_inst_nic}-1" if [ -f $str_conf_file_1 ]; then grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null if [ $? -eq 0 ]; then $str_conf_file=$str_conf_file_1 + #mv -f $str_conf_file_1 $str_conf_file fi fi else @@ -713,7 +756,12 @@ elif [ "$1" = "-s" ];then name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo "$i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi i=$((i+1)) done diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index bcddc25e7..6f287732f 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -439,7 +439,12 @@ IPADDR=$nicip" > $dir/ifcfg-$nic name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic + grep -i "${name}" $dir/ifcfg-$nic + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic + else + echo "${name}=${value}" >> $dir/ifcfg-$nic + fi i=$((i+1)) done else # not the first ip address @@ -466,7 +471,12 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic + grep -i "${name}" $dir/ifcfg-$nic + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic + else + echo "${name}=${value}" >> $dir/ifcfg-$nic + fi i=$((i+1)) done fi # end if [ $ipindex -eq 1 ] @@ -517,7 +527,12 @@ IPADDR=$nicip" > $dir/ifcfg-$nic name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic + grep -i "${name}" $dir/ifcfg-$nic + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic + else + echo "${name}=${value}" >> $dir/ifcfg-$nic + fi i=$((i+1)) done else # not the first ip address @@ -577,7 +592,12 @@ IPADDR$ipindex=$nicip" name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $cfgfile + grep -i "${name}" $cfgfile + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $cfgfile + else + echo "${name}=${value}" >> $cfgfile + fi i=$((i+1)) done @@ -644,7 +664,12 @@ netmask $netmask" >> /etc/network/interfaces name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name} ${value}" >> /etc/network/interfaces + grep -i "${name}" /etc/network/interfaces + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" >> /etc/network/interfaces + else + echo "${name} ${value}" >> /etc/network/interfaces + fi i=$((i+1)) done From e6f84d22816cf5ad42109f1b06e73484cc60d06f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 27 May 2020 16:55:27 -0400 Subject: [PATCH 089/102] Improve genesistest.pl script --- xCAT-test/autotest/testcase/genesis/genesistest.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 44ab44580..ed886e3fc 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -250,6 +250,7 @@ sub testxdsh { print "The input parameter is $value \n"; my $checkstring; my $checkfile; + my $nodestatus; if ($value == 1) { #mean runcmd test using test scripts genesistest.pl writes $checkstring = "testcmd"; @@ -268,7 +269,8 @@ sub testxdsh { my @i = (1..10); for (@i) { sleep 300; - send_msg(1,"[$_] Running \"$xdsh_command\" to check the results again"); + $nodestatus=`lsdef $noderange -i status -c 2>&1 | awk -F'=' '{print \$2}'`; + send_msg(1,"[$_] Running \"$xdsh_command\" to check results. Node status: $nodestatus"); `$xdsh_command`; last if ($? == 0); } From ac97b8eeb0ab8efb7ccf6f3f961853c730887e16 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 28 May 2020 11:26:58 -0400 Subject: [PATCH 090/102] Update Version --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 07d875c2d..6d28a11dd 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.15.2 +2.16 From 239f883e5fddc6cb2862228cf653599607ee0dac Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 1 Jun 2020 10:13:50 -0400 Subject: [PATCH 091/102] Set UEFI filesystem to fat32 --- .../common/deployment/cfg_partition.rst | 28 +++++++++---------- .../common/deployment/raid_cfg.rst | 18 ++++++------ .../share/xcat/install/scripts/pre.ubuntu | 2 +- .../xcat/install/scripts/pre.ubuntu.ppc64 | 2 +- 4 files changed, 25 insertions(+), 25 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 346f73ce9..bd09ac1d1 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 @@ -36,7 +36,7 @@ The partition file must follow the partitioning syntax of the respective install * 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 + * Use yast2 clone_system to create autoyast configuration file ``/root/autoinst.xml`` to clone an existing system * Ubuntu: `Preseed documentation `_ @@ -376,13 +376,13 @@ To generate the configuration, run the ``nodeset`` command: :: .. BEGIN_Partition_Definition_Script_overview -Create a shell script that will be run on the node during the install process to dynamically create the disk partitioning definition. This script will be run during the OS installer %pre script on RedHat or preseed/early_command on Unbuntu execution and must write the correct partitioning definition into the file /tmp/partitionfile on the node +Create a shell script that will be run on the node during the install process to dynamically create the disk partitioning definition. This script will be run during the OS installer %pre script on RedHat or preseed/early_command on Unbuntu execution and must write the correct partitioning definition into the file ``/tmp/partitionfile`` on the node .. END_Partition_Definition_Script_overview .. BEGIN_Partition_Definition_Script_Create_partition_script_content -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 +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. @@ -429,11 +429,11 @@ Here is an example of the partition script on RedHat and SLES, the partitioning .. BEGIN_Partition_Definition_Script_Create_partition_script_example_ubuntu -The following is an example of the partition script on Ubuntu, the partitioning script is /install/custom/my-partitions.sh: :: +The following is an example of the partition script on Ubuntu, the partitioning script is ``/install/custom/my-partitions.sh``: :: if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitionfile - echo " 512 512 1024 fat16" >> /tmp/partitionfile + echo " 512 512 1024 fat32" >> /tmp/partitionfile echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile else @@ -458,9 +458,9 @@ Run below commands to associate partition script with osimage: :: chdef -t osimage partitionfile='s:/install/custom/my-partitions.sh' nodeset 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. +- 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. .. END_Partition_Definition_Script_Associate_partition_script_with_osimage_common @@ -477,14 +477,14 @@ If not specified, the default value will be used. chdef -t osimage -p partitionfile='d:/install/custom/partitiondisk' nodeset osimage= -- the 'd:' preceding the filename tells nodeset that this is a partition disk file. -- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, it will generate a script to write the content of the partition disk file to /tmp/install_disk, this context to run the script will replace the #XCA_PARTMAN_DISK_SCRIPT# directive in /install/autoinst/.pre. +- the ``d:`` preceding the filename tells nodeset that this is a partition disk file. +- For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will generate a script to write the content of the partition disk file to ``/tmp/install_disk``, this context to run the script will replace the ``#XCA_PARTMAN_DISK_SCRIPT#`` directive in ``/install/autoinst/.pre``. .. END_Partition_Disk_File_ubuntu_only .. BEGIN_Partition_Disk_Script_ubuntu_only -The disk script contains a script to generate a partitioning disk file named "/tmp/install_disk". for example: :: +The disk script contains a script to generate a partitioning disk file named ``/tmp/install_disk``. for example: :: rm /tmp/devs-with-boot 2>/dev/null || true; for d in $(list-devices partition); do @@ -512,8 +512,8 @@ If not specified, the default value will be used. chdef -t osimage -p partitionfile='s:d:/install/custom/partitiondiskscript' nodeset osimage= -- the 's:' prefix tells nodeset that is a script, the 's:d:' preceding the filename tells nodeset that this is a script to generate the partition disk file. -- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, this context to run the script will replace the #XCA_PARTMAN_DISK_SCRIPT# directive in /install/autoinst/.pre. +- the ``s:`` prefix tells ``nodeset`` that is a script, the ``s:d:`` preceding the filename tells ``nodeset`` that this is a script to generate the partition disk file. +- For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, this context to run the script will replace the ``#XCA_PARTMAN_DISK_SCRIPT#`` directive in ``/install/autoinst/.pre``. .. END_Partition_Disk_Script_ubuntu_only @@ -522,7 +522,7 @@ If not specified, the default value will be used. To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed configuration entries should be specified. -If using file way, 'c:', the additional preseed config file contains the additional preseed entries in "d-i ..." syntax. When "nodeset", the #XCA_PARTMAN_ADDITIONAL_CFG# directive in /install/autoinst/ will be replaced with content of the config file. For example: :: +If using file way, ``c:``, the additional preseed config file contains the additional preseed entries in ``d-i ...`` syntax. When ``nodeset``, the ``#XCA_PARTMAN_ADDITIONAL_CFG#`` directive in ``/install/autoinst/`` will be replaced with content of the config file. For example: :: d-i partman-auto/method string raid d-i partman-md/confirm boolean true diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst index 0efa6b9ff..fee02f246 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst @@ -90,7 +90,7 @@ Deploy Diskful Nodes with RAID1 Setup on SLES xCAT provides one sample autoyast template files with the RAID1 settings ``/opt/xcat/share/xcat/install/sles/service.raid1.sles11.tmpl``. You can customize the template file and put it under ``/install/custom/install//`` if the default one does not match your requirements. -Here is the RAID1 partitioning section in service.raid1.sles11.tmpl: :: +Here is the RAID1 partitioning section in ``service.raid1.sles11.tmpl``: :: @@ -188,13 +188,13 @@ The samples above created one 24MB PReP partition on each disk, one 2GB mirrored Since the PReP partition can not be mirrored between the two disks, some additional postinstall commands should be run to make the second disk bootable, here the commands needed to make the second disk bootable: :: # Set the second disk to be bootable for RAID1 setup - parted -s /dev/sdb mkfs 1 fat16 + parted -s /dev/sdb mkfs 1 fat32 parted /dev/sdb set 1 type 6 parted /dev/sdb set 1 boot on dd if=/dev/sda1 of=/dev/sdb1 bootlist -m normal sda sdb -The procedure listed above has been added to the file ``/opt/xcat/share/xcat/install/scripts/post.sles11.raid1`` to make it be automated. The autoyast template file service.raid1.sles11.tmpl will include the content of post.sles11.raid1, so no manual steps are needed here. +The procedure listed above has been added to the file ``/opt/xcat/share/xcat/install/scripts/post.sles11.raid1`` to make it be automated. The autoyast template file ``service.raid1.sles11.tmpl`` will include the content of ``post.sles11.raid1``, so no manual steps are needed here. After the diskful nodes are up and running, you can check the RAID1 settings with the following commands: @@ -230,9 +230,9 @@ The command mdadm can query the detailed configuration for the RAID partitions: Disk Replacement Procedure -------------------------- -If any one disk fails in the RAID1 array, do not panic. Follow the procedure listed below to replace the failed disk and you will be fine. +If any one disk fails in the RAID1 array, do not panic. Follow the procedure listed below to replace the failed disk. -Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: :: +Faulty disks should appear marked with an ``(F)`` if you look at ``/proc/mdstat``: :: # cat /proc/mdstat Personalities : [raid1] @@ -248,7 +248,7 @@ Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: : unused devices: -We can see that the first disk is broken because all the RAID partitions on this disk are marked as (F). +We can see that the first disk is broken because all the RAID partitions on this disk are marked as ``(F)``. Remove the failed disk from RAID array --------------------------------------- @@ -271,7 +271,7 @@ Here is the example of removing failed disk from the RAID1 array in the multipat mdadm --manage /dev/md1 --remove /dev/dm-8 mdadm --manage /dev/md2 --remove /dev/dm-11 -After the failed disk is removed from the RAID1 array, the partitions on the failed disk will be removed from ``/proc/mdstat`` and the "mdadm --detail" output also. :: +After the failed disk is removed from the RAID1 array, the partitions on the failed disk will be removed from ``/proc/mdstat`` and the ``mdadm --detail`` output also. :: # cat /proc/mdstat Personalities : [raid1] @@ -332,7 +332,7 @@ For the multipath configuration, here is an example: :: sfdisk -d /dev/dm-1 | sfdisk /dev/dm-0 -If you got error message "sfdisk: I don't like these partitions - nothing changed.", you can add "--force" option to the sfdisk command: :: +If you got error message "sfdisk: I don't like these partitions - nothing changed.", you can add ``--force`` option to the ``sfdisk`` command: :: sfdisk -d /dev/sdb | sfdisk /dev/sda --force @@ -412,7 +412,7 @@ If the new disk does not have a PReP partition or the PReP partition has some pr * **[SLES]**:: - parted -s /dev/sda mkfs 1 fat16 + parted -s /dev/sda mkfs 1 fat32 parted /dev/sda set 1 type 6 parted /dev/sda set 1 boot on dd if=/dev/sdb1 of=/dev/sda1 diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu b/xCAT-server/share/xcat/install/scripts/pre.ubuntu index 1f8d6a1cf..30db880a5 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu @@ -190,7 +190,7 @@ base64decode() logger -t $log_label -p "info" "Generate partition file..." if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitionfile - echo " 512 512 1024 fat16" >> /tmp/partitionfile + echo " 512 512 1024 fat32" >> /tmp/partitionfile echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile else diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 index 84141c10b..5892a0fbd 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 @@ -203,7 +203,7 @@ base64decode() logger -t $log_label -p "info" "Generate partition file..." if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitionfile - echo " 512 512 1024 fat16" >> /tmp/partitionfile + echo " 512 512 1024 fat32" >> /tmp/partitionfile echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile else From 1c88d50163e709734a82d09b00961d6ec0daa9c5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 1 Jun 2020 14:29:12 -0400 Subject: [PATCH 092/102] Improve genimage message --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index ab53db7f9..32163e784 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -336,6 +336,11 @@ unless ($onlyinitrd) { print "Run cmd [$aptcmd1 $aptcmd2] to create rootimage bootstraps\n"; my $rc = system("$aptcmd1 $aptcmd2"); if ($rc) { + my $os=xCAT::Utils->osver("os"); + if ($os ne 'ubuntu') { + print "Error: Can not run genimage for Ubunty OS on a non-Ubunty system ($os)"; + exit 1; + } print "Error: Can not create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; exit 1; } From 666399a22e4d52688e3c36fd9bcea033cfbaaae1 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 1 Jun 2020 15:11:39 -0400 Subject: [PATCH 093/102] Add namedincludes to site table documentation --- docs/source/guides/admin-guides/references/man5/site.5.rst | 5 +++++ perl-xCAT/xCAT/Schema.pm | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index a8920d5e5..538e4399c 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -173,6 +173,11 @@ site Attributes: the IP maps to your hostname of xCAT MN is not blocked since xCAT needs to use this IP to communicate with the local NDS server on MN. + namedincludes: A comma-separated list of file paths that will be included in + named.conf, using named 'include' statement. This can allow users + to include local configuration options that will not be overwritten + by 'makedns -n' + ------------------------- HARDWARE CONTROL ATTRIBUTES ------------------------- diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index af756d208..670fd0fc9 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1089,6 +1089,10 @@ passed as argument rather than by table value', " NOTE: If using this attribute to block certain interfaces, make sure\n" . " the IP maps to your hostname of xCAT MN is not blocked since xCAT needs\n" . " to use this IP to communicate with the local NDS server on MN.\n\n" . +" namedincludes: A comma-separated list of file paths that will be included in\n" . +" named.conf, using named 'include' statement. This can allow users\n" . +" to include local configuration options that will not be overwritten\n" . +" by 'makedns -n'\n\n" . " -------------------------\n" . "HARDWARE CONTROL ATTRIBUTES\n" . " -------------------------\n" . From b2e4c93c2b9e18b81bae28b91986f4fd67c045a3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 1 Jun 2020 17:39:29 -0400 Subject: [PATCH 094/102] Typo fix --- .../guides/admin-guides/references/man1/bmcdiscover.1.rst | 2 +- xCAT-client/pods/man1/bmcdiscover.1.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index 3c0b7a7c8..7b6c748b1 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -171,7 +171,7 @@ Output is similar to: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z -5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanze format: +5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanza format: .. code-block:: perl diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 27f4219d5..b28e98a8f 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -106,7 +106,7 @@ Output is similar to: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z -5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanze format: +5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanza format: bmcdiscover --range "10.4.22-23.100" -u root -p 0penBmc -n 0penBmc123 -z From bd7ff51f6cc93a02090500e7a5f72f78fed2b943 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 4 Jun 2020 10:00:56 -0400 Subject: [PATCH 095/102] Remove confignics for xCAT doc --- .../infiniband/network_configuration.rst | 6 +- .../common/deployment/install_new_kernel.rst | 2 +- .../deployment/network/cfg_second_adapter.rst | 133 ------------------ .../deployment/prepostscripts/post_script.rst | 2 +- .../network/cfg_second_adapter.rst | 2 - .../diskful/customize_image/network/index.rst | 1 - .../network/cfg_second_adapter.rst | 2 - .../customize_image/network/index.rst | 1 - xCAT/postscripts/configib | 1 + xCAT/postscripts/confignics | 4 + xCAT/postscripts/cumulusztp | 2 +- 11 files changed, 11 insertions(+), 145 deletions(-) delete mode 100644 docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst delete mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst delete mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst diff --git a/docs/source/advanced/networks/infiniband/network_configuration.rst b/docs/source/advanced/networks/infiniband/network_configuration.rst index 3f675a7ba..c708d387e 100644 --- a/docs/source/advanced/networks/infiniband/network_configuration.rst +++ b/docs/source/advanced/networks/infiniband/network_configuration.rst @@ -3,7 +3,7 @@ IB Network Configuration xCAT provides a script ``configib`` to help configure the Infiniband adapters on the compute nodes. -The Infiniband adapter is considered an additional interface for xCAT. The process for configuring Infiniband adapters complies with the process of :doc:`Configure Additional Network Interfaces <../../../../guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter>`. +The Infiniband adapter is considered an additional interface for xCAT. The process for configuring Infiniband adapters complies with the process of :doc:`Configure Additional Network Interfaces <../../../../guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter>`. Below are an simple example to configure Mellanox IB in Ubuntu 14.04.1 on Power8 LE @@ -25,12 +25,12 @@ If your target Mellanox IB adapter has 2 ports, and you plan to give port ib0 4 * To configure during node installation :: - chdef -p postscripts="confignics --ibaports=2" + chdef -p postscripts="confignetwork --ibaports=2" nodeset osimage= rsetboot net rpower reset * To configure on a node which has had operating system :: - updatenode -P "confignics --ibaports=2" + updatenode -P "confignetwork --ibaports=2" diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst index 35b340e0b..c45845212 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst @@ -86,4 +86,4 @@ The default driver list: :: Note: With this approach, xCAT will search for the drivers in the rootimage. You need to make sure the drivers have been included in the rootimage before generating the initrd. You can install the drivers manually in an existing rootimage (using chroot) and run genimage again, or you can use a postinstall script to install drivers to the rootimage during your initial genimage run. -Use the driver rpm package to add new drivers from rpm packages to the diskless initrd. Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter` for details. +Use the driver rpm package to add new drivers from rpm packages to the diskless initrd. Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter` for details. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst deleted file mode 100644 index ce6f9b801..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst +++ /dev/null @@ -1,133 +0,0 @@ -Configure Additional Network Interfaces old version - confignics - (deprecated) -=============================================================================== - -**"confignics" is deprecated, recommend using new version "confignetwork" instead.** - -The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. - -The way the confignics postscript decides what IP address to give the secondary adapter is by checking the nics table, in which the nic configuration information is stored. - -To use the nics table and confignics postscript to define a secondary adapter on one or more nodes, follow these steps: - - -Define configuration information for the Secondary Adapters in the nics table ------------------------------------------------------------------------------ - -There are 3 ways to complete this operation. - -1. Using the ``mkdef`` and ``chdef`` commands :: - - # mkdef cn1 groups=all nicips.eth1="11.1.89.7|12.1.89.7" nicnetworks.eth1="net11|net12" nictypes.eth1="Ethernet" - 1 object definitions have been created or modified. - - # chdef cn1 nicips.eth2="13.1.89.7|14.1.89.7" nicnetworks.eth2="net13|net14" nictypes.eth2="Ethernet" - 1 object definitions have been created or modified. - -2. Using an xCAT stanza file - - - Prepare a stanza file ``.stanza`` with content similiar to the following: :: - - # - cn1: - objtype=node - arch=x86_64 - groups=kvm,vm,all - nichostnamesuffixes.eth1=-eth1-1|-eth1-2 - nichostnamesuffixes.eth2=-eth2-1|-eth2-2 - nicips.eth1=11.1.89.7|12.1.89.7 - nicips.eth2=13.1.89.7|14.1.89.7 - nicnetworks.eth1=net11|net12 - nicnetworks.eth2=net13|net14 - nictypes.eth1=Ethernet - nictypes.eth2=Ethernet - - - Using the ``mkdef -z`` option, define the stanza file to xCAT: :: - - # cat .stanza | mkdef -z - -3. Using ``tabedit`` to edit the ``nics`` database table directly - - The ``tabedit`` command opens the specified xCAT database table in a vi like editor and allows the user to edit any text and write the changes back to the database table. - - *WARNING:* Using the ``tabedit`` command is not the recommended method because it is tedious and error prone. - - After changing the content of the ``nics`` table, here is the result from ``tabdump nics`` :: - - # tabdump nics - #node,nicips,nichostnamesuffixes,nictypes,niccustomscripts,nicnetworks,nicaliases,comments,disable - "cn1","eth1!11.1.89.7|12.1.89.7,eth2!13.1.89.7|14.1.89.7","eth1!-eth1-1|-eth1-2,eth2!-eth2-1|-eth2-2,"eth1!Ethernet,eth2!Ethernet",,"eth1!net11|net12,eth2!net13|net14",,, - - -After you have defined the configuration information in any of the ways above, run the ``makehosts`` command to add the new configuration to the ``/etc/hosts`` file. :: - - # makehosts cn1 - - # cat /etc/hosts - 11.1.89.7 cn1-eth1-1 cn1-eth1-1.ppd.pok.ibm.com - 12.1.89.7 cn1-eth1-2 cn1-eth1-2.ppd.pok.ibm.com - 13.1.89.7 cn1-eth2-1 cn1-eth2-1.ppd.pok.ibm.com - 14.1.89.7 cn1-eth2-2 cn1-eth2-2.ppd.pok.ibm.com - - -Add confignics into the node's postscripts list ------------------------------------------------ - -Use command below to add confignics into the node's postscripts list :: - - chdef cn1 -p postscripts=confignics - -**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts=confignetwork`` instead above ``chdef`` command. - -By default, confignics does not configure the install nic. if need, using flag "-s" to allow the install nic to be configured. :: - - chdef cn1 -p prostscripts="confignics -s" - -Option "-s" writes the install nic's information into configuration file for persistence. All install nic's data defined in nics table will be written also. - -**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts="confignetwork -s"`` instead above ``chdef`` command. - -Add network object into the networks table ------------------------------------------- - -The ``nicnetworks`` attribute only defines the nic that uses the IP address. -Other information about the network should be defined in the ``networks`` table. - -Use the ``tabedit`` command to add/modify the networks in the``networks`` table :: - - tabdump networks - #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable - ... - "net11", "11.1.89.0", "255.255.255.0", "eth1",,,,,,,,,,,,,,,, - "net12", "12.1.89.0", "255.255.255.0", "eth1",,,,,,,,,,,,,,,, - "net13", "13.1.89.0", "255.255.255.0", "eth2",,,,,,,,,,,,,,,, - "net14", "14.1.89.0", "255.255.255.0", "eth2",,,,,,,,,,,,,,,, - -Option -r to remove the undefined NICS --------------------------------------- - -If the compute node's nics were configured by ``confignics`` and the nics configuration changed in the nics table, user the ``confignics -r`` to remove the undefined nic. - -For example, if on a compute node the ``eth0``, ``eth1``, and ``eth2`` nics were configured: :: - - # ifconfig - eth0 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e6 - ... - eth1 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e7 - ... - eth2 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e8 - ... - -Delete the eth2 definition in nics table using the ``chdef`` command. -Then run the following to remove the undefined ``eth2`` nic on the compute node: :: - - updatenode -P "confignics -r" - -The result should have ``eth2`` disabled: :: - - # ifconfig - eth0 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e6 - ... - eth1 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e7 - ... - -Deleting the ``installnic`` will result in strange problems, so ``confignics -r`` will not delete the nic set as the ``installnic``. 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 277c96346..2fa03bed8 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 @@ -632,7 +632,7 @@ This is an example of the generated postscript for a servicenode install. It is export NETMASK GATEWAY=10.2.0.100 export GATEWAY - # NIC related attributes for the node for confignics postscript + # NIC related attributes for the node for confignetwork postscript NICIPS="" export NICIPS NICHOSTNAMESUFFIXES="" diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst deleted file mode 100644 index f5cfbee00..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../../../../common/deployment/network/cfg_second_adapter.rst - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst index 08945ef1c..0d86145ea 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst @@ -7,5 +7,4 @@ This section describes how to configure network adapters with persistent configu :maxdepth: 1 cfg_network_adapter.rst - cfg_second_adapter.rst cfg_routes.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst deleted file mode 100644 index f5cfbee00..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../../../../common/deployment/network/cfg_second_adapter.rst - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst index 08945ef1c..0d86145ea 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst @@ -7,5 +7,4 @@ This section describes how to configure network adapters with persistent configu :maxdepth: 1 cfg_network_adapter.rst - cfg_second_adapter.rst cfg_routes.rst diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index bcddc25e7..846ba4c1a 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -488,6 +488,7 @@ $nmcontrol $devtype BOOTPROTO=none ONBOOT=yes +DEFROUTE=no NAME=$nic IPADDR=$nicip" > $dir/ifcfg-$nic # ipv6 diff --git a/xCAT/postscripts/confignics b/xCAT/postscripts/confignics index 4718fbee9..6d67c53ae 100755 --- a/xCAT/postscripts/confignics +++ b/xCAT/postscripts/confignics @@ -4,6 +4,7 @@ #------------------------------------------------------------------------------- #=head1 confignics #=head2 Used on Linux only. Config the Ethernet or InfiniBand adapters on the nodes +#=head3 confignics is deprecated, please use confignetwork instead # # You can run the following commands on MN: # updatenode noderange confignics @@ -13,6 +14,9 @@ #=cut #------------------------------------------------------------------------------- +logger -t $log_label -p local4.err "**NOTE**:confignics is deprecated, please use confignetwork instead" +echo "**NOTE**:confignics is deprecated, please use confignetwork instead" +exit 1 if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then str_dir_name=`dirname $0` diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp index 38f5ddad9..789389260 100755 --- a/xCAT/postscripts/cumulusztp +++ b/xCAT/postscripts/cumulusztp @@ -161,7 +161,7 @@ echo './enablesnmp' >> ./mypostscript #config base interface echo './configinterface' >> ./mypostscript #config static ip address for mgt interface -echo './confignics -s' >> ./mypostscript +echo './confignetwork -s' >> ./mypostscript chmod 700 ./mypostscript ./mypostscript rc=$? From ebbe32a81d3e6ad027dbbc164b0afbe3afb8eeef Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Fri, 5 Jun 2020 11:43:58 +0800 Subject: [PATCH 096/102] test: remove imgexport -v test case we don't support show version of imgexport. -v means verbose for imgexprot. So delete this testcase. Issue: # imgexport -v Exporting to /root... Error: [fnst-c0]: Cannot find image '' from the osimage table. Signed-off-by: Chen Hanxiao --- xCAT-test/autotest/testcase/imgexport/cases0 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/imgexport/cases0 b/xCAT-test/autotest/testcase/imgexport/cases0 index 246647447..c9aeca9e1 100644 --- a/xCAT-test/autotest/testcase/imgexport/cases0 +++ b/xCAT-test/autotest/testcase/imgexport/cases0 @@ -62,13 +62,3 @@ check:output=~Usage|usage cmd:imgexport --help check:output=~Usage|usage end - - -start:imgexport_v -os:Linux -label:others -cmd:imgexport -v -check:output=~version|Version -cmd:imgexport --version -check:output=~version|Version -edn From e5f01f77812615e6afc8876126ed20bb8a4cbd07 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 5 Jun 2020 11:15:12 -0400 Subject: [PATCH 097/102] Set hostname sooner for SuSE stateless images This avoids ugly behaviors where hostname is set late or not at all. --- xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-cmdline.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-cmdline.sh b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-cmdline.sh index 80d088557..f9c89e178 100644 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-cmdline.sh +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-cmdline.sh @@ -2,3 +2,5 @@ root=1 rootok=1 netroot=xcat echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/xcatroot.sh +hostname $(getarg NODE) + From 139214000225e97eba73f6e4f250f7e1d074e7e6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 8 Jun 2020 15:43:45 -0400 Subject: [PATCH 098/102] Flush out repomd.xml --- xCAT-test/autotest/testcase/go_xcat/case3 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index da64c9fe6..0c77f587a 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -21,6 +21,9 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Pull down repomd.xml on SLES to prevent caching of the wrong file +cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then xdsh $$CN "wget http://xcat.org/files/xcat/repos/yum/devel/core-snap/repodata/repomd.xml"; fi + #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi From 199b6ba9218e69f9598aedd40ec64efcba2211bf Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 9 Jun 2020 10:56:21 -0400 Subject: [PATCH 099/102] Adding 2.16.x release information --- docs/source/overview/_files/2.16.x.csv | 4 ++++ docs/source/overview/xcat2_release.rst | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 docs/source/overview/_files/2.16.x.csv diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv new file mode 100644 index 000000000..004364bfb --- /dev/null +++ b/docs/source/overview/_files/2.16.x.csv @@ -0,0 +1,4 @@ +Version,Release Date,New OS Supported,Release Notes + +2.16.0,2020-06-17,,`2.16.0 Release Notes `_ + diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 5857e17ce..d7cdb0c21 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -6,6 +6,15 @@ The following tables documents the xCAT release versions and release dates. For .. tabularcolumns:: |p{1cm}|p{4cm}|p{7cm}|p{7cm} +xCAT 2.16.x +----------- + +.. csv-table:: 2.16.x Release Information + :file: _files/2.16.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 + xCAT 2.15.x ----------- From c17587e6f443ff5b8ae969a83fe39bb9bbd4af41 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 12 Jun 2020 13:15:03 -0400 Subject: [PATCH 100/102] Flush out deps repomd.xml --- xCAT-test/autotest/testcase/go_xcat/case3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 0c77f587a..a8408c40e 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -21,8 +21,9 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi -#Pull down repomd.xml on SLES to prevent caching of the wrong file +#Pull down core and deps repomd.xml on SLES to prevent caching of the wrong file cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then xdsh $$CN "wget http://xcat.org/files/xcat/repos/yum/devel/core-snap/repodata/repomd.xml"; fi +cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then os=`echo __GETNODEATTR($$CN,os)__ | cut -d "." -f1` && xdsh $$CN "wget http://xcat.org/files/xcat/repos/yum/devel/xcat-dep/$os/__GETNODEATTR($$CN,arch)__/repodata/repomd.xml"; fi #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi From 0bafaab3c50374102d94ac0a54435fd06880a380 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 Jun 2020 11:08:07 -0400 Subject: [PATCH 101/102] Add no-cache option to go-xcat testcases --- xCAT-test/autotest/testcase/go_xcat/case3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index a8408c40e..48b97ff28 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -22,8 +22,8 @@ check:rc==0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi #Pull down core and deps repomd.xml on SLES to prevent caching of the wrong file -cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then xdsh $$CN "wget http://xcat.org/files/xcat/repos/yum/devel/core-snap/repodata/repomd.xml"; fi -cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then os=`echo __GETNODEATTR($$CN,os)__ | cut -d "." -f1` && xdsh $$CN "wget http://xcat.org/files/xcat/repos/yum/devel/xcat-dep/$os/__GETNODEATTR($$CN,arch)__/repodata/repomd.xml"; fi +cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then xdsh $$CN "wget --no-cache http://xcat.org/files/xcat/repos/yum/devel/core-snap/repodata/repomd.xml"; fi +cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then os=`echo __GETNODEATTR($$CN,os)__ | cut -d "." -f1 | sed s/sle1/sles1/` && xdsh $$CN "wget --no-cache http://xcat.org/files/xcat/repos/yum/devel/xcat-dep/$os/__GETNODEATTR($$CN,arch)__/repodata/repomd.xml"; fi #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi From 7402d9b69285ef0a9eb277f5808eb6ac77a514a1 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 Jun 2020 13:42:57 -0400 Subject: [PATCH 102/102] Testcase fixes --- xCAT-test/autotest/testcase/migration/sles_migration | 9 +++++---- xCAT-test/autotest/testcase/nodeset/cases0 | 2 +- xCAT-test/autotest/testcase/xcat_inventory/cases.common | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 80561503f..a0afec2a5 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -27,7 +27,7 @@ cmd:service dhcpd restart check:rc==0 cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi check:output=~$$CN -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 @@ -146,7 +146,7 @@ cmd:service dhcpd restart check:rc==0 cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi check:output=~$$CN -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 @@ -188,10 +188,11 @@ cmd:xdsh $$CN "zypper sl -U;zypper --gpg-auto-import-keys search --match-exact - check:rc==0 cmd:xdsh $$CN "zypper -n install xCAT" check:rc==0 -cmd:xdsh $$CN "zypper -n install createrepo" +# 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 check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh" -eck:rc==0 +check:rc==0 cmd:xdsh $$CN "lsxcatd -v" check:rc==0 check:output=~$$MIGRATION2_VERSION diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 2e807673c..d68b4d3e0 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -171,7 +171,7 @@ label:others cmd:mkdef -t node -o testnode1 arch=ppc64el cons=ipmi groups=pbmc mgt=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 check:rc==0 cmd:chdef testnode1 os=rhels7.5 netboot=petitboot -eck:rc==0 +check:rc==0 cmd: mkdef "rhels7.5-ppc64el-install-compute" -u profile=compute provmethod=install osvers=rhels7.5 check:rc==0 cmd:nodeset testnode1 osimage="rhels7.5-ppc64el-install-compute" diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.common b/xCAT-test/autotest/testcase/xcat_inventory/cases.common index 4badc8873..8572f59d5 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.common +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.common @@ -88,7 +88,7 @@ check:output ~=usage check:output ~= error: argument -f/--path: expected one argument cmd:xcat-inventory export -t node -o bogusnode --path check:rc!=0 -eck:output ~=usage +check:output ~=usage check:output ~= error: argument -f/--path: expected one argument cmd:mkdir /tmp/xcat_inventory_export_option_f/testdir check:rc==0