From 1c34dce084f87d9ac63c5d1f30c5872b36855ef3 Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Thu, 14 May 2020 15:05:24 +0800 Subject: [PATCH 01/95] test: confignetwork: update regexp to fix IP matching update regexp to get the right IP address Issue: xcat-com001: configure nic and its device : eth0 xcat-com001: [I]: configure eth0 xcat-com001: [I]: call: NMCLI_USED=0 configeth eth0 10092.168.200.20 confignetworks_test1 xcat-com001: [I]: configeth on xcat-com001: os type: redhat xcat-com001: configeth on xcat-com001: old configuration: 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 xcat-com001: link/ether 52:54:00:7d:fe:76 brd ff:ff:ff:ff:ff:ff xcat-com001: inet6 fe80::5054:ff:fe7d:fe76/64 scope link xcat-com001: valid_lft forever preferred_lft forever xcat-com001: [I]: configeth on xcat-com001: new configuration xcat-com001: 10092.168.200.20, 100.168.0.0, 255.255.0.0, <==== here Command: XCATTEST_MN=192.168.200.10 XCATTEST_SN=192.168.200.10 XCATTEST_ISO=/opt/xcat/CentOS-7-x86_64-DVD-1804.iso XCATTEST_SECONDNIC=eth0 XCATTEST_THIRDNIC=eth2 XCATTEST_CN=xcat-com001 xcattest -t confignetwork_vlan_eth0 # lsdef -t node xcat-com001 Object name: xcat-com001 arch=x86_64 currchain=shell currstate=runimage=http://192.168.102.124/install/my_image/my_image.tgz groups=compute,all ip=192.168.200.20 mac=52:54:00:16:ba:39 mgt=ipmi monserver=192.168.200.10 netboot=xnba nfsserver=192.168.200.10 postbootscripts=otherpkgs postscripts=syslog,remoteshell,syncfiles serialport=0 serialspeed=115200 status=powering-off statustime=05-12-2020 05:39:46 tftpserver=192.168.200.10 xcatmaster=192.168.200.10 Signed-off-by: Chen Hanxiao --- .../autotest/testcase/confignetwork/cases0 | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 414883423..264dc00f3 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -166,20 +166,20 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi @@ -278,7 +278,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;second2ip=$var2$var3;chdef $$CN nicips.$$SECONDNIC="$second1ip|$second2ip" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="confignetworks_test1|confignetworks_test2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;second2ip=$var2$var3;chdef $$CN nicips.$$SECONDNIC="$second1ip|$second2ip" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="confignetworks_test1|confignetworks_test2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" check:rc==0 cmd:makehosts $$CN check:rc==0 @@ -287,12 +287,12 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~BOOTPROTO=none|static check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes @@ -301,8 +301,8 @@ cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts @@ -512,7 +512,7 @@ check:rc==0 cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -522,28 +522,28 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=105.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=106.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test7 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3;second7ip=$var2$var3;chdef $$CN nicnetworks.$$SECONDNIC.6=confignetworks_test6 nicnetworks.$$SECONDNIC.7=confignetworks_test7 nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=$second6ip nicips.$$SECONDNIC.7=$second7ip nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3;second7ip=$var2$var3;chdef $$CN nicnetworks.$$SECONDNIC.6=confignetworks_test6 nicnetworks.$$SECONDNIC.7=confignetworks_test7 nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=$second6ip nicips.$$SECONDNIC.7=$second7ip nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3;xdsh $$CN "ip addr del $second6ip/8 dev $$SECONDNIC.6" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3;xdsh $$CN "ip addr del $second6ip/8 dev $$SECONDNIC.6" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test6 cmd:rmdef -t network -o confignetworks_test7 cmd:xdsh $$CN "ip link del dev $$SECONDNIC.6" cmd:xdsh $$CN "ip link del dev $$SECONDNIC.7" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC.6 /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/;else echo \"Sorry,this is not supported os\"; fi" @@ -610,11 +610,11 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -622,7 +622,7 @@ cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -630,7 +630,7 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -639,7 +639,7 @@ cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;xdsh $$CN "ip addr del $bond0ip/16 dev bond0" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;xdsh $$CN "ip addr del $bond0ip/16 dev bond0" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi @@ -666,27 +666,27 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0= +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0= check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.$$SECONDNIC=bond0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.$$SECONDNIC=bond0 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:rmdef -t network -o confignetworks_test1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 @@ -715,11 +715,11 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1500 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -729,13 +729,13 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 mtu=1500 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;bond3ip=$var2$var3;chdef $$CN nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nicips.bond0.2=$bond2ip nicips.bond0.3=$bond3ip nicnetworks.bond0.2=confignetworks_test3 nicnetworks.bond0.3=confignetworks_test4 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;bond3ip=$var2$var3;chdef $$CN nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nicips.bond0.2=$bond2ip nicips.bond0.3=$bond3ip nicnetworks.bond0.2=confignetworks_test3 nicnetworks.bond0.3=confignetworks_test4 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 @@ -751,10 +751,10 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifc check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:rmdef -t network -o confignetworks_test4 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;xdsh $$CN "ip addr del $bond2ip/16 dev bond0.2" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;xdsh $$CN "ip addr del $bond3ip/16 dev bond0.3" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;xdsh $$CN "ip addr del $bond2ip/16 dev bond0.2" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond3ip=$var2$var3;xdsh $$CN "ip addr del $bond3ip/16 dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" @@ -783,18 +783,18 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;chdef $$CN nicnetworks.br0=confignetworks_test3 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=$br0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;chdef $$CN nicnetworks.br0=confignetworks_test3 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=$br0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -802,7 +802,7 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -811,9 +811,9 @@ cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:xdsh $$CN "ip link del dev br0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi @@ -838,11 +838,11 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -851,13 +851,13 @@ check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;br33ip=$var2$var3;chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=confignetworks_test3 nicnetworks.br33=confignetworks_test4 nicips.br22=$br22ip nicips.br33=$br33ip nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;br33ip=$var2$var3;chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=confignetworks_test3 nicnetworks.br33=confignetworks_test4 nicips.br22=$br22ip nicips.br33=$br33ip nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 @@ -869,16 +869,16 @@ cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" cmd:xdsh $$CN "ip link del dev br22" cmd:rmdef -t network -o confignetworks_test4 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var2;xdsh $$CN "ip addr del $br33ip/16 dev br33" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br33ip=$var1$var2;xdsh $$CN "ip addr del $br33ip/16 dev br33" cmd:xdsh $$CN "ip link del dev br33" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 From 8bb7671a237cc6fbb3c0c4248695c33d460f57dc Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Tue, 9 Jun 2020 15:44:11 +0800 Subject: [PATCH 02/95] xcattest: proper replace vars in test cases xcattest will replace vars in testcases. But vars with same prefix will lead to a replacement failure. Issue: XCATTEST_PORT=500 XCATTEST_CN=xcat-com001 XCATTEST_PDU=xmount XCATTEST_PDUIP=192.168.200.100 xcattest -t mkdef_pdu_object cmd:mkdef $$PDU groups=pdu ip=$$PDUIP mgt=pdu nodetype=pdu will be: RUN:mkdef xmount groups=pdu ip=xmountIP mgt=pdu nodetype=pdu $$PDUIP had no chance to be substituted. Reported-by: Yang Jian Signed-off-by: Chen Hanxiao --- xCAT-test/xcattest | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index f95a839b9..01ec0b777 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1867,9 +1867,11 @@ sub getvar { my $str = shift; my $config_ref = shift; + my @vars = ($str =~ /\$\$(\w+)/g); + my @reverse_sorted_vars = reverse sort @vars; - while ($str =~ /\$\$(\w+)/) { - my $varname = $1; + # let $$AA and $$A have the same chance to be replaced. + for my $varname (@reverse_sorted_vars) { if (exists($$config_ref{var}{$varname})) { $str =~ s/\$\$$varname/$$config_ref{var}{$varname}/g; } else { From 6b0a287cbe725dbdd2f7c9a5b4edd57a2e0e0041 Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Wed, 10 Jun 2020 16:32:44 +0800 Subject: [PATCH 03/95] test: remove imgimport -v test case we don't support show version of imgimport. -v means verbose for imgimport. So delete this testcase. Issue: # imgexport -v Error: [xcat]: Cannot find /root/-v Reported-by: Yang Jian Signed-off-by: Chen Hanxiao --- xCAT-test/autotest/testcase/imgimport/cases0 | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/xCAT-test/autotest/testcase/imgimport/cases0 b/xCAT-test/autotest/testcase/imgimport/cases0 index 2683d62ec..5e71e7d07 100644 --- a/xCAT-test/autotest/testcase/imgimport/cases0 +++ b/xCAT-test/autotest/testcase/imgimport/cases0 @@ -9,17 +9,6 @@ check:output=~usage|Usage end -start:imgimport_v -os:Linux -description:imgimport -v and --version -label:others -cmd:imgimport -v -check:output=~version|Version -cmd:imgimport --version -check:output=~version|Version -end - - start:imgimport_bundlefile os:Linux description:imgimport foo.tgz From 89478e8856c1b42229e6bde40587c238acb9623f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 17 Jun 2020 12:32:25 -0400 Subject: [PATCH 04/95] Update version to 2.16.1 --- 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 9ea646c4c..1f8253fe9 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.2' +release = '2.16.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From e60fe592c242268d0c875a55f5554aeb8ffb3c8b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 17 Jun 2020 12:33:25 -0400 Subject: [PATCH 05/95] Update version to 2.16.1 --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 6d28a11dd..0e7079b69 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.16 +2.16.1 From 05f4119eae9858ae0fb51eb161c6499b7928ab9b Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 17 Jun 2020 15:45:30 -0400 Subject: [PATCH 06/95] Add Cuda11 setup scripts --- .../xcat/samples/cuda11/cuda11_power9_setup | 154 ++++++++++++++++++ .../xcat/samples/cuda11/cuda11_setup.readme | 66 ++++++++ .../xcat/samples/cuda11/cuda_power9_setup | 96 +++++++++++ 3 files changed, 316 insertions(+) create mode 100755 xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup create mode 100644 xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme create mode 100755 xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup b/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup new file mode 100755 index 000000000..5a2a27f0c --- /dev/null +++ b/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup @@ -0,0 +1,154 @@ +#!/bin/bash +# +# Copyright (C) 2018 International Business Machines +# Eclipse Public License, Version 1.0 (EPL-1.0) +# +# +# 2018-03-21 GONG Jie +# 2018-04-24 Matt Ezell +# +# This script is used for doing extra setup steps for NVIDIA POWER9 CUDA driver +# on RHEL 7. Please refer document below for details. +# +# http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup +# + +umask 0022 + +# Disable a udev rule installed by default in some Linux distributions that cause hot-pluggable +# memory to be automatically onlined when it is physically probed. +# +# The overrides for /lib/udev rules should be done in /etc/udev +# +UDEV_REDHAT_SOURCE=${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +UDEV_REDHAT_TARGET=${IMG_ROOTIMGDIR}/etc/udev/rules.d/40-redhat.rules + +# If the file does not exist in /etc/udev, copy it from /lib/udev +if [ ! -e ${UDEV_REDHAT_TARGET} ]; then + cp -n ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} +fi + +# Disable udev memory auto-onlining Rule for cuda10.x +# +# For RHELS 7.5 ALT +# +sed -i "s/^\(SUBSYSTEM==\"memory\".*\)/#\1/" ${UDEV_REDHAT_TARGET} +# +# For RHELS 7.6 ALT +# +if [[ `grep 'Memory hotadd request' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null && grep 'LABEL="memory_hotplug_end' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` == 0 ]]; then + echo "Detected RHELS 7.6 ALT, modifying ${UDEV_REDHAT_TARGET}..." + # Comment out the memory hotadd request (for reference) + if [[ `grep "## Memory hotadd request" ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` != 0 ]]; then + # but only run one time, not if it's already commented out. (to handle multiple genimage calls) + #sed -i '/Memory hotadd request/,+8 s/^/#/' ${UDEV_REDHAT_TARGET} + # RH76 CUDA doc recommends the following: + sed -i s/^\SUBSYSTEM!=\"memory\"/SUBSYSTEM==\"\*\"/ ${UDEV_REDHAT_TARGET} + sed -i s/^\ACTION!=\"add\"/ACTION==\"\*\"/ /tmp/40-redhat.rules ${UDEV_REDHAT_TARGET} + fi +fi + +echo "Comparing ${UDEV_REDHAT_SOURCE} and ${UDEV_REDHAT_TARGET}" +diff ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} + +# Setting NVIDIA parameters in both /etc/modprobe.d and /usr/lib/modprobe.d + +echo "==> Setting NVIDIA options in /usr/lib/modprobe.d/gpusupport and /etc/modprobe.d" +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/gpusupport.conf +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/etc/modprobe.d/gpusupport.conf + +grep nouveau ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +if (( $? )) +then +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +fi + +grep nouveau ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +if (( $? )) +then +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +fi + +# This is for nvprof (per George Chochia) +grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +if (( $? )) +then + echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +fi + +grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +if (( $? )) +then + echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +fi + +#for cuda nvidia installation +unset ARCH +installed_kernel=`uname -r` + +function hack_uname() +{ + mv "$1/bin/uname" "$1/bin/uname.xcat" + cat <<-EOF >>"$1/bin/uname" +#!/bin/sh + case "\$1" in + "-m") + ARCH="\$(rpm -q kernel-\$("\$0" -r) --qf '%{arch}' 2>/dev/null)" + echo "\$ARCH" + ;; + "-r") + kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" + echo "\$kernel_version" + ;; + "-s"|"") + echo "Linux" + ;; + esac + exit 0 +EOF + + chmod 0755 "$1/bin/uname" +} + + +if [ -z "${IMG_ROOTIMGDIR}" ] +then + kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" + mkinitrd -v -f "/boot/initramfs-${kernel_version}.img" "${kernel_version}" + hack_uname ${IMG_ROOTIMGDIR} +else + hack_uname +fi + +updated_kernel=`uname -r` + +dnf -y module install nvidia-driver:latest-dkms +dnf -y install cuda + +#depmod nvidia_rsync_mem used installed kernel not updated kernel +if [ ${updated_kernel} != ${installed_kernel} ] +then + ln -s /lib/modules/${updated_kernel} /lib/modules/${installed_kernel} +fi +dnf -y install nvidia_peer_memory +dnf -y install nv_rsync_mem +dnf -y install nvidia_gdrcopy_kernel +if [ ${updated_kernel} != ${installed_kernel} ] +then + rm -rf /lib/modules/${installed_kernel} +fi + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" + + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nvidia_gdrcopy_kernel.service" + +if [ -z "${IMG_ROOTIMGDIR}" ] +then + mv "${IMG_ROOTIMGDIR}/bin/uname.xcat" "${IMG_ROOTIMGDIR}/bin/uname" +else + mv "/bin/uname.xcat" "/bin/uname" +fi + diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme b/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme new file mode 100644 index 000000000..5e888811b --- /dev/null +++ b/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme @@ -0,0 +1,66 @@ +cuda setup scripts +================== + +This section documented NVIDIA CUDA Toolkit v11 installation on the power9 rhels8.1 system. + +Diskful images +-------------- + +The following ``cudafull`` osimage definitions will be created from the base ``rhels8.1-ppc64le-install-compute`` osimage. :: + + # lsdef -t osimage rhels8.1.0-ppc64le-install-cudafull + Object name: rhels8.1.0-ppc64le-install-cudafull + imagetype=linux + osarch=ppc64le + osdistroname=rhels8.1.0-ppc64le + osname=Linux + osvers=rhels8.1.0 + otherpkgdir=/install/post/otherpkgs/rhels8.1.0/ppc64le + pkgdir=/install/rhels8.1.0/ppc64le,/install/REPO/software/nvidia/cuda-core/11.0.1_450.36.06-1/repo/ppc64le,/install/cuda11/ppc64le/cuda-deps + pkglist=/opt/xcat/share/xcat/install/rh/compute.rhels8.cuda.pkglist + postscripts=custom.ps/nvidia/postinstall/cuda11_power9_setup + profile=compute + provmethod=install + template=/opt/xcat/share/xcat/install/rh/compute.rhels8.tmpl + +Postscripts +^^^^^^^^^^^ + +xCAT provides ``cuda_power9_setup`` postscripts to setup additional configuration to install NVIDIA POWER9 CUDA driver. For ``CUDA11``, it has issue to installing nvidia-drivers modules with kickstart. To workaround this problem, xCAT provides another postscripts ``cuda11_power9_setup``, the CUDA packages will be installed from this postscripts instead from package list and this is only apply to the diskfull installation. + +CUDA dependences +^^^^^^^^^^^^^^^^ + +``dkms`` and ``opencl-filesystem`` are required for the CUDA11. ``dkms`` packages can be found in the rhel8 EPEL repository. ``opencl-filesystem`` packages can be found in the rhel8 CodeReady repository. :: + + # ls -ltr /install/cuda11/ppc64le/cuda-deps + -rw-r--r-- 1 root root 82332 Jun 16 10:25 dkms-2.8.1-4.20200214git5ca628c.el8.noarch.rpm + -rw-r--r-- 1 root root 90148 Jun 16 10:29 opencl-headers-2.2-1.20180306gite986688.el8.noarch.rpm + -rw-r--r-- 1 root root 8668 Jun 16 10:29 opencl-filesystem-1.0-6.el8.noarch.rpm + drwxr-xr-x 2 root root 4096 Jun 16 15:10 repodata + +CUDA Packages +^^^^^^^^^^^^^ + +``cuda-repo-rhel8-11-0-local-11.0.1_450.36.06-1.ppc64le.rpm`` is used for above osimage and it disbuted in the ``/install/REPO/software/nvidia/cuda-core/11.0.1_450.36.06-1/repo/ppc64le`` dir. +Besides rhels8 base packlist, the following packages needs to be added also. :: + + # diff /opt/xcat/share/xcat/install/rh/compute.rhels8.cuda.pkglist /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist + 12,27d11 + < libtirpc + < yum + < rpm + < dnf + < dracut + < dracut-network + < e2fsprogs + < #For Cuda + < kernel-devel + < kernel-headers + < make + < gcc + < pciutils + < dkms + < opencl-filesystem + +NOTE: The two scripts in this directory verified with HPC service stack software. diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup b/xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup new file mode 100755 index 000000000..ac7626290 --- /dev/null +++ b/xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup @@ -0,0 +1,96 @@ +#!/bin/bash +# +# Copyright (C) 2018 International Business Machines +# Eclipse Public License, Version 1.0 (EPL-1.0) +# +# +# 2018-03-21 GONG Jie +# 2018-04-24 Matt Ezell +# +# This script is used for doing extra setup steps for NVIDIA POWER9 CUDA driver +# on RHEL 7. Please refer document below for details. +# +# http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup +# + +umask 0022 + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" + + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nvidia_gdrcopy_kernel.service" + +# Disable a udev rule installed by default in some Linux distributions that cause hot-pluggable +# memory to be automatically onlined when it is physically probed. +# +# The overrides for /lib/udev rules should be done in /etc/udev +# +UDEV_REDHAT_SOURCE=${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +UDEV_REDHAT_TARGET=${IMG_ROOTIMGDIR}/etc/udev/rules.d/40-redhat.rules + +# If the file does not exist in /etc/udev, copy it from /lib/udev +if [ ! -e ${UDEV_REDHAT_TARGET} ]; then + cp -n ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} +fi + +# Disable udev memory auto-onlining Rule for cuda10.x +# +# For RHELS 7.5 ALT +# +sed -i "s/^\(SUBSYSTEM==\"memory\".*\)/#\1/" ${UDEV_REDHAT_TARGET} +# +# For RHELS 7.6 ALT +# +if [[ `grep 'Memory hotadd request' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null && grep 'LABEL="memory_hotplug_end' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` == 0 ]]; then + echo "Detected RHELS 7.6 ALT, modifying ${UDEV_REDHAT_TARGET}..." + # Comment out the memory hotadd request (for reference) + if [[ `grep "## Memory hotadd request" ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` != 0 ]]; then + # but only run one time, not if it's already commented out. (to handle multiple genimage calls) + #sed -i '/Memory hotadd request/,+8 s/^/#/' ${UDEV_REDHAT_TARGET} + # RH76 CUDA doc recommends the following: + sed -i s/^\SUBSYSTEM!=\"memory\"/SUBSYSTEM==\"\*\"/ ${UDEV_REDHAT_TARGET} + sed -i s/^\ACTION!=\"add\"/ACTION==\"\*\"/ /tmp/40-redhat.rules ${UDEV_REDHAT_TARGET} + fi +fi + +echo "Comparing ${UDEV_REDHAT_SOURCE} and ${UDEV_REDHAT_TARGET}" +diff ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} + +# Setting NVIDIA parameters in both /etc/modprobe.d and /usr/lib/modprobe.d + +echo "==> Setting NVIDIA options in /usr/lib/modprobe.d/gpusupport and /etc/modprobe.d" +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/gpusupport.conf +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/etc/modprobe.d/gpusupport.conf + +grep nouveau ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +if (( $? )) +then +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +fi + +grep nouveau ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +if (( $? )) +then +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +fi + +# This is for nvprof (per George Chochia) +grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +if (( $? )) +then + echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +fi + +grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +if (( $? )) +then + echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +fi + +if [ -z "${IMG_ROOTIMGDIR}" ] +then + kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" + mkinitrd -v -f "/boot/initramfs-${kernel_version}.img" "${kernel_version}" +fi From 9265ef98f4b5ae59466de4476422835c9420ae14 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 18 Jun 2020 15:12:01 -0400 Subject: [PATCH 07/95] Modified readme and remove cuda_power9_setup --- .../xcat/samples/cuda11/cuda11_setup.readme | 19 ++-- .../xcat/samples/cuda11/cuda_power9_setup | 96 ------------------- 2 files changed, 13 insertions(+), 102 deletions(-) delete mode 100755 xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme b/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme index 5e888811b..d6bb77371 100644 --- a/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme +++ b/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme @@ -1,12 +1,15 @@ cuda setup scripts ================== -This section documented NVIDIA CUDA Toolkit v11 installation on the power9 rhels8.1 system. +This sample documents installation of the NVIDIA CUDA Toolkit v11 on IBM POWER9 servers as part of xCAT diskful provisioning of Red Hat Enterprise Linux 8.1. +For ``CUDA11``, there is a known issue that prevents successful installion of the nvidia-drivers module as part of the operating system kickstart install process used by diskful provisioning. +Diskless provisioning can still be performed using the traditional osimage method; these instructions apply to diskful provisioning only. + Diskful images -------------- -The following ``cudafull`` osimage definitions will be created from the base ``rhels8.1-ppc64le-install-compute`` osimage. :: +For diskful provisioning, create a new ``cudafull`` osimage definition using the default ``rhels8.1-ppc64le-install-compute`` osimage as a starting point. :: # lsdef -t osimage rhels8.1.0-ppc64le-install-cudafull Object name: rhels8.1.0-ppc64le-install-cudafull @@ -23,10 +26,12 @@ The following ``cudafull`` osimage definitions will be created from the base `` provmethod=install template=/opt/xcat/share/xcat/install/rh/compute.rhels8.tmpl + Postscripts ^^^^^^^^^^^ -xCAT provides ``cuda_power9_setup`` postscripts to setup additional configuration to install NVIDIA POWER9 CUDA driver. For ``CUDA11``, it has issue to installing nvidia-drivers modules with kickstart. To workaround this problem, xCAT provides another postscripts ``cuda11_power9_setup``, the CUDA packages will be installed from this postscripts instead from package list and this is only apply to the diskfull installation. +For ``CUDA11``, there is a known issue that prevents successful installion of the nvidia-drivers module as part of the Red Hat kickstart install process used by diskful provisioning. As an example method to work around this problem, refer to the postscript named ``cuda11_power9_setup``. This postscript will install the NVIDIA CUDA packages directly instead of relying on the osimage package list mechanism. ``cuda11_power9_setup`` is only needed for diskful provisioning. + CUDA dependences ^^^^^^^^^^^^^^^^ @@ -39,11 +44,12 @@ CUDA dependences -rw-r--r-- 1 root root 8668 Jun 16 10:29 opencl-filesystem-1.0-6.el8.noarch.rpm drwxr-xr-x 2 root root 4096 Jun 16 15:10 repodata + CUDA Packages ^^^^^^^^^^^^^ -``cuda-repo-rhel8-11-0-local-11.0.1_450.36.06-1.ppc64le.rpm`` is used for above osimage and it disbuted in the ``/install/REPO/software/nvidia/cuda-core/11.0.1_450.36.06-1/repo/ppc64le`` dir. -Besides rhels8 base packlist, the following packages needs to be added also. :: +``cuda-repo-rhel8-11-0-local-11.0.1_450.36.06-1.ppc64le.rpm`` is used for the example ``cudafull`` osimage and the contents are copied into a directory named ``/install/REPO/software/nvidia/cuda-core/11.0.1_450.36.06-1/repo/ppc64le``. +In addition to the rhels8 base pkglist, the following packages need to also be added. :: # diff /opt/xcat/share/xcat/install/rh/compute.rhels8.cuda.pkglist /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist 12,27d11 @@ -63,4 +69,5 @@ Besides rhels8 base packlist, the following packages needs to be added also. :: < dkms < opencl-filesystem -NOTE: The two scripts in this directory verified with HPC service stack software. + +NOTE: The samples in this directory were verified as part of the IBM HPC POWER9 Clusters service pack testing diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup b/xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup deleted file mode 100755 index ac7626290..000000000 --- a/xCAT-server/share/xcat/samples/cuda11/cuda_power9_setup +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2018 International Business Machines -# Eclipse Public License, Version 1.0 (EPL-1.0) -# -# -# 2018-03-21 GONG Jie -# 2018-04-24 Matt Ezell -# -# This script is used for doing extra setup steps for NVIDIA POWER9 CUDA driver -# on RHEL 7. Please refer document below for details. -# -# http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup -# - -umask 0022 - -[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" -$CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" - - -[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" -$CHROOTCMD /bin/bash -c "systemctl enable nvidia_gdrcopy_kernel.service" - -# Disable a udev rule installed by default in some Linux distributions that cause hot-pluggable -# memory to be automatically onlined when it is physically probed. -# -# The overrides for /lib/udev rules should be done in /etc/udev -# -UDEV_REDHAT_SOURCE=${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules -UDEV_REDHAT_TARGET=${IMG_ROOTIMGDIR}/etc/udev/rules.d/40-redhat.rules - -# If the file does not exist in /etc/udev, copy it from /lib/udev -if [ ! -e ${UDEV_REDHAT_TARGET} ]; then - cp -n ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} -fi - -# Disable udev memory auto-onlining Rule for cuda10.x -# -# For RHELS 7.5 ALT -# -sed -i "s/^\(SUBSYSTEM==\"memory\".*\)/#\1/" ${UDEV_REDHAT_TARGET} -# -# For RHELS 7.6 ALT -# -if [[ `grep 'Memory hotadd request' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null && grep 'LABEL="memory_hotplug_end' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` == 0 ]]; then - echo "Detected RHELS 7.6 ALT, modifying ${UDEV_REDHAT_TARGET}..." - # Comment out the memory hotadd request (for reference) - if [[ `grep "## Memory hotadd request" ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` != 0 ]]; then - # but only run one time, not if it's already commented out. (to handle multiple genimage calls) - #sed -i '/Memory hotadd request/,+8 s/^/#/' ${UDEV_REDHAT_TARGET} - # RH76 CUDA doc recommends the following: - sed -i s/^\SUBSYSTEM!=\"memory\"/SUBSYSTEM==\"\*\"/ ${UDEV_REDHAT_TARGET} - sed -i s/^\ACTION!=\"add\"/ACTION==\"\*\"/ /tmp/40-redhat.rules ${UDEV_REDHAT_TARGET} - fi -fi - -echo "Comparing ${UDEV_REDHAT_SOURCE} and ${UDEV_REDHAT_TARGET}" -diff ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} - -# Setting NVIDIA parameters in both /etc/modprobe.d and /usr/lib/modprobe.d - -echo "==> Setting NVIDIA options in /usr/lib/modprobe.d/gpusupport and /etc/modprobe.d" -echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/gpusupport.conf -echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/etc/modprobe.d/gpusupport.conf - -grep nouveau ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf -if (( $? )) -then -echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf -fi - -grep nouveau ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf -if (( $? )) -then -echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf -fi - -# This is for nvprof (per George Chochia) -grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf -if (( $? )) -then - echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf -fi - -grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf -if (( $? )) -then - echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf -fi - -if [ -z "${IMG_ROOTIMGDIR}" ] -then - kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" - mkinitrd -v -f "/boot/initramfs-${kernel_version}.img" "${kernel_version}" -fi From 8fe8004837e6b881704d4a9430478f48b628513d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 18 Jun 2020 17:01:37 -0400 Subject: [PATCH 08/95] Retry go-xcat installation, if first attemp fails --- xCAT-test/autotest/testcase/go_xcat/case3 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 48b97ff28..827150bff 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -36,10 +36,10 @@ cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86 #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"; fi + +cmd:xdsh $$CN "lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running From 881a8716f43218c00730828b80bd275b755acd22 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 19 Jun 2020 09:30:35 -0400 Subject: [PATCH 09/95] use `cp -r` to copy whole xcat/sample dir --- 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 5c1f487c4..be9f40d72 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -148,7 +148,7 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca/* cp share/xcat/mypostscript/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/mypostscript cp share/xcat/scripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts cp share/xcat/conf/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/conf -cp share/xcat/samples/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples +cp -r share/xcat/samples/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples cp -r share/xcat/tools/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools cp -r share/xcat/hamn/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/hamn cp share/xcat/rollupdate/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/rollupdate From 8238d7d1f7ec7c9a2ed1e69f4795443b177c88b3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 Jun 2020 11:10:47 -0400 Subject: [PATCH 10/95] Use absolute path for lsxcatd in testcase --- xCAT-test/autotest/testcase/go_xcat/case3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 827150bff..c7cb72e83 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -38,7 +38,7 @@ cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86 cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"; fi -cmd:xdsh $$CN "lsxcatd -v" +cmd:xdsh $$CN "/opt/xcat/bin/lsxcatd -v" check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 From 42d1667b3fde37c9aa9cdcb2661c7510f4196c3a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 Jun 2020 16:58:21 -0400 Subject: [PATCH 11/95] Use source --- xCAT-test/autotest/testcase/go_xcat/case3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index c7cb72e83..10a782b56 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -38,7 +38,7 @@ cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86 cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"; fi -cmd:xdsh $$CN "/opt/xcat/bin/lsxcatd -v" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh; lsxcatd -v" check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 From 377ca2343bb09becb3a1e0f0147cfeeed2c09b9a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 23 Jun 2020 11:14:41 -0400 Subject: [PATCH 12/95] More improvements to go-xcat testcases --- xCAT-test/autotest/testcase/go_xcat/case3 | 36 ++++++++++------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 10a782b56..8f1523ef8 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -21,10 +21,6 @@ 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 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 --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 @@ -34,7 +30,7 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #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 +#Install devel version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"; fi @@ -78,12 +74,12 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #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 +#Install GA version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -122,12 +118,12 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #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 +#Install GA version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -176,12 +172,12 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #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 +#Install GA version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running From 3aebb472e9321c4d623c8de2762984eec9cb1a07 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 24 Jun 2020 10:03:30 -0400 Subject: [PATCH 13/95] Improvements to go-xcat testcase --- xCAT-test/autotest/testcase/go_xcat/case3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 8f1523ef8..dd7b22185 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -130,9 +130,9 @@ check:output=~running #Update to devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y update" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT updated successfully first time"; else echo "First attempt to update xCAT failed, attempting to update xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y update"; fi +check:output=~"xCAT updated successfully first time"|"xCAT has been successfully updated" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 From e0fec1a85daaae93fd31fc504c62ee0fbde8c07b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 25 Jun 2020 15:46:34 -0400 Subject: [PATCH 14/95] imgimport/imgexport better messages and option handling --- .../references/man1/imgexport.1.rst | 10 ++++++-- .../references/man1/imgimport.1.rst | 8 ++++++- xCAT-client/pods/man1/imgexport.1.pod | 8 +++++-- xCAT-client/pods/man1/imgimport.1.pod | 6 ++++- xCAT-server/lib/xcat/plugins/imgport.pm | 24 +++++++++++-------- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst index 3626725f1..3481b300d 100644 --- a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst @@ -21,7 +21,7 @@ SYNOPSIS \ **imgexport [-h| -**\ **-help]**\ -\ **imgexport**\ \ *image_name*\ [\ *destination*\ ] [[\ **-e | -**\ **-extra**\ \ *file:dir*\ ] ... ] [\ **-p | -**\ **-postscripts**\ \ *node_name*\ ] [\ **-v | -**\ **-verbose**\ ] +\ **imgexport**\ \ *image_name*\ [\ *destination*\ ] [\ **-e | -**\ **-extra**\ \ *file:dir*\ ] ... ] [\ **-p | -**\ **-postscripts**\ \ *node_name*\ ] [\ **-R | -**\ **-remotehost**\ \ *user@host*\ ] [\ **-v | -**\ **-verbose**\ ] *********** @@ -90,6 +90,12 @@ OPTIONS +\ **-R|-**\ **-remotehost**\ \ *user@host*\ + + Export the image to remote host. Passwordless ssh must be setup to the remote host. + + + \ **-v|-**\ **-verbose**\ Verbose output. @@ -132,7 +138,7 @@ EXAMPLES imgexport foo -foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport if you have a big image to tar up. +foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport, if you have a big image to tar up. 2. To include extra files with your image: diff --git a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst index e813f3377..84decf7fa 100644 --- a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst @@ -21,7 +21,7 @@ SYNOPSIS \ **imgimport [-h|-**\ **-help]**\ -\ **imgimport**\ \ *bundle_file_name*\ [\ **-p | -**\ **-postscripts**\ \ *nodelist*\ ] [\ **-f | -**\ **-profile**\ \ *new_profile*\ ] [\ **-v | -**\ **-verbose**\ ] +\ **imgimport**\ \ *bundle_file_name*\ [\ **-p | -**\ **-postscripts**\ \ *nodelist*\ ] [\ **-f | -**\ **-profile**\ \ *new_profile*\ ] [\ **-R | -**\ **-remotehost**\ \ *user@host*\ ] [\ **-v | -**\ **-verbose**\ ] *********** @@ -109,6 +109,12 @@ OPTIONS +\ **-R|-**\ **-remotehost**\ \ *user@host*\ + + Import the image from remote host. Passwordless ssh must be setup to the remote host. + + + \ **-v|-**\ **-verbose**\ Verbose output. diff --git a/xCAT-client/pods/man1/imgexport.1.pod b/xCAT-client/pods/man1/imgexport.1.pod index 46c165a1a..affd64d1e 100644 --- a/xCAT-client/pods/man1/imgexport.1.pod +++ b/xCAT-client/pods/man1/imgexport.1.pod @@ -6,7 +6,7 @@ B - Exports an xCAT image. B -B I [I] [[B<-e>|B<--extra> I] ... ] [B<-p>|B<--postscripts> I] [B<-v>|B<--verbose>] +B I [I] [B<-e>|B<--extra> I] ... ] [B<-p>|B<--postscripts> I] [B<-R>|B<--remotehost> I] [B<-v>|B<--verbose>] =head1 DESCRIPTION @@ -65,6 +65,10 @@ Display usage message. Get the names of the postscripts and postbootscripts for the given node and pack them into the image. +=item B<-R|--remotehost> I + +Export the image to remote host. Passwordless ssh must be setup to the remote host. + =item B<-v|--verbose> Verbose output. @@ -92,7 +96,7 @@ The output bundle file name. imgexport foo -foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport if you have a big image to tar up. +foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport, if you have a big image to tar up. 2. To include extra files with your image: diff --git a/xCAT-client/pods/man1/imgimport.1.pod b/xCAT-client/pods/man1/imgimport.1.pod index 1c1891485..e49df3ec8 100644 --- a/xCAT-client/pods/man1/imgimport.1.pod +++ b/xCAT-client/pods/man1/imgimport.1.pod @@ -6,7 +6,7 @@ B - Imports an xCAT image or configuration file into the xCAT tables B -B I [B<-p>|B<--postscripts> I] [B<-f>|B<--profile> I] [B<-v>|B<--verbose>] +B I [B<-p>|B<--postscripts> I] [B<-f>|B<--profile> I] [B<-R>|B<--remotehost> I] [B<-v>|B<--verbose>] =head1 DESCRIPTION @@ -82,6 +82,10 @@ Display usage message. Import the postscripts. The postscripts contained in the image will be set in the postscripts table for I. +=item B<-R|--remotehost> I + +Import the image from remote host. Passwordless ssh must be setup to the remote host. + =item B<-v|--verbose> Verbose output. diff --git a/xCAT-server/lib/xcat/plugins/imgport.pm b/xCAT-server/lib/xcat/plugins/imgport.pm index 8a8a9057e..ee1749fba 100644 --- a/xCAT-server/lib/xcat/plugins/imgport.pm +++ b/xCAT-server/lib/xcat/plugins/imgport.pm @@ -123,7 +123,7 @@ sub ximport { 'R|remotehost=s' => \$remoteHost, 'p|postscripts=s' => \$nodes, 'f|profile=s' => \$new_profile, - 'n|nozip' => \$nozip + 'n|nozip' => \$nozip ); if ($help) { @@ -131,8 +131,14 @@ sub ximport { return; } - # first extract the bundle - extract_bundle($request, $callback, $nodes, $new_profile, $remoteHost, $nozip ); + if ($#ARGV == -1) { + # if no arguments left after processing the options, then bundle name is missing + $xusage->(1); + } else { + # first extract the bundle + my $bundle = shift @ARGV; + extract_bundle($request, $callback, $bundle, $nodes, $new_profile, $remoteHost, $nozip ); + } } @@ -1067,10 +1073,10 @@ sub make_bundle { if (defined $remoteHost) { my $remoteFile = $remoteHost . ':' . $remoteDest; - $callback->({ data => ["Moving the image bundle to the remote system location $remoteDest"] }); + $callback->({ data => ["Moving the image bundle to the remote system location $remoteFile"] }); $rc = system("/usr/bin/scp -B $dest $remoteFile"); if ($rc) { - $callback->({ error => ["Unable to copy the image bundle $bundleName to the remote host"], errorcode => [1] }); + $callback->({ error => ["Unable to copy the image bundle $bundleName to the remote host (Maybe passwordless ssh was not setup?)"], errorcode => [1] }); } } } @@ -1114,20 +1120,18 @@ sub extract_bundle { #print Dumper($request); my $callback = shift; + my $bundle = shift; my $nodes = shift; my $new_profile = shift; my $remoteHost = shift; my $nozip = shift; - @ARGV = @{ $request->{arg} }; my $xml; my $data; my $datas; my $error = 0; my $bundleCopy; - my $bundle = shift @ARGV; - # Determine the current working directory. my $dir = $request->{cwd}; #getcwd; $dir = $dir->[0]; @@ -1152,10 +1156,10 @@ sub extract_bundle { my $remoteFile = "$remoteHost:$bundle"; $bundleCopy = `/bin/mktemp $workDir/imgimport.$$.XXXXXX`; chomp($bundleCopy); - $callback->({ data => ["Obtaining the image bundle from the remote system"] }); + $callback->({ data => ["Obtaining the image bundle from the remote system $remoteFile"] }); my $rc = system("/usr/bin/scp -v -B $remoteFile $bundleCopy"); if ($rc != 0) { - $callback->({ error => ["Unable to copy the image bundle $bundle from the remote host"], errorcode => [1] }); + $callback->({ error => ["Unable to copy the image bundle $bundle from the remote host (Maybe passwordless ssh was not setup?)"], errorcode => [1] }); $rc = system("rm -rf $bundleCopy"); if ($rc) { $callback->({ error => ["Failed to remove the local copy of the remote image bundle $bundleCopy"], errorcode => [1] }); From 77e80ac3e343e43de081e2a266cbd1504e3f1ce0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 26 Jun 2020 10:31:29 -0400 Subject: [PATCH 15/95] More improvements to go-xcat testcases --- xCAT-test/autotest/testcase/go_xcat/case3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index dd7b22185..c0170de2b 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -131,7 +131,7 @@ check:output=~running #Update to devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y update" cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT updated successfully first time"; else echo "First attempt to update xCAT failed, attempting to update xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y update"; fi -check:output=~"xCAT updated successfully first time"|"xCAT has been successfully updated" +check:output=~xCAT updated successfully first time|xCAT has been successfully updated cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -191,8 +191,8 @@ check:output=~could not be found|dead|no such service xcatd #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y --xcat-version=devel install"; fi +check:output=~xCAT updated successfully first time|xCAT has been successfully updated cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" check:rc==0 cmd:xdsh $$CN "service xcatd status" From 2e354aead8f0e0c58e7805d859e83778feeb6fb0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 30 Jun 2020 09:15:04 -0400 Subject: [PATCH 16/95] go-xcat testcase output fix --- xCAT-test/autotest/testcase/go_xcat/case3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index c0170de2b..7af0f0b10 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -192,7 +192,7 @@ check:output=~could not be found|dead|no such service xcatd #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y --xcat-version=devel install"; fi -check:output=~xCAT updated successfully first time|xCAT has been successfully updated +check:output=~xCAT installed successfully first time|xCAT has been installed cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" check:rc==0 cmd:xdsh $$CN "service xcatd status" From 28859192dd9e0f2d0a1356bd6c029c0b94bddc30 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 30 Jun 2020 16:39:59 -0400 Subject: [PATCH 17/95] Do not modify install nic interface --- .../manage_clusters/common/deployment/enable_kdump.rst | 2 ++ xCAT/postscripts/enablekdump | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst index cc639b4b0..1e05e67da 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst @@ -166,6 +166,8 @@ Appedix * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/kernel_crash_dump_guide/sect-kdump-config-cli. + * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/system_design_guide/installing-and-configuring-kdump_system-design-guide + #. OS Documentation on dump analysis: * http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-kdump-crash.htmlRHELdocument diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 30349eb48..80c5b1732 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -58,11 +58,6 @@ if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then echo "ONBOOT=yes" >> $CONFFILE echo "IPADDR=$IP" >> $CONFFILE echo "NETMASK=$MASK" >> $CONFFILE - else - echo "DEVICE=$ETHX" > $CONFFILE - echo "BOOTPROTO=dhcp" >> $CONFFILE - echo "HWADDR=$MACX" >> $CONFFILE - echo "ONBOOT=yes" >> $CONFFILE fi fi From 754af5ce391052ee4de104bac32c58c141496457 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 30 Jun 2020 16:57:52 -0400 Subject: [PATCH 18/95] Add dns to install nic --- xCAT/postscripts/configeth | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 76f1ce2a2..6644600e7 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -524,6 +524,7 @@ elif [ "$1" = "-s" ];then str_inst_mask='' str_inst_gateway='' str_inst_mtu='' + str_inst_dns='' if [ "$str_os_type" = "aix" ];then log_error "configeth on $NODE: aix does not support -s flag" exit 1 @@ -578,6 +579,7 @@ elif [ "$1" = "-s" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` + str_inst_dns=`grep domain-name-servers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` else if [ -n "$MACADDRESS" ];then str_inst_mac=$MACADDRESS @@ -734,6 +736,11 @@ elif [ "$1" = "-s" ];then if [ $networkmanager_active -eq 2 ]; then echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file fi + if [ -n "${str_inst_dns}" ];then + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name ipv4.dns ${str_inst_dns} + fi + fi if [ -n "${str_inst_mtu}" ];then if [ $networkmanager_active -eq 1 ]; then nmcli con modify $con_name mtu ${str_inst_mtu} From 74c305f1f4c1e4210583d3af7ad7cdfa654ac9df Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 30 Jun 2020 17:03:39 -0400 Subject: [PATCH 19/95] modify kdump analysis link --- .../manage_clusters/common/deployment/enable_kdump.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst index 1e05e67da..55bf9daa2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst @@ -170,5 +170,5 @@ Appedix #. OS Documentation on dump analysis: - * http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-kdump-crash.htmlRHELdocument + * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s1-kdump-crashdd From bb09d801df08f41d45d8f1bd487c1fd3275fdd7d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 8 Jul 2020 13:59:33 -0400 Subject: [PATCH 20/95] Enable clusterstatus xcatprobe on Perl 5.23 --- xCAT-probe/subcmds/clusterstatus | 10 ++++++---- xCAT-probe/subcmds/code_template | 2 +- xCAT-server/share/xcat/tools/powervm/configvios | 12 ++++++------ xCAT-server/share/xcat/tools/xCATreg | 4 ++-- xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle | 1 + xCAT-test/autotest/bundle/rhels_x86_weekly.bundle | 1 + xCAT/postscripts/check_mlnx_firmware | 2 +- xCAT/postscripts/enablecapi | 2 +- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/xCAT-probe/subcmds/clusterstatus b/xCAT-probe/subcmds/clusterstatus index d847ff771..f04955c3a 100755 --- a/xCAT-probe/subcmds/clusterstatus +++ b/xCAT-probe/subcmds/clusterstatus @@ -45,6 +45,8 @@ my %type_nodesnum = (); # matching --> matched --> installing --> booting --> booted # matching --> matched --> booting --> installing --> xxx --> booted # The terminal state is configured(For PDU/Switch) or booted(for Node) +# matching means node found matching the range, but no status attribute value +# matched means node found matching the range, with mac attribute value, but no status attribute value #----------------------------- my %state_node_hash = (); @@ -240,7 +242,7 @@ sub update_nodes_info { foreach (@unmatched_nodes_attributes) { if (/^(.*):\s*mac=(.*)$/) { if ($2) { - update_node_info($1, "Matched"); + update_node_info($1, "matched (no status)"); } } } @@ -279,7 +281,7 @@ sub update_node_info { if (exists($state_node_hash{$node_type}{$node_state}{$node})) { delete($state_node_hash{$node_type}{$node_state}{$node}); } - unless (scalar keys ($state_node_hash{$node_type}{$node_state})) { + unless (scalar keys (%{$state_node_hash{$node_type}{$node_state}})) { delete($state_node_hash{$node_type}{$node_state}); } @@ -307,10 +309,10 @@ sub check_nodes_attributes { $node_info{$_}{state} = $nodehash{$_}{status}; $unfinished_nodes{$_} = 1; } elsif ($nodehash{$_}{mac}) { - $node_info{$_}{state} = "Matched"; + $node_info{$_}{state} = "matched (no status)"; $unfinished_nodes{$_} = 1; } else { - $node_info{$_}{state} = "matching"; + $node_info{$_}{state} = "matching (no status, no mac)"; $unmatched_nodes{$_} = 1; } if ($nodehash{$_}{mgt} eq 'pdu') { diff --git a/xCAT-probe/subcmds/code_template b/xCAT-probe/subcmds/code_template index ed9ffdd46..87759ae83 100755 --- a/xCAT-probe/subcmds/code_template +++ b/xCAT-probe/subcmds/code_template @@ -144,7 +144,7 @@ if ($help) { } if ($test) { - probe_utils->send_msg("$output", "o", "This isn't a probe tool, this is just a template for sub command coding. Using it to develop sub command which need to cover hierarchical cluster"); + probe_utils->send_msg("$output", "o", "This isn't a probe tool, this is just a template for sub command coding. Use it to develop sub command which need to cover hierarchical cluster"); exit 0; } diff --git a/xCAT-server/share/xcat/tools/powervm/configvios b/xCAT-server/share/xcat/tools/powervm/configvios index 6f6aa49d9..28cd3e80b 100755 --- a/xCAT-server/share/xcat/tools/powervm/configvios +++ b/xCAT-server/share/xcat/tools/powervm/configvios @@ -139,7 +139,7 @@ sub get_cmd foreach (@hdisk) { - `lspv|grep $_ >/dev/nul 2>&1`; + `lspv|grep $_ >/dev/null 2>&1`; $err++ if ($? != 0) } @@ -152,7 +152,7 @@ sub get_cmd next; } - `lsvg $key > /dev/nul 2>&1`; + `lsvg $key > /dev/null 2>&1`; if ($? == 0) { #print "Invalid configuration item $key: vg $key already existed\n"; @@ -193,7 +193,7 @@ sub get_cmd next; } - `su - padmin " -c ioscli lslv $conf[0]" > /dev/nul 2>&1`; + `su - padmin " -c ioscli lslv $conf[0]" > /dev/null 2>&1`; if ($? == 0) { #print "Invalid configuration item $key:the lv name $conf[0] already existed\n"; @@ -203,7 +203,7 @@ sub get_cmd next; } - `su - padmin " -c ioscli lsvg $conf[1]" > /dev/nul 2>&1`; + `su - padmin " -c ioscli lsvg $conf[1]" > /dev/null 2>&1`; if ($? != 0) { #print "Invalid configuration item $key:the vg $conf[1] doesn't exist\n"; @@ -242,7 +242,7 @@ sub get_cmd print "Mapping logical volumes to virtual adapters..."; while (my ($key, $value) = each %config) { - `su - padmin " -c ioscli lslv $value" > /dev/nul 2>&1`; + `su - padmin " -c ioscli lslv $value" > /dev/null 2>&1`; if ($? != 0) { #print "Invalid configuration item $key: lv $value doesn't exist\n"; @@ -252,7 +252,7 @@ sub get_cmd next; } - `su - padmin " -c ioscli lsdev -virtual |grep $key " >/dev/nul 2>&1`; + `su - padmin " -c ioscli lsdev -virtual |grep $key " >/dev/null 2>&1`; if ($? != 0) { #print "Invaild configuration item $key: virtual adapter $key doesn't exist\n"; diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index 92d610f5b..89ea7e23d 100755 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -1173,7 +1173,7 @@ sub send_email { sub git_update { send_msg(2, "[git update] starting to update xcat source code from git"); - my $res = system("cd $xcatcoredir && git checkout $branch > /dev/nul 2>&1"); + my $res = system("cd $xcatcoredir && git checkout $branch > /dev/null 2>&1"); if ($res != 0) { send_msg(0, "[git update] change to branch $branch....[failed]"); return 2; @@ -1198,7 +1198,7 @@ sub git_update { return 2; } - $res = system("grep 'Already up-to-date' $gitpulloutput > /dev/nul 2>&1"); + $res = system("grep 'Already up-to-date' $gitpulloutput > /dev/null 2>&1"); if ($res == 0 && !$forceregwithoutupdate) { send_msg(2, "[git update] code is already at latest version. exit regresson"); return 1; diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index e8b5b87d9..996fe5c4d 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -17,6 +17,7 @@ bmcdiscover_range_z bmcdiscover_help bmcdiscover_q bmcdiscover_version +xcatprobe_work confignetwork_static_installnic get_xcat_postscripts_loginfo nodeset_cmdline diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index 267fabddb..3dcc8e1ee 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -17,6 +17,7 @@ bmcdiscover_range_z bmcdiscover_help bmcdiscover_q bmcdiscover_version +xcatprobe_work confignetwork_static_installnic get_xcat_postscripts_loginfo nodeset_cmdline diff --git a/xCAT/postscripts/check_mlnx_firmware b/xCAT/postscripts/check_mlnx_firmware index 560c11436..79cc966b5 100755 --- a/xCAT/postscripts/check_mlnx_firmware +++ b/xCAT/postscripts/check_mlnx_firmware @@ -6,7 +6,7 @@ # BINARIES="ofed_info mst ibdev2netdev" for PROG in ${BINARIES}; do - RC=`command -v ${PROG} >> /dev/nul 2>&1; echo $?` + RC=`command -v ${PROG} >> /dev/null 2>&1; echo $?` if [[ ${RC} != 0 ]]; then echo "${PROG} is not installed on this node, unable to check firmware levels." exit 1 diff --git a/xCAT/postscripts/enablecapi b/xCAT/postscripts/enablecapi index 64a67158b..abe114bb8 100644 --- a/xCAT/postscripts/enablecapi +++ b/xCAT/postscripts/enablecapi @@ -29,7 +29,7 @@ function logerr { #check if mlnx ofed commands are installed COMMANDS="ofed_info mst mlxconfig" for CMD in ${COMMANDS}; do - RC=`command -v ${CMD} >> /dev/nul 2>&1; echo $?` + RC=`command -v ${CMD} >> /dev/null 2>&1; echo $?` if [[ ${RC} != 0 ]]; then ERRMSG="Command: ${CMD} is not found, unable to run the scripts" logerr $ERRMSG From 5096a73760a4273ed6cbfe7e663b0af2e3bf0b0d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 10 Jul 2020 09:52:15 -0400 Subject: [PATCH 21/95] Update pgsqlsetup command and related docs --- .../hierarchy/databases/postgres_remove.rst | 10 ++++++---- .../admin-guides/references/man1/pgsqlsetup.1.rst | 14 +++++++------- xCAT-client/bin/pgsqlsetup | 2 +- xCAT-client/pods/man1/pgsqlsetup.1.pod | 14 +++++++------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/docs/source/advanced/hierarchy/databases/postgres_remove.rst b/docs/source/advanced/hierarchy/databases/postgres_remove.rst index 245018853..ea91a7923 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_remove.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_remove.rst @@ -1,7 +1,9 @@ -Removing ``xcatdb`` from PostgreSQL -=================================== +Removing ``xcatdb`` from PostgreSQL and restoring data into SQLite +================================================================== -To remove ``xcatdb`` completely from the PostgreSQL database: +.. note. If you are using *xCAT Hierarchy (service nodes)* and removing ``xcatdb`` from postgres, hierarchy will no longer work. You will need to configure another database which supports remote database access to continue using the hierarchy feature. :: + +To remove ``xcatdb`` completely from the PostgreSQL database and restore xCAT data into SQLite: #. Run a backup of the database to save any information that is needed: :: @@ -9,7 +11,6 @@ To remove ``xcatdb`` completely from the PostgreSQL database: dumpxCATdb -p ~/xcat-dbback #. Stop the ``xcatd`` daemon on the management node. - **Note:** If you are using *xCAT Hierarchy (service nodes)* and removing ``xcatdb`` from postgres, hierarchy will no longer work. You will need to configure another database which supports remote database access to continue using the hierarchy feature. :: service xcatd stop @@ -29,6 +30,7 @@ To remove ``xcatdb`` completely from the PostgreSQL database: cd /var/lib/pgsql/data rm -rf * + exit #. Move, or remove, the ``/etc/xcat/cfglog`` file as it points xCAT to PostgreSQL. (without this file, xCAT defaults to SQLite): :: diff --git a/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst b/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst index 6a64febc3..7aa5d849d 100644 --- a/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst +++ b/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst @@ -33,8 +33,8 @@ DESCRIPTION *********** -\ **pgsqlsetup**\ - Sets up the PostgreSQL database for xCAT to use. The pgsqlsetup script is run on the Management Node as root after the PostgreSQL code has been installed. The xcatd daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the xcatd daemon as well as the PostgreSQL daemon. For full information on all the steps that will be done reference -One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password and then there will be no prompt. +\ **pgsqlsetup**\ - Sets up the PostgreSQL database for xCAT to use. The \ **pgsqlsetup**\ script is run on the Management Node as root after the PostgreSQL has been installed. The \ **xcatd**\ daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the \ **xcatd**\ daemon as well as the PostgreSQL daemon. +One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password in order to avoid the prompt. ******* @@ -63,17 +63,17 @@ OPTIONS \ **-i|-**\ **-init**\ - The init option is used to setup an installed PostgreSQL database so that xCAT can use the database. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the PostgreSQL database and restarts the xcatd daemon using the database. - On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init. - To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the -a option. + The \ **-**\ **-init**\ option is used to setup an installed PostgreSQL database so that xCAT can use it. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the \ **xcatd**\ daemon to the PostgreSQL database and restarts the \ **xcatd**\ daemon using the database. + On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the \ **-o**\ option, to run after the init. + To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the \ **-a**\ option. - For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB + For more documentation see: \ **-N|-**\ **-nostart**\ - This option with the -i flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of xcatd will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. + This option with the \ **-i**\ flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of \ **xcatd**\ will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. diff --git a/xCAT-client/bin/pgsqlsetup b/xCAT-client/bin/pgsqlsetup index b5b85b611..f6cd6c126 100755 --- a/xCAT-client/bin/pgsqlsetup +++ b/xCAT-client/bin/pgsqlsetup @@ -318,7 +318,7 @@ if (($INIT) && ($xcatrunningpgsql == 0)) # if that does not exist use resolved hostname # double check site.master for resolution my $sitefile = "$::backupdir/site.csv"; - my $cmd = "grep master $sitefile"; + my $cmd = "grep \"master $sitefile"; my @output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC == 0) # entry in site table { diff --git a/xCAT-client/pods/man1/pgsqlsetup.1.pod b/xCAT-client/pods/man1/pgsqlsetup.1.pod index 20a607912..095abad99 100644 --- a/xCAT-client/pods/man1/pgsqlsetup.1.pod +++ b/xCAT-client/pods/man1/pgsqlsetup.1.pod @@ -15,8 +15,8 @@ B {B<-o> | B<--setupODBC>} [B<-V> | B<--verbose>] =head1 DESCRIPTION -B - Sets up the PostgreSQL database for xCAT to use. The pgsqlsetup script is run on the Management Node as root after the PostgreSQL code has been installed. The xcatd daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the xcatd daemon as well as the PostgreSQL daemon. For full information on all the steps that will be done reference -One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password and then there will be no prompt. +B - Sets up the PostgreSQL database for xCAT to use. The B script is run on the Management Node as root after the PostgreSQL has been installed. The B daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the B daemon as well as the PostgreSQL daemon. +One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password in order to avoid the prompt. =head1 OPTIONS @@ -36,15 +36,15 @@ Displays verbose messages. =item B<-i|--init> -The init option is used to setup an installed PostgreSQL database so that xCAT can use the database. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the PostgreSQL database and restarts the xcatd daemon using the database. -On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init. -To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the -a option. +The B<--init> option is used to setup an installed PostgreSQL database so that xCAT can use it. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the B daemon to the PostgreSQL database and restarts the B daemon using the database. +On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the B<-o> option, to run after the init. +To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the B<-a> option. -For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB +For more documentation see: =item B<-N|--nostart> -This option with the -i flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of xcatd will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. +This option with the B<-i> flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of B will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. =item B<-l|--listen> I
From 2e8ab98304e8a78aee87a2ac58edbfe21270d2e0 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 10 Jul 2020 14:17:59 -0400 Subject: [PATCH 22/95] geninitrd failed to load new driver rpm packages --- xCAT-server/lib/xcat/plugins/anaconda.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 24546a08d..10e586dab 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2547,7 +2547,7 @@ sub insert_dd { # dracut + drvier rpm # !dracut + driver rpm # !dracut + driver disk - if (!<$install_dir/$os/$arch/Packages/dracut*> || (@rpm_list && ($Injectalldriver || $updatealldriver || @driver_list))) { + if (!(&using_dracut($os)) || (@rpm_list && ($Injectalldriver || $updatealldriver || @driver_list))) { mkpath "$dd_dir/initrd_img"; # The dir for the new initrd # unzip the initrd image @@ -2695,7 +2695,7 @@ sub insert_dd { # If the os has dracut rpm packet, then copy the drivers to the /lib/modules/ # and recreate the dependency by the depmod command - if (<$install_dir/$os/$arch/Packages/dracut*>) { #rh6, fedora13 ... + if (&using_dracut($os)) { #rh6 above, fedora13 ... # For dracut mode, only copy the drivers from rpm packages to the /lib/modules/ # The driver disk will be handled that append the whole disk to the orignial initrd @@ -3241,7 +3241,7 @@ EOMS } # dracut + driver disk, just append the driver disk to the initrd - if (<$install_dir/$os/$arch/Packages/dracut*> && @dd_list) { #new style, skip the fanagling, copy over the dds and append them... + if ( (&using_dracut($os)) && @dd_list) { #new style, skip the fanagling, copy over the dds and append them... mkpath("$dd_dir/dd"); if (scalar(@dd_list) == 1) { #only one, just append it.. copy($dd_list[0], "$dd_dir/dd/dd.img"); From b0ca367d51610f673a76da43e17426758bc14c35 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 14 Jul 2020 11:13:59 -0400 Subject: [PATCH 23/95] xdsh related documentation updates --- .../references/man1/updatenode.1.rst | 2 +- .../admin-guides/references/man1/xdsh.1.rst | 60 +++++++++---------- .../references/man1/xdshbak.1.rst | 14 ++--- .../references/man1/xdshcoll.1.rst | 8 +-- xCAT-client/pods/man1/updatenode.1.pod | 2 +- xCAT-client/pods/man1/xdsh.1.pod | 60 +++++++++---------- xCAT-client/pods/man1/xdshbak.1.pod | 14 ++--- xCAT-client/pods/man1/xdshcoll.1.pod | 8 +-- 8 files changed, 84 insertions(+), 84 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 0b64d2314..f21e24c45 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -452,7 +452,7 @@ OPTIONS The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. This is not supported in a hierarchical cluster, that is the node is serviced by a service node. - See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. + See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for required xcat/sudo setup. diff --git a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst index 1bedf8c7f..f34c84a6b 100644 --- a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst @@ -43,7 +43,7 @@ The \ **xdsh**\ command runs commands in parallel on remote nodes and/or the Ma remote shell command for each target specified, and returns the output from all targets, formatted so that command results from all nodes can be managed. -If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the xcatconfig -m option. +If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the \ **xcatconfig -m**\ option. The \ **xdsh**\ command is an xCAT Distributed Shell Utility. \ **COMMAND**\ \ **SPECIFICATION**\ : @@ -176,8 +176,8 @@ the commands executing on the remote targets. Signal 19 (CONT), Signal 17 (STOP), and Signal 18 (TSTP) default to \ **xdsh**\ ; the \ **xdsh**\ command responds normally to these signals, but the signals do not have an effect on remotely executing commands. Other -signals are caught by \ **xdsh**\ and have their default effects on the \ **xdsh**\ -command; all current child processes, through propagation to remotely +signals are caught by \ **xdsh**\ and have their default effects on the \ **xdsh**\ command; +all current child processes, through propagation to remotely running commands, are terminated (SIGTERM). @@ -195,13 +195,13 @@ running commands, are terminated (SIGTERM). \ **-c | -**\ **-cleanup**\ - This flag will have xdsh remove all files from the subdirectories of the - the directory on the servicenodes, where xdcp stages the copy to the + This flag will have \ **xdsh**\ remove all files from the subdirectories of the + the directory on the service nodes, where \ **xdcp**\ stages the copy to the compute nodes as defined in the site table SNsyncfiledir and nodesyncfiledir attribute, when the target is a service node. It can also be used to remove the nodesyncfiledir directory on the compute - nodes, which keeps the backup copies of files for the xdcp APPEND function + nodes, which keeps the backup copies of files for the \ **xdcp**\ APPEND function support, if a compute node is the target. @@ -234,7 +234,7 @@ running commands, are terminated (SIGTERM). for Ethernet switches and and IB switches under \ */opt/xcat/share/xcat/devicetype*\ directory. If you want to overwrite any of the configuration files, copy them to \ */var/opt/xcat/*\ - directory and cutomize. + directory and customize. For example, \ *base/IBSwitch/Qlogic/config*\ is the configuration file location if devicetype is specified as IBSwitch::Qlogic. xCAT will first search config file using \ */var/opt/xcat/*\ as the base. @@ -258,10 +258,10 @@ running commands, are terminated (SIGTERM). \ **-i | -**\ **-rootimg**\ \ *install image*\ For Linux, Specifies the path to the install image on the local node. - For AIX, specifies the name of the osimage on the local node. Run lsnim + For AIX, specifies the name of the osimage on the local node. Run \ **lsnim**\ for valid names. - xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the - install image. No other xdsh flags, environment variables apply with + \ **xdsh**\ will \ **chroot**\ (\ **xcatchroot**\ for AIX) to this path and run the \ **xdsh**\ command against the + install image. No other \ **xdsh**\ flags, environment variables apply with this input. A noderange is not accepted. Only runs on the local host, normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that \ **xdsh**\ hangs. @@ -277,9 +277,9 @@ running commands, are terminated (SIGTERM). The userid must have the same uid, gid and password as the userid on the node where the keys will be setup. - If the current user is root, roots public ssh keys will be put in the + If the current user is root, root's public ssh keys will be put in the authorized_keys\* files under roots .ssh directory on the node(s). - If the current user is non-root, the user must be in the policy table and have credential to run the xdsh command. + If the current user is non-root, the user must be in the policy table and have credential to run the \ **xdsh**\ command. The non-root users public ssh keys and root's public ssh keys will be put in the authorized_keys\* files under the non-root users .ssh directory on the node(s). Other device types, such as IB switch, are also supported. The @@ -344,8 +344,8 @@ running commands, are terminated (SIGTERM). \ **-s | -**\ **-stream**\ Specifies that output is returned as it becomes available - from each target, instead of waiting for the \ *command_list*\ - to be completed on a target before returning output. + from each target, instead of waiting for the \ *command_list*\ to + be completed on a target before returning output. @@ -358,17 +358,17 @@ running commands, are terminated (SIGTERM). \ **-**\ **-sudo**\ - Adding the \ **-**\ **-sudo**\ flag to the xdsh command will have xdsh run sudo before + Adding the \ **-**\ **-sudo**\ flag to the \ **xdsh**\ command will have \ **xdsh**\ run \ **sudo**\ before running the command. This is particular useful when using the \ **-e**\ option. This is required when you input \ **-l**\ with a non-root user id and want that id to be able to run as root on the node. The non-root userid will must be previously defined as an xCAT user, see process for defining non-root ids in - xCAT and setting up for using xdsh. The userid sudo setup will have + xCAT and setting up for using \ **xdsh**\ . The userid \ **sudo**\ setup will have to be done by the admin on the node. This includes, allowing all commands that - you would like to run with xdsh by using visudo to edit the /etc/sudoers file. - You must disabl ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". - See the document Granting_Users_xCAT_privileges for sudo setup requirements. - This is not supported in a hierarical cluster, that is the nodes are serviced by servicenodes. + you would like to run with \ **xdsh**\ by using \ **visudo**\ to edit the /etc/sudoers file. + You must disable ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". + See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for \ **sudo**\ setup requirements. + This is not supported in a hierarchical cluster, where the nodes are serviced by service nodes. @@ -417,7 +417,7 @@ running commands, are terminated (SIGTERM). string, all \ **xdsh**\ environment variables will be ignored. This option is useful when running \ **xdsh**\ from within other scripts when you don't want the user's environment affecting - the behavior of xdsh. + the behavior of \ **xdsh**\ . @@ -510,7 +510,7 @@ running commands, are terminated (SIGTERM). \ **DSH_REMOTE_PASSWORD**\ If \ **DSH_REMOTE_PASSWORD**\ is set to the password of the - userid (usually root) that will ssh to the node, then when + userid (usually root) that will \ **ssh**\ to the node, then when you use the \ **-K**\ flag, you will not be prompted for a password. @@ -563,7 +563,7 @@ error is displayed and execution is bypassed for a remote target if password prompting occurs, or if either authorization or authentication to the remote target fails. Security configurations as they pertain to the remote environment and remote shell command are -userdefined. +user defined. ******************* @@ -571,7 +571,7 @@ userdefined. ******************* -The \ **xdsh**\ command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. +The \ **xdsh**\ command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal \ **dsh**\ errors occur or the remote shell commands do not complete successfully, the \ **dsh**\ command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. **************** @@ -600,7 +600,7 @@ The \ **xdsh**\ command exit code is 0 if the command executed without errors a -3. To run the \ **ps**\ command on node targets \ **node1**\ and run the remote command with the -v and -t flag, enter: +3. To run the \ **ps**\ command on node targets \ **node1**\ and run the remote command with the \ **-v**\ and \ **-t**\ flag, enter: .. code-block:: perl @@ -621,7 +621,7 @@ context on several node targets, with a fanout of \ **1**\ , enter: -5. To run the ps command on node1 and ignore all the dsh +5. To run the \ **ps**\ command on node1 and ignore all the \ **dsh**\ environment variable except the DSH_NODE_OPTS, enter: @@ -632,7 +632,7 @@ environment variable except the DSH_NODE_OPTS, enter: -6. To run on Linux, the xdsh command "rpm -qa | grep xCAT" +6. To run on Linux, the \ **xdsh**\ command \ **rpm -qa | grep xCAT**\ on the service node fedora9 diskless image, enter: @@ -643,7 +643,7 @@ on the service node fedora9 diskless image, enter: -7. To run on AIX, the xdsh command "lslpp -l | grep bos" on the NIM 611dskls spot, enter: +7. To run on AIX, the \ **xdsh**\ command \ **lslpp -l | grep bos**\ on the NIM 611dskls spot, enter: .. code-block:: perl @@ -653,7 +653,7 @@ on the service node fedora9 diskless image, enter: -8. To cleanup the servicenode directory that stages the copy of files to the nodes, enter: +8. To cleanup the service node directory that stages the copy of files to the nodes, enter: .. code-block:: perl @@ -722,7 +722,7 @@ on the service node fedora9 diskless image, enter: -13. To run \ **xdsh**\ with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: +13. To run \ **xdsh**\ with the non-root userid "user1" that has been setup as an xCAT userid and with \ **sudo**\ on node1 and node2 to run as root, do the following, see xCAT doc https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst b/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst index efab1abda..5fbe0cf3a 100644 --- a/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst @@ -27,8 +27,8 @@ DESCRIPTION *********** -The \ **xdshbak**\ command formats output from the \ **xdsh**\ command. The \ **xdshbak**\ -command takes, as input, lines in the following format: +The \ **xdshbak**\ command formats output from the \ **xdsh**\ command. +The \ **xdshbak**\ command takes, as input, lines in the following format: .. code-block:: perl @@ -73,11 +73,11 @@ When output is displayed from more than one node in collapsed form, the host names are displayed alphabetically. When output is not collapsed, output is displayed sorted alphabetically by host name. -If the \ **-q**\ quiet flag is not set then \ **xdshbak**\ -command writes "." for each 1000 lines of output processed (to show progress), +If the \ **-q**\ quiet flag is not set then \ **xdshbak**\ command +writes "." for each 1000 lines of output processed (to show progress), since it won't display the output until it has processed all of it. -If the \ **-x**\ flag is specified, the extra header lines that xdshbak normally +If the \ **-x**\ flag is specified, the extra header lines that \ **xdshbak**\ normally displays for each node will be omitted, and the hostname at the beginning of each line is not stripped off, but \ **xdshbak**\ still sorts the output by hostname for easier viewing: @@ -128,9 +128,9 @@ OPTIONS \ **-x**\ - Omit the extra header lines that xdshbak normally displays for + Omit the extra header lines that \ **xdshbak**\ normally displays for each node. This provides - more compact output, but xdshbak still sorts the output by + more compact output, but \ **xdshbak**\ still sorts the output by node name for easier viewing. This option should not be used with \ **-c**\ . diff --git a/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst b/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst index 0e1b13487..3c47c1837 100644 --- a/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst @@ -11,7 +11,7 @@ xdshcoll.1 ************ -\ **xdshcoll**\ - Formats and consolidates the output of the \ **xdsh,sinv**\ commands. +\ **xdshcoll**\ - Formats and consolidates the output of the \ **xdsh, sinv**\ commands. **************** @@ -27,7 +27,7 @@ xdshcoll.1 ******************* -The \ **xdshcoll**\ command formats and consolidates output from the \ **xdsh,sinv**\ command. The \ **xdshcoll**\ +The \ **xdshcoll**\ command formats and consolidates output from the \ **xdsh, sinv**\ commands. The \ **xdshcoll**\ command takes, as input, lines in the following format: host_name: line of output from remote command @@ -75,12 +75,12 @@ is identical: 1. To display the results of a command issued on several nodes, in -the format used in the Description, enter: +the format shown in the Description, enter: .. code-block:: perl - xdsh node1,node2,node3 cat /etc/passwd> | B diff --git a/xCAT-client/pods/man1/xdsh.1.pod b/xCAT-client/pods/man1/xdsh.1.pod index c5572ca91..190884232 100644 --- a/xCAT-client/pods/man1/xdsh.1.pod +++ b/xCAT-client/pods/man1/xdsh.1.pod @@ -24,7 +24,7 @@ The B command runs commands in parallel on remote nodes and/or the Managem remote shell command for each target specified, and returns the output from all targets, formatted so that command results from all nodes can be managed. -If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the xcatconfig -m option. +If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the B option. The B command is an xCAT Distributed Shell Utility. @@ -159,8 +159,8 @@ the commands executing on the remote targets. Signal 19 (CONT), Signal 17 (STOP), and Signal 18 (TSTP) default to B; the B command responds normally to these signals, but the signals do not have an effect on remotely executing commands. Other -signals are caught by B and have their default effects on the B -command; all current child processes, through propagation to remotely +signals are caught by B and have their default effects on the B command; +all current child processes, through propagation to remotely running commands, are terminated (SIGTERM). =head1 B @@ -173,13 +173,13 @@ Runs in bypass mode, use if the xcatd daemon is hung. =item B<-c>|B<--cleanup> -This flag will have xdsh remove all files from the subdirectories of the -the directory on the servicenodes, where xdcp stages the copy to the +This flag will have B remove all files from the subdirectories of the +the directory on the service nodes, where B stages the copy to the compute nodes as defined in the site table SNsyncfiledir and nodesyncfiledir attribute, when the target is a service node. It can also be used to remove the nodesyncfiledir directory on the compute -nodes, which keeps the backup copies of files for the xdcp APPEND function +nodes, which keeps the backup copies of files for the B APPEND function support, if a compute node is the target. =item B<-e>|B<--execute> @@ -206,7 +206,7 @@ xCAT ships some default configuration files for Ethernet switches and and IB switches under I directory. If you want to overwrite any of the configuration files, copy them to I -directory and cutomize. +directory and customize. For example, I is the configuration file location if devicetype is specified as IBSwitch::Qlogic. xCAT will first search config file using I as the base. @@ -225,10 +225,10 @@ Displays usage information. =item B<-i>|B<--rootimg> I For Linux, Specifies the path to the install image on the local node. -For AIX, specifies the name of the osimage on the local node. Run lsnim +For AIX, specifies the name of the osimage on the local node. Run B for valid names. -xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the -install image. No other xdsh flags, environment variables apply with +B will B (B for AIX) to this path and run the B command against the +install image. No other B flags, environment variables apply with this input. A noderange is not accepted. Only runs on the local host, normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that B hangs. @@ -240,9 +240,9 @@ Set up the SSH keys for the user running the command to the specified node list. The userid must have the same uid, gid and password as the userid on the node where the keys will be setup. -If the current user is root, roots public ssh keys will be put in the +If the current user is root, root's public ssh keys will be put in the authorized_keys* files under roots .ssh directory on the node(s). -If the current user is non-root, the user must be in the policy table and have credential to run the xdsh command. +If the current user is non-root, the user must be in the policy table and have credential to run the B command. The non-root users public ssh keys and root's public ssh keys will be put in the authorized_keys* files under the non-root users .ssh directory on the node(s). Other device types, such as IB switch, are also supported. The @@ -293,8 +293,8 @@ for remote command execution on node targets. =item B<-s>|B<--stream> Specifies that output is returned as it becomes available -from each target, instead of waiting for the I -to be completed on a target before returning output. +from each target, instead of waiting for the I to +be completed on a target before returning output. =item B<-S>|B<--syntax> {B|B} @@ -303,17 +303,17 @@ If not specified, the B syntax is used. =item B<--sudo> -Adding the B<--sudo> flag to the xdsh command will have xdsh run sudo before +Adding the B<--sudo> flag to the B command will have B run B before running the command. This is particular useful when using the B<-e> option. This is required when you input B<-l> with a non-root user id and want that id to be able to run as root on the node. The non-root userid will must be previously defined as an xCAT user, see process for defining non-root ids in -xCAT and setting up for using xdsh. The userid sudo setup will have +xCAT and setting up for using B. The userid B setup will have to be done by the admin on the node. This includes, allowing all commands that -you would like to run with xdsh by using visudo to edit the /etc/sudoers file. -You must disabl ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". -See the document Granting_Users_xCAT_privileges for sudo setup requirements. -This is not supported in a hierarical cluster, that is the nodes are serviced by servicenodes. +you would like to run with B by using B to edit the /etc/sudoers file. +You must disable ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". +See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for B setup requirements. +This is not supported in a hierarchical cluster, where the nodes are serviced by service nodes. =item B<-t>|B<--timeout> I @@ -352,7 +352,7 @@ argument to this option, or the argument is an empty string, all B environment variables will be ignored. This option is useful when running B from within other scripts when you don't want the user's environment affecting -the behavior of xdsh. +the behavior of B. =item B<-z>|B<--exit-status> @@ -428,7 +428,7 @@ remote I is used. =item B If B is set to the password of the -userid (usually root) that will ssh to the node, then when +userid (usually root) that will B to the node, then when you use the B<-K> flag, you will not be prompted for a password. @@ -468,12 +468,12 @@ error is displayed and execution is bypassed for a remote target if password prompting occurs, or if either authorization or authentication to the remote target fails. Security configurations as they pertain to the remote environment and remote shell command are -userdefined. +user defined. =head1 B -The B command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. +The B command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal B errors occur or the remote shell commands do not complete successfully, the B command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. =head1 B @@ -491,7 +491,7 @@ To run the B command on node targets B and B, enter: xdsh node1,node2 "ps -ef" =item 3. -To run the B command on node targets B and run the remote command with the -v and -t flag, enter: +To run the B command on node targets B and run the remote command with the B<-v> and B<-t> flag, enter: xdsh node1,node2 -o "-v -t" ps @@ -502,24 +502,24 @@ context on several node targets, with a fanout of B<1>, enter: xdsh node1,node2 -f 1 -e myfile =item 5. -To run the ps command on node1 and ignore all the dsh +To run the B command on node1 and ignore all the B environment variable except the DSH_NODE_OPTS, enter: xdsh node1 -X `DSH_NODE_OPTS' ps =item 6. -To run on Linux, the xdsh command "rpm -qa | grep xCAT" +To run on Linux, the B command B on the service node fedora9 diskless image, enter: xdsh -i /install/netboot/fedora9/x86_64/service/rootimg "rpm -qa | grep xCAT" =item 7. -To run on AIX, the xdsh command "lslpp -l | grep bos" on the NIM 611dskls spot, enter: +To run on AIX, the B command B on the NIM 611dskls spot, enter: xdsh -i 611dskls "/usr/bin/lslpp -l | grep bos" =item 8. -To cleanup the servicenode directory that stages the copy of files to the nodes, enter: +To cleanup the service node directory that stages the copy of files to the nodes, enter: xdsh servicenoderange -c @@ -559,7 +559,7 @@ If it is for Telnet, add I in front of the user name: I. dsh myswitch --devicetype EthSwitch::BNT 'enable;configure terminal;vlan 3;end;show vlan' =item 13. -To run B with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: +To run B with the non-root userid "user1" that has been setup as an xCAT userid and with B on node1 and node2 to run as root, do the following, see xCAT doc https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges: xdsh node1,node2 --sudo -l user1 "cat /etc/passwd" diff --git a/xCAT-client/pods/man1/xdshbak.1.pod b/xCAT-client/pods/man1/xdshbak.1.pod index c315b2274..a308ba862 100644 --- a/xCAT-client/pods/man1/xdshbak.1.pod +++ b/xCAT-client/pods/man1/xdshbak.1.pod @@ -8,8 +8,8 @@ B [B<-c> | B<-x> [ B<-b> ] | B<-h> | B<-q>] =head1 DESCRIPTION -The B command formats output from the B command. The B -command takes, as input, lines in the following format: +The B command formats output from the B command. +The B command takes, as input, lines in the following format: host_name: line of output from remote command @@ -46,11 +46,11 @@ When output is displayed from more than one node in collapsed form, the host names are displayed alphabetically. When output is not collapsed, output is displayed sorted alphabetically by host name. -If the B<-q> quiet flag is not set then B -command writes "." for each 1000 lines of output processed (to show progress), +If the B<-q> quiet flag is not set then B command +writes "." for each 1000 lines of output processed (to show progress), since it won't display the output until it has processed all of it. -If the B<-x> flag is specified, the extra header lines that xdshbak normally +If the B<-x> flag is specified, the extra header lines that B normally displays for each node will be omitted, and the hostname at the beginning of each line is not stripped off, but B still sorts the output by hostname for easier viewing: @@ -87,9 +87,9 @@ and displayed only once. =item B<-x> -Omit the extra header lines that xdshbak normally displays for +Omit the extra header lines that B normally displays for each node. This provides -more compact output, but xdshbak still sorts the output by +more compact output, but B still sorts the output by node name for easier viewing. This option should not be used with B<-c>. diff --git a/xCAT-client/pods/man1/xdshcoll.1.pod b/xCAT-client/pods/man1/xdshcoll.1.pod index a1209ec58..ae6e9e907 100644 --- a/xCAT-client/pods/man1/xdshcoll.1.pod +++ b/xCAT-client/pods/man1/xdshcoll.1.pod @@ -1,6 +1,6 @@ =head1 B -B - Formats and consolidates the output of the B commands. +B - Formats and consolidates the output of the B commands. =head1 B @@ -8,7 +8,7 @@ B =head1 B -The B command formats and consolidates output from the B command. The B +The B command formats and consolidates output from the B commands. The B command takes, as input, lines in the following format: host_name: line of output from remote command @@ -51,9 +51,9 @@ is identical: =item 1. To display the results of a command issued on several nodes, in -the format used in the Description, enter: +the format shown in the Description, enter: - xdsh node1,node2,node3 cat /etc/passwd> | B Date: Tue, 14 Jul 2020 11:25:54 -0400 Subject: [PATCH 24/95] Add debug to xCAT-probe rpm installation --- xCAT-probe/xCAT-probe.spec | 2 +- xCAT-server/share/xcat/tools/go-xcat | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index eeadb577a..432c78213 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -11,7 +11,7 @@ Vendor: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -Requires: xCAT-client +Requires: xCAT-client = 4:%{version}-%{release} %ifos linux BuildArch: noarch diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 9d8e76abd..c8abf7073 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -172,13 +172,13 @@ GO_XCAT_CORE_PACKAGE_LIST=() GO_XCAT_DEP_PACKAGE_LIST=() # The package list of all the packages should be installed -GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-buildkit xCAT-client +GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT-client xCAT xCAT-buildkit xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && -GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client +GO_XCAT_INSTALL_LIST=(perl-xcat xcat-client xcat xcat-buildkit xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) From 39e4e982bffd3410d369489fdc05c0a34b372888 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 15 Jul 2020 09:26:58 -0400 Subject: [PATCH 25/95] Replace misspelled gpgpcheck with gpgcheck --- xCAT-server/share/xcat/netboot/debian/genimage | 2 +- xCAT-server/share/xcat/netboot/fedora12/genimage | 4 ++-- xCAT-server/share/xcat/netboot/fedora12/geninitrd | 4 ++-- xCAT-server/share/xcat/netboot/mic/genimage | 4 ++-- xCAT-server/share/xcat/netboot/rh/genimage | 8 ++++---- xCAT-server/share/xcat/netboot/rh/genimage.rh4 | 4 ++-- xCAT-server/share/xcat/netboot/sles/genimage.yum | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/debian/genimage b/xCAT-server/share/xcat/netboot/debian/genimage index 40ed5d484..35219e8fd 100755 --- a/xCAT-server/share/xcat/netboot/debian/genimage +++ b/xCAT-server/share/xcat/netboot/debian/genimage @@ -266,7 +266,7 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{ $extra_hash{$pass} })) { if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/fedora12/genimage b/xCAT-server/share/xcat/netboot/fedora12/genimage index 46be3324f..79a578f28 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/genimage +++ b/xCAT-server/share/xcat/netboot/fedora12/genimage @@ -178,7 +178,7 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -263,7 +263,7 @@ unless ($onlyinitrd) { } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/fedora12/geninitrd b/xCAT-server/share/xcat/netboot/fedora12/geninitrd index 62c5a1401..5b2607cdb 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/geninitrd +++ b/xCAT-server/share/xcat/netboot/fedora12/geninitrd @@ -211,7 +211,7 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -279,7 +279,7 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{ $extra_hash{$pass} })) { if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/mic/genimage b/xCAT-server/share/xcat/netboot/mic/genimage index 3b5a49c0b..e93ea2f3f 100755 --- a/xCAT-server/share/xcat/netboot/mic/genimage +++ b/xCAT-server/share/xcat/netboot/mic/genimage @@ -125,7 +125,7 @@ if ($otherpkglist) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$aiddistro-$repnum]\nname=$aiddistro-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$aiddistro-$repnum]\nname=$aiddistro-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -148,7 +148,7 @@ if ($otherpkglist) { } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $repohash{$pass}{$index} = 1; $index++; my $pa = $extra_hash{$pass}{$_}; diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 68be043da..81678065d 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -336,11 +336,11 @@ if($onlyinitrd){ my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } foreach $srcdir (@pkgdir_internet) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } $repnum -= 1; @@ -516,12 +516,12 @@ if($onlyinitrd){ if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next; } foreach(@otherpkgdir_url){ - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; my $pa = $extra_hash{$pass}{$_}; diff --git a/xCAT-server/share/xcat/netboot/rh/genimage.rh4 b/xCAT-server/share/xcat/netboot/rh/genimage.rh4 index 848d88338..97fd3e9de 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage.rh4 +++ b/xCAT-server/share/xcat/netboot/rh/genimage.rh4 @@ -211,7 +211,7 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -285,7 +285,7 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{ $extra_hash{$pass} })) { if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/sles/genimage.yum b/xCAT-server/share/xcat/netboot/sles/genimage.yum index 50fa742d1..acd4c8ffd 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage.yum +++ b/xCAT-server/share/xcat/netboot/sles/genimage.yum @@ -116,14 +116,14 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; #add the section for other packages if ($pkgnames) { - print $yumconfig "[$osver-$arch-otherpkgs]\nname=$osver-$arch-otherpkgs\nbaseurl=file://$srcdir_otherpkgs\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-otherpkgs]\nname=$osver-$arch-otherpkgs\nbaseurl=file://$srcdir_otherpkgs\ngpgcheck=0\n\n"; } close($yumconfig); From 76a57eaae28b651560ea2da5fa55298a3a38c581 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 13 Jun 2019 15:14:07 -0400 Subject: [PATCH 26/95] Remove use of elilo iPXE can directly execute all but the most ancient Linux kernels directly in UEFI boot. Remove the elilo intermediate step. --- xCAT-server/lib/xcat/plugins/xnba.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 88702a0e6..34084daac 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -304,22 +304,22 @@ sub setstate { print $pcfg "imgargs kernel BOOTIF=" . '${netX/mac}' . "\n"; } if ($kern->{initrd}) { - print $pcfg "imgfetch http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; + print $pcfg "imgfetch -n initrd http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; } print $pcfg "imgexec kernel\n"; if ($kern->{kcmdline} and $kern->{initrd}) { #only a linux kernel/initrd pair should land here, write elilo config and uefi variant of xnba config file my $ucfg; open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); print $ucfg "#!gpxe\n"; - print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; - close($ucfg); - open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo"); - print $ucfg 'default="xCAT"' . "\n"; - print $ucfg "delay=0\n\n"; - print $ucfg "image=/tftpboot/" . $kern->{kernel} . "\n"; - print $ucfg " label=\"xCAT\"\n"; - print $ucfg " initrd=/tftpboot/" . $kern->{initrd} . "\n"; - print $ucfg " append=\"" . $elilokcmdline . ' BOOTIF=%B"' . "\n"; + print $ucfg "imgfetch -n kernel http://" . '${next-server}:' . $httpport.'/tftpboot/' . $kern->{kernel} . "\n"; + print $ucfg "imgload kernel\n"; + if ($kern->{kcmdline}) { + print $ucfg "imgargs kernel " . $kern->{kcmdline} . ' BOOTIF=01-${netX/mac:hexhyp} initrd=initrd' . "\n"; + } else { + print $ucfg "imgargs kernel BOOTIF=" . '${netX/mac} initrd=initrd' . "\n"; + } + print $ucfg "imgfetch -n initrd http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; + print $ucfg "imgexec kernel\n"; close($ucfg); } } From eae0a643484ab7f0a9d8c8b76197b0a2ee1266e2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 19 Jun 2019 09:45:24 -0400 Subject: [PATCH 27/95] Have xnba conditionally do elilo if needed CentOS 6 and RHEL 6 for example do not support direct iPXE boot. For those platforms, auto-use elilo for uefi boot. --- xCAT-server/lib/xcat/plugins/xnba.pm | 53 ++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 34084daac..8a80ec5fc 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -91,6 +91,25 @@ sub getstate { } } +my %efistubcache; +sub has_efistub { + my $kern = shift; + my $node = shift; + my $filename = $globaltftpdir . "/" . $kern; + if (defined $efistubcache{$filename}) { + return $efistubcache{$filename}; + } + open my $kernel, '<:raw', $filename; + read $kernel, my $bytes, 512; + my $match = pack 'H*', '504500006486'; + if ($bytes =~ m/$match/) { + $efistubcache{$filename} = 1; + return 1; + } else { + $efistubcache{$filename} = 0; + return 0; + } +} sub setstate { =pod @@ -310,17 +329,29 @@ sub setstate { if ($kern->{kcmdline} and $kern->{initrd}) { #only a linux kernel/initrd pair should land here, write elilo config and uefi variant of xnba config file my $ucfg; open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); - print $ucfg "#!gpxe\n"; - print $ucfg "imgfetch -n kernel http://" . '${next-server}:' . $httpport.'/tftpboot/' . $kern->{kernel} . "\n"; - print $ucfg "imgload kernel\n"; - if ($kern->{kcmdline}) { - print $ucfg "imgargs kernel " . $kern->{kcmdline} . ' BOOTIF=01-${netX/mac:hexhyp} initrd=initrd' . "\n"; - } else { - print $ucfg "imgargs kernel BOOTIF=" . '${netX/mac} initrd=initrd' . "\n"; - } - print $ucfg "imgfetch -n initrd http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; - print $ucfg "imgexec kernel\n"; - close($ucfg); + if (has_efistub($kern->{kernel}, $node)) { + print $ucfg "#!gpxe\n"; + print $ucfg "imgfetch -n kernel http://" . '${next-server}:' . $httpport.'/tftpboot/' . $kern->{kernel} . "\n"; + print $ucfg "imgload kernel\n"; + if ($kern->{kcmdline}) { + print $ucfg "imgargs kernel " . $kern->{kcmdline} . ' BOOTIF=01-${netX/mac:hexhyp} initrd=initrd' . "\n"; + } else { + print $ucfg "imgargs kernel BOOTIF=" . '${netX/mac} initrd=initrd' . "\n"; + } + print $ucfg "imgfetch -n initrd http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; + print $ucfg "imgexec kernel\n"; + close($ucfg); + } else { + print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; + close($ucfg); + open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo"); + print $ucfg 'default="xCAT"' . "\n"; + print $ucfg "delay=0\n\n"; + print $ucfg "image=/tftpboot/" . $kern->{kernel} . "\n"; + print $ucfg " label=\"xCAT\"\n"; + print $ucfg " initrd=/tftpboot/" . $kern->{initrd} . "\n"; + print $ucfg " append=\"" . $elilokcmdline . ' BOOTIF=%B"' . "\n"; + } } } } From 6b7cde63e4eaecac4bfb868a372c6b56eddc65c5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 16 Aug 2019 16:08:59 -0400 Subject: [PATCH 28/95] Fix support for non-efistub kernels --- xCAT-server/lib/xcat/plugins/xnba.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 8a80ec5fc..a72b90df6 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -342,6 +342,7 @@ sub setstate { print $ucfg "imgexec kernel\n"; close($ucfg); } else { + print $ucfg "#!gpxe\n"; print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; close($ucfg); open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo"); From c29d7cafea3e348e3e70a9f96d91d63ea4cbf483 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 21 Jul 2020 17:01:36 -0400 Subject: [PATCH 29/95] parse the rsyslog version --- xCAT/postscripts/syslog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index ff2381495..51c16262c 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -304,8 +304,8 @@ fi # Do not even touch rsyslog.conf # There is no /etc/sysconfig/rsyslog file, so we use rsyslogd -v to get the version if [ -e "/sbin/rsyslogd" -o -e "/usr/sbin/rsyslogd" ]; then - SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` - SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` + SYSLOGPROD=`rsyslogd -v | grep rsyslogd |grep -v PID |awk {'print $1'}` + SYSLOGVER=`rsyslogd -v | grep rsyslogd |grep -v PID |awk {'print $2'}` if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then config_rsyslog_V8 #keep a record From 1e62c7f2ece3b2434809d04c919ef2a059ac7a1a Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 22 Jul 2020 18:15:10 -0400 Subject: [PATCH 30/95] Use xcat runcmd instead of system() call for mksquash command --- xCAT-server/lib/xcat/plugins/packimage.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index aa783fd86..fa2980e61 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -591,7 +591,8 @@ sub process_request { return 1; } my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; - my $rc = system("$mksquashfs_command"); + xCAT::Utils->runcmd($mksquashfs_command, 0, 1); + my $rc = $::RUNCMD_RC; if ($rc) { $callback->({ error => ["Command \"$mksquashfs_command\" failed"], errorcode => [1] }); return 1; From 694c9380bc56532c427bcdab97e54bdaf133531e Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 23 Jul 2020 11:39:02 -0400 Subject: [PATCH 31/95] This commit is to address Issue 6578. The new code is to compare /install/postscripts/* on MN/SN and /xcatpost/* on CN and display the difference. --- .../reg_linux_diskfull_installation_hierarchy | 14 ++++++++++++++ .../reg_linux_diskless_installation_hierarchy | 13 +++++++++++++ 2 files changed, 27 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 cfcd0832a..3f2aa82f3 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -58,6 +58,16 @@ 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:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 120;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then sleep 200;else sleep 180;fi +cmd:xdsh $$SN "cd /install/postscripts; tar cvf /tmp/sn.tar *" +cmd:xdsh $$SN "scp /tmp/sn.tar $$CN:/tmp" +cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" +cmd:xdsh $$CN "mkdir -p /tmp/sn; tar xvf /tmp/sn.tar -C /tmp/sn" +cmd:xdsh $$CN "mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm -f /tmp/cn/mypost*" +cmd:xdsh $$CN "diff -r /tmp/sn /tmp/cn > /tmp/diff.list" +check:rc==0 +cmd:xdsh $$CN "cat /tmp/diff.list" +check:rc==0 + #cmd:lsdef -l $$CN | grep status #check:rc==0 #check:output!~booted @@ -100,4 +110,8 @@ cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 + +cmd:xdsh $$SN "rm /tmp/sn.tar" +cmd:xdsh $$CN "rm /tmp/cn.tar; rm -fr /tmp/sn; rm -fr /tmp/cn; rm /tmp/diff.list" +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 5586630d4..496f62ee0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -64,6 +64,16 @@ 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:xdsh $$SN "cd /install/postscripts; tar cvf /tmp/sn.tar *" +cmd:xdsh $$SN "scp /tmp/sn.tar $$CN:/tmp" +cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" +cmd:xdsh $$CN "mkdir -p /tmp/sn; tar xvf /tmp/sn.tar -C /tmp/sn" +cmd:xdsh $$CN "mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm -f /tmp/cn/mypost*" +cmd:xdsh $$CN "diff -r /tmp/sn /tmp/cn > /tmp/diff.list" +check:rc==0 +cmd:xdsh $$CN "cat /tmp/diff.list" +check:rc==0 + cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN @@ -107,6 +117,9 @@ cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 +cmd:xdsh $$SN "rm /tmp/sn.tar" +cmd:xdsh $$CN "rm /tmp/cn.tar; rm -fr /tmp/sn; rm -fr /tmp/cn; rm /tmp/diff.list" +check:rc==0 end start:reg_linux_diskless_installation_hierarchy_squashfs From 3ecd60aa289decc55be2bb6e62af76bd12308062 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 24 Jul 2020 16:11:22 -0400 Subject: [PATCH 32/95] Change the regex in post.xcat.ng so that postscirpts with long filenames can still be downloaded from MN/SN to CN. --- xCAT-server/share/xcat/install/scripts/post.xcat.ng | 2 +- 1 file changed, 1 insertion(+), 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 255298db8..b81e56cfa 100644 --- a/xCAT-server/share/xcat/install/scripts/post.xcat.ng +++ b/xCAT-server/share/xcat/install/scripts/post.xcat.ng @@ -134,7 +134,7 @@ function download_recursive() [ "$?" -ne "0" ] && return 1 ;; esac - done < <(curl --fail --retry 20 --max-time 60 "${url}/" | grep -o '\1' | cut -d '"' -f 2) + done < <(curl --fail --retry 20 --max-time 60 "${url}/" | grep -o '.*' | cut -d '"' -f 2) return 0 } From 272200b3e81155ea1f9ad8a8bce3487f89467044 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 27 Jul 2020 11:03:25 -0400 Subject: [PATCH 33/95] Install xCAT-client before xCAT-probe package --- xCAT-probe/xCAT-probe.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index 432c78213..b5730e42c 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -11,7 +11,7 @@ Vendor: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -Requires: xCAT-client = 4:%{version}-%{release} +PreReq: xCAT-client = 4:%{version}-%{release} %ifos linux BuildArch: noarch From 025c5168073d50548e1eb4aebaf870bcab6b27a8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 28 Jul 2020 11:21:37 -0400 Subject: [PATCH 34/95] squashfs on RHEL8.2 hierarchy testcase debug --- .../installation/reg_linux_diskless_installation_hierarchy | 2 ++ 1 file changed, 2 insertions(+) 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 496f62ee0..b2a58f35a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -175,6 +175,8 @@ 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:xdsh fdisk -l +cmd:xdsh df -T cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs From 2f78873510e69692d2ae14f03cc48f73f9c793d0 Mon Sep 17 00:00:00 2001 From: peterwywong <46875219+peterwywong@users.noreply.github.com> Date: Tue, 28 Jul 2020 11:03:28 -0500 Subject: [PATCH 35/95] Revert "Compare /install/postscripts/* on MN/SN and /xcatpost/* on CN and display the difference as part of the diskfull and diskless hierarchical provisionings." --- .../reg_linux_diskfull_installation_hierarchy | 14 -------------- .../reg_linux_diskless_installation_hierarchy | 13 ------------- 2 files changed, 27 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 3f2aa82f3..cfcd0832a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -58,16 +58,6 @@ 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:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 120;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then sleep 200;else sleep 180;fi -cmd:xdsh $$SN "cd /install/postscripts; tar cvf /tmp/sn.tar *" -cmd:xdsh $$SN "scp /tmp/sn.tar $$CN:/tmp" -cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" -cmd:xdsh $$CN "mkdir -p /tmp/sn; tar xvf /tmp/sn.tar -C /tmp/sn" -cmd:xdsh $$CN "mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm -f /tmp/cn/mypost*" -cmd:xdsh $$CN "diff -r /tmp/sn /tmp/cn > /tmp/diff.list" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/diff.list" -check:rc==0 - #cmd:lsdef -l $$CN | grep status #check:rc==0 #check:output!~booted @@ -110,8 +100,4 @@ cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 - -cmd:xdsh $$SN "rm /tmp/sn.tar" -cmd:xdsh $$CN "rm /tmp/cn.tar; rm -fr /tmp/sn; rm -fr /tmp/cn; rm /tmp/diff.list" -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 496f62ee0..5586630d4 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -64,16 +64,6 @@ 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:xdsh $$SN "cd /install/postscripts; tar cvf /tmp/sn.tar *" -cmd:xdsh $$SN "scp /tmp/sn.tar $$CN:/tmp" -cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" -cmd:xdsh $$CN "mkdir -p /tmp/sn; tar xvf /tmp/sn.tar -C /tmp/sn" -cmd:xdsh $$CN "mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm -f /tmp/cn/mypost*" -cmd:xdsh $$CN "diff -r /tmp/sn /tmp/cn > /tmp/diff.list" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/diff.list" -check:rc==0 - cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN @@ -117,9 +107,6 @@ cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 -cmd:xdsh $$SN "rm /tmp/sn.tar" -cmd:xdsh $$CN "rm /tmp/cn.tar; rm -fr /tmp/sn; rm -fr /tmp/cn; rm /tmp/diff.list" -check:rc==0 end start:reg_linux_diskless_installation_hierarchy_squashfs From 5ef69dc56cddb700976a35158b9ab0471255e7cf Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 28 Jul 2020 17:06:06 -0400 Subject: [PATCH 36/95] Run on MN only --- .../installation/reg_linux_diskless_installation_hierarchy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index b2a58f35a..bab358b44 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -175,8 +175,8 @@ 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:xdsh fdisk -l -cmd:xdsh df -T +cmd:fdisk -l +cmd:df -T cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs From fd6d3a4cd75dc3ea13817331d0ead7b6e0f0e300 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 28 Jul 2020 22:58:27 -0400 Subject: [PATCH 37/95] Add a separate test case to compare postscripts on MN and CN. --- .../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 + xCAT-test/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 + .../testcase/installation/compare_postscripts | 17 +++++++++++++++++ 11 files changed, 27 insertions(+) create mode 100644 xCAT-test/autotest/testcase/installation/compare_postscripts diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 9c45ac82c..7d0fd3d3b 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 updatenode_P_script2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index 996fe5c4d..0fc86d278 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -24,6 +24,7 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 51c605833..ebb084bab 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 updatenode_P_script2 diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index 3dcc8e1ee..6b39cbd14 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -24,6 +24,7 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 4579ab45b..a8cd4835e 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index 388887cd4..ddfa86713 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -15,6 +15,7 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index ac69cd322..b4f20bab7 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index 76767fa1f..a523a0746 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -15,6 +15,7 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 2ac01f264..983d59527 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 5e4ffac31..84f8f6968 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q diff --git a/xCAT-test/autotest/testcase/installation/compare_postscripts b/xCAT-test/autotest/testcase/installation/compare_postscripts new file mode 100644 index 000000000..499d47197 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/compare_postscripts @@ -0,0 +1,17 @@ +start:compare_postscripts +os:Linux +label:provision +cmd:cd /install/postscripts; tar cvf /tmp/sn.tar * +cmd:scp /tmp/sn.tar $$CN:/tmp +cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" +cmd:xdsh $$CN "mkdir -p /tmp/sn; tar xvf /tmp/sn.tar -C /tmp/sn" +cmd:xdsh $$CN "mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm -f /tmp/cn/mypost*" +cmd:xdsh $$CN "diff -r /tmp/sn /tmp/cn > /tmp/diff.list" +check:rc==0 +cmd:xdsh $$CN "cat /tmp/diff.list" +check:rc==0 + +cmd:rm /tmp/sn.tar +cmd:xdsh $$CN "rm /tmp/cn.tar; rm -fr /tmp/sn; rm -fr /tmp/cn; rm /tmp/diff.list" +check:rc==0 +end From df2c3255637fa12b09acf3d55db5ee5d2b59aa9c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 29 Jul 2020 10:27:40 -0400 Subject: [PATCH 38/95] Formatting and default stanza doc improvements --- .../references/man5/xcatstanzafile.5.rst | 76 +++++++------------ xCAT-client/pods/man5/xcatstanzafile.5.pod | 16 +--- 2 files changed, 30 insertions(+), 62 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/xcatstanzafile.5.rst b/docs/source/guides/admin-guides/references/man5/xcatstanzafile.5.rst index b8cb9d33e..94871d3b8 100644 --- a/docs/source/guides/admin-guides/references/man5/xcatstanzafile.5.rst +++ b/docs/source/guides/admin-guides/references/man5/xcatstanzafile.5.rst @@ -19,79 +19,57 @@ DESCRIPTION *********** -A stanza file contains information that can be used to create xCAT data object definitions. A stanza file can be used as input to several xCAT commands. The stanza file contains one or more individual stanzas that provide information for individual object definitions. The following rules must be followed when creating a stanza file: +A stanza file contains information that can be used to create xCAT data object definitions. A stanza file can be used as input to several xCAT commands. The stanza file contains one or more individual stanzas that provide information for individual object definitions as well as an optional default definition that applies to all subsequent object definitions of that type. + +The following rules must be followed when creating a stanza file: -\* - - An object stanza header consists of the object name followed by a colon, (":"). - +\* An object stanza header consists of the object name followed by a colon, (":"). -\* - - Attribute lines must take the form of Attribute=Value. - + +\* Attribute lines must take the form of Attribute=Value. -\* - - Attribute name might include the character dot ("."), like passwd.HMC and nicips.eth0. - + +\* Attribute name might include the character dot ("."), like passwd.HMC and nicips.eth0. -\* - - Only one stanza can exist for each object name. - + +\* Only one stanza can exist for each object name. -\* - - All stanzas except for default stanzas must have a value set for "objtype". - + +\* All stanzas except for default stanzas must have a value set for "objtype". -\* - - Comments beginning with the "#" pound sign may be added to the file. A comment must be on a separate line. - + +\* Comments beginning with the "#" pound sign may be added to the file. A comment must be on a separate line. -\* - - When parsing the file, tab characters and spaces are ignored. - + +\* When parsing the file, tab characters and spaces are ignored. -\* - - Each line of the file can have no more than one header or attribute definition. - + +\* Each line of the file can have no more than one header or attribute definition. -\* - - If the header name is "default-:" the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type. - + +\* If the header name is "default-:" the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type. -\* - - Default stanzas can be specified multiple times and at any point in a stanza file. The values apply to all definitions following the default stanzas in a file. The default values are cumulative; a default attribute value will remain set until it is explicitly unset or changed. - + +\* Default stanzas can be specified multiple times and at any point in a stanza file. The values apply to all definitions following the default stanzas in a file. The default values are cumulative; a default attribute value will remain set until it is explicitly unset or changed. -\* - - To turn off a default value, use another default stanza to set the attribute to have no value using a blank space. - + +\* To turn off a default value, use another default stanza to set the attribute to have no value using a blank space. -\* - - When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set. - + +\* When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set. + The format of a stanza file should look similar to the following. diff --git a/xCAT-client/pods/man5/xcatstanzafile.5.pod b/xCAT-client/pods/man5/xcatstanzafile.5.pod index a36319930..b36de7623 100644 --- a/xCAT-client/pods/man5/xcatstanzafile.5.pod +++ b/xCAT-client/pods/man5/xcatstanzafile.5.pod @@ -4,56 +4,46 @@ B - Format of a stanza file that can be used with xCAT data obje =head1 DESCRIPTION -A stanza file contains information that can be used to create xCAT data object definitions. A stanza file can be used as input to several xCAT commands. The stanza file contains one or more individual stanzas that provide information for individual object definitions. The following rules must be followed when creating a stanza file: +A stanza file contains information that can be used to create xCAT data object definitions. A stanza file can be used as input to several xCAT commands. The stanza file contains one or more individual stanzas that provide information for individual object definitions as well as an optional default definition that applies to all subsequent object definitions of that type. + +The following rules must be followed when creating a stanza file: =over 2 =item * - An object stanza header consists of the object name followed by a colon, (":"). =item * - Attribute lines must take the form of Attribute=Value. =item * - Attribute name might include the character dot ("."), like passwd.HMC and nicips.eth0. =item * - Only one stanza can exist for each object name. =item * - All stanzas except for default stanzas must have a value set for "objtype". =item * - Comments beginning with the "#" pound sign may be added to the file. A comment must be on a separate line. =item * - When parsing the file, tab characters and spaces are ignored. =item * - Each line of the file can have no more than one header or attribute definition. =item * - If the header name is "default-:" the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type. =item * - Default stanzas can be specified multiple times and at any point in a stanza file. The values apply to all definitions following the default stanzas in a file. The default values are cumulative; a default attribute value will remain set until it is explicitly unset or changed. =item * - To turn off a default value, use another default stanza to set the attribute to have no value using a blank space. =item * - When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set. =back From 06382555502facd5f19ed38065ab05ed2aa1975d Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 29 Jul 2020 12:19:34 -0400 Subject: [PATCH 39/95] diff is done on MN. sn.tar is replaced by mn.tar. --- .../testcase/installation/compare_postscripts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/compare_postscripts b/xCAT-test/autotest/testcase/installation/compare_postscripts index 499d47197..190b8adf1 100644 --- a/xCAT-test/autotest/testcase/installation/compare_postscripts +++ b/xCAT-test/autotest/testcase/installation/compare_postscripts @@ -1,17 +1,16 @@ start:compare_postscripts os:Linux label:provision -cmd:cd /install/postscripts; tar cvf /tmp/sn.tar * -cmd:scp /tmp/sn.tar $$CN:/tmp +cmd:cd /install/postscripts; tar cvf /tmp/mn.tar * cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" -cmd:xdsh $$CN "mkdir -p /tmp/sn; tar xvf /tmp/sn.tar -C /tmp/sn" -cmd:xdsh $$CN "mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm -f /tmp/cn/mypost*" -cmd:xdsh $$CN "diff -r /tmp/sn /tmp/cn > /tmp/diff.list" +cmd:scp $$CN:/tmp/cn.tar /tmp; rm $$CN:/tmp/cn.tar +cmd:mkdir -p /tmp/mn; tar xvf /tmp/mn.tar -C /tmp/mn +cmd:mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm /tmp/cn/mypost* +cmd:diff -r /tmp/mn /tmp/cn > /tmp/diff.list check:rc==0 -cmd:xdsh $$CN "cat /tmp/diff.list" +cmd:cat /tmp/diff.list check:rc==0 -cmd:rm /tmp/sn.tar -cmd:xdsh $$CN "rm /tmp/cn.tar; rm -fr /tmp/sn; rm -fr /tmp/cn; rm /tmp/diff.list" +cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/diff.list" check:rc==0 end From 36478662a013be53cc73408a94456b0f0b90b936 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 29 Jul 2020 13:30:26 -0400 Subject: [PATCH 40/95] Additional changes --- xCAT-test/autotest/testcase/installation/compare_postscripts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/compare_postscripts b/xCAT-test/autotest/testcase/installation/compare_postscripts index 190b8adf1..9ed9740a3 100644 --- a/xCAT-test/autotest/testcase/installation/compare_postscripts +++ b/xCAT-test/autotest/testcase/installation/compare_postscripts @@ -3,7 +3,8 @@ os:Linux label:provision cmd:cd /install/postscripts; tar cvf /tmp/mn.tar * cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" -cmd:scp $$CN:/tmp/cn.tar /tmp; rm $$CN:/tmp/cn.tar +cmd:scp $$CN:/tmp/cn.tar /tmp +cmd:xdsh $$CN "rm /tmp/cn.tar" cmd:mkdir -p /tmp/mn; tar xvf /tmp/mn.tar -C /tmp/mn cmd:mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm /tmp/cn/mypost* cmd:diff -r /tmp/mn /tmp/cn > /tmp/diff.list @@ -11,6 +12,6 @@ check:rc==0 cmd:cat /tmp/diff.list check:rc==0 -cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/diff.list" +cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/mn.tar; rm /tmp/diff.list" check:rc==0 end From f57fd01c3da251e4e6cd70d5518723b4b397ff02 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 30 Jul 2020 13:54:15 -0400 Subject: [PATCH 41/95] Generate local repository template if not exist or empty --- xCAT-server/lib/xcat/plugins/anaconda.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 10e586dab..e27ee05a0 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1135,11 +1135,10 @@ sub mkinstall my @pkgdirs=split(/,/,$pkgdir); foreach my $mypkgdir (@pkgdirs){ - unless(-f "/install/postscripts/repos/$mypkgdir/local-repository.tmpl"){ - #fix issue #2856@github - #for the osimages created by <=xCAT 2.12.3 + unless(-s "/install/postscripts/repos/$mypkgdir/local-repository.tmpl"){ #there is no local-repository.tmpl under pkgdir created on copycds - #generate local-repository.tmpl here if it does not exist + #generate local-repository.tmpl here if it does not exist or empty + xCAT::MsgUtils->trace($verbose_on_off, "d", "anaconda->mkinstall: call to create /install/postscripts/repos/$mypkgdir/local-repository.tmpl"); xCAT::Yum->localize_yumrepo($mypkgdir, $os, $arch); } } From cdd22810b5a151cffb25f3d93867322cbe614c8c Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 31 Jul 2020 12:27:42 -0400 Subject: [PATCH 42/95] Add getadapter to xCAT Doc --- docs/source/advanced/networks/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/advanced/networks/index.rst b/docs/source/advanced/networks/index.rst index e75893567..fd503fe0e 100644 --- a/docs/source/advanced/networks/index.rst +++ b/docs/source/advanced/networks/index.rst @@ -8,3 +8,4 @@ Networking onie_switches/index.rst switchdiscover/index.rst infiniband/index.rst + getadapter.rst From 478164108a29aa0428d7d6d6d8bc0938bffbe1ed Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 31 Jul 2020 16:28:48 -0400 Subject: [PATCH 43/95] uncomment the getadapter.rst in the conf.py --- docs/source/advanced/networks/getadapter.rst | 4 ++-- docs/source/conf.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/advanced/networks/getadapter.rst b/docs/source/advanced/networks/getadapter.rst index b3aa71fd8..b7fdfda1e 100644 --- a/docs/source/advanced/networks/getadapter.rst +++ b/docs/source/advanced/networks/getadapter.rst @@ -12,11 +12,11 @@ information to help customer configure the network. How to use getadapter ----------------------- -Set the chian table to run ``getadapter`` script :: +Set the chain table to run ``getadapter`` script :: chdef chain="runcmd=getadapter" -After the discovery completed, the column ``nicsadapter`` of ```nics`` table is +After the discovery completed, the column ``nicsadapter`` of ``nics`` table is updated. View result with ``lsdef`` command :: diff --git a/docs/source/conf.py b/docs/source/conf.py index 1f8253fe9..d2afdfdc3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -105,7 +105,7 @@ exclude_patterns = ['guides/install-guides/common_sections.rst', '**hierarchy/databases/postgres_tips.rst', '**hierarchy/define_and_install_compute_node.rst', #'**hierarchy/define_service_node.rst', - '**networks/getadapter.rst' + #'**networks/getadapter.rst' #'**networks/vlan/index.rst', #'**networks/vlan/vlan.rst', #'**license/xcat_corporate_contributor_license_agreement.rst', From 25f83a80e61d9ea9506036bdc4392f6b911b3e5c Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 31 Jul 2020 16:55:10 -0400 Subject: [PATCH 44/95] remove `,` --- 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 d2afdfdc3..df334cef4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -103,7 +103,7 @@ exclude_patterns = ['guides/install-guides/common_sections.rst', #'**hamn/setup_ha_mgmt_node_with_shared_data.rst', #'**hamn/setup_xcat_high_available_management_node_in_softlayer.rst', '**hierarchy/databases/postgres_tips.rst', - '**hierarchy/define_and_install_compute_node.rst', + '**hierarchy/define_and_install_compute_node.rst' #'**hierarchy/define_service_node.rst', #'**networks/getadapter.rst' #'**networks/vlan/index.rst', From 389c4e8b3407509e45919cc14422989a7d462464 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 31 Jul 2020 17:34:56 -0400 Subject: [PATCH 45/95] Remove the RC checking for the file removal command. --- xCAT-test/autotest/testcase/installation/compare_postscripts | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/compare_postscripts b/xCAT-test/autotest/testcase/installation/compare_postscripts index 9ed9740a3..30eed80fe 100644 --- a/xCAT-test/autotest/testcase/installation/compare_postscripts +++ b/xCAT-test/autotest/testcase/installation/compare_postscripts @@ -13,5 +13,4 @@ cmd:cat /tmp/diff.list check:rc==0 cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/mn.tar; rm /tmp/diff.list" -check:rc==0 end From 4a94bf2e3f6fc07336043b0add07d593239cf50a Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 3 Aug 2020 16:20:07 -0400 Subject: [PATCH 46/95] Remove the extra double quote of the rm command. --- xCAT-test/autotest/testcase/installation/compare_postscripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/compare_postscripts b/xCAT-test/autotest/testcase/installation/compare_postscripts index 30eed80fe..049024101 100644 --- a/xCAT-test/autotest/testcase/installation/compare_postscripts +++ b/xCAT-test/autotest/testcase/installation/compare_postscripts @@ -12,5 +12,5 @@ check:rc==0 cmd:cat /tmp/diff.list check:rc==0 -cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/mn.tar; rm /tmp/diff.list" +cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/mn.tar; rm /tmp/diff.list end From b082229c39c549eb9e7b75f88bdf58ab2c5754ce Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 4 Aug 2020 11:56:39 -0400 Subject: [PATCH 47/95] Add egrep -v "O=D|Directory" to remove irrelevant files from being copied from MN to CN. --- xCAT-server/share/xcat/install/scripts/post.xcat.ng | 2 +- 1 file changed, 1 insertion(+), 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 b81e56cfa..cbbad65be 100644 --- a/xCAT-server/share/xcat/install/scripts/post.xcat.ng +++ b/xCAT-server/share/xcat/install/scripts/post.xcat.ng @@ -134,7 +134,7 @@ function download_recursive() [ "$?" -ne "0" ] && return 1 ;; esac - done < <(curl --fail --retry 20 --max-time 60 "${url}/" | grep -o '.*' | cut -d '"' -f 2) + done < <(curl --fail --retry 20 --max-time 60 "${url}/" | grep -o '.*' | egrep -v "O=D|Directory" | cut -d '"' -f 2) return 0 } From f57543948935c67631a84f3f8af18d3e04caa80c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 6 Aug 2020 11:07:56 -0400 Subject: [PATCH 48/95] Fix usage and example for replaycons command --- .../admin-guides/references/man1/replaycons.1.rst | 10 +++++----- xCAT-client/pods/man1/replaycons.1.pod | 10 +++++----- xCAT-server/bin/replaycons | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/replaycons.1.rst b/docs/source/guides/admin-guides/references/man1/replaycons.1.rst index c4b1929b3..0cd788690 100644 --- a/docs/source/guides/admin-guides/references/man1/replaycons.1.rst +++ b/docs/source/guides/admin-guides/references/man1/replaycons.1.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **replaycons**\ [\ *node*\ ] [\ *bps*\ ] [\ *tail_amount*\ ] +\ **replaycons**\ \ *node log file*\ [\ *bps*\ ] [\ *tail_amount*\ ] \ **replaycons**\ [\ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] @@ -31,9 +31,9 @@ DESCRIPTION The \ **replaycons**\ command reads the console log stored by conserver for this node, and displays it in a way that simulates the original output of the console. Using the \ *bps*\ value, it will throttle -the speed of the output play back. (The conserver logs are stored in /var/log/consoles.) +the speed of the output play back. (The logs are stored in /var/log/consoles.) -For now, replaycons must be run locally on the system on which the console log is stored. This is normally +\ **replaycons**\ must be run locally on the system on which the console log is stored. This is normally that management node, but in a hierarchical cluster will usually be the service node. @@ -51,7 +51,7 @@ OPTIONS \ *tail_amount*\ - The place in the console log file to start play back, specified as the # of lines from the end. + The place in the console log file to start play back, specified as the number of lines from the end. @@ -96,7 +96,7 @@ EXAMPLES .. code-block:: perl - replaycons 19200 2000 + replaycons node1.log 19200 2000 diff --git a/xCAT-client/pods/man1/replaycons.1.pod b/xCAT-client/pods/man1/replaycons.1.pod index 97a7e81cf..e41a5c07d 100644 --- a/xCAT-client/pods/man1/replaycons.1.pod +++ b/xCAT-client/pods/man1/replaycons.1.pod @@ -5,7 +5,7 @@ B - replay the console output for a node =head1 SYNOPSIS -B [I] [I] [I] +B I [I] [I] B [B<-h> | B<--help> | B<-v> | B<--version>] @@ -14,9 +14,9 @@ B [B<-h> | B<--help> | B<-v> | B<--version>] The B command reads the console log stored by conserver for this node, and displays it in a way that simulates the original output of the console. Using the I value, it will throttle -the speed of the output play back. (The conserver logs are stored in /var/log/consoles.) +the speed of the output play back. (The logs are stored in /var/log/consoles.) -For now, replaycons must be run locally on the system on which the console log is stored. This is normally +B must be run locally on the system on which the console log is stored. This is normally that management node, but in a hierarchical cluster will usually be the service node. @@ -30,7 +30,7 @@ The display rate to use to play back the console output. Default is 19200. =item I -The place in the console log file to start play back, specified as the # of lines from the end. +The place in the console log file to start play back, specified as the number of lines from the end. =item B<-v|--version> @@ -64,7 +64,7 @@ An error has occurred. To replay the console for node1 at the default rate, starting 2000 lines from the end: - replaycons 19200 2000 + replaycons node1.log 19200 2000 =back diff --git a/xCAT-server/bin/replaycons b/xCAT-server/bin/replaycons index 5cc22aa84..dded022ec 100755 --- a/xCAT-server/bin/replaycons +++ b/xCAT-server/bin/replaycons @@ -17,7 +17,7 @@ use Getopt::Long; my $usage_string = "Usage: - replaycons node [bps] [tail] + replaycons node_log [bps] [tail] replaycons -h|--help replaycons -v|--version bps Specifies the display rate. From 33ba96f43bfbf20f0e98011567218ea4bcde3cb2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 6 Aug 2020 15:16:38 -0400 Subject: [PATCH 49/95] On RHEL8 do not user vers=3 when mounting kdump filesystem --- xCAT/postscripts/enablekdump | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 80c5b1732..d5750fddd 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -217,6 +217,10 @@ EOF for i in $nfsvers do if [ $i -eq 3 ] && ! [ grep -w nfs /proc/filesystems >/dev/null 2>&1 ]; then + if (pmatch $OSVER "rhel8*") || (pmatch $OSVER "rhels8*");then + # For RHEL8 do not mount with vers=3 option + continue + fi nfsver=3 break elif [ $i -eq 4 ] && ! [ grep -w nfs4 /proc/filesystems >/dev/null 2>&1 ]; then From f21f56c8a953afb3249c9e20fcafe58a9e79e0e2 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 11 Aug 2020 09:25:42 -0400 Subject: [PATCH 50/95] Added enabling nv_rsync service in cuda11_power9_setup postscripts --- xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup b/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup index 5a2a27f0c..5c004c3e3 100755 --- a/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup +++ b/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup @@ -145,6 +145,9 @@ $CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" [ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" $CHROOTCMD /bin/bash -c "systemctl enable nvidia_gdrcopy_kernel.service" +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nv_rsync_mem.service" + if [ -z "${IMG_ROOTIMGDIR}" ] then mv "${IMG_ROOTIMGDIR}/bin/uname.xcat" "${IMG_ROOTIMGDIR}/bin/uname" From 13d51ad7dcb7bff3af2d1ef7ee50d6ac02719089 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 11 Aug 2020 14:23:27 -0400 Subject: [PATCH 51/95] Remove depricated Perl usage of keys on scalar --- xCAT-server/xCAT-wsapi/xcatws.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 8b1259b22..bd0768137 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -2879,7 +2879,7 @@ sub tablerowhdl { # Check if there is any real data in response # One key ('xcatdsource' => '') is always returned. # If no other keys in response - no matches on key or attribute were returned from xcatd - if (keys @$responses[0] <= 1) { + if (keys (%{@$responses[0]}) <= 1) { @$responses[0]->{error} = "No table rows matched specified keys or attributes"; } return $responses; From 319673984828ac2809e5bae4bdb25a6b0c818117 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 12 Aug 2020 09:58:25 -0400 Subject: [PATCH 52/95] Retry rinstall if first one fails --- xCAT-test/autotest/testcase/commoncmd/retry_install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index f49f69f92..d98f9fc7a 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -30,8 +30,13 @@ do echo "rinstall $node osimage=$osimage" rinstall $node osimage=$osimage if [ $? != 0 ];then - echo "rinstall command failed ..." - exit 1 + echo "First attempt to run rinstall command failed ..." + # First rinstall failed, try again with verbose flag + rinstall $node osimage=$osimage -V + if [ $? != 0 ];then + echo "Second attempt to run rinstall command failed ..." + exit 1 + fi fi #sleep while for installation. From 3097702dc912eeb2ca5c917b21b892a9d936fc02 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 13 Aug 2020 17:42:56 -0400 Subject: [PATCH 53/95] Add kernel-modules-extra to dracut module list --- xCAT-server/share/xcat/netboot/rh/genimage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 81678065d..0e27f9491 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1079,7 +1079,7 @@ sub mkinitrd_dracut { #update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - my $dracutmodulelist = "xcat nfs base network kernel-modules syslog"; + my $dracutmodulelist = "xcat nfs base network kernel-modules kernel-modules-extra syslog"; foreach (qw/systemd systemd-initrd dracut-systemd fadump/) { my ($dir) = glob($dracutmoduledir . "[0-9]*" . $_); @@ -1120,7 +1120,7 @@ sub mkinitrd_dracut { $perm = (stat("$fullpath/$dracutdir/installkernel"))[2]; chmod($perm & 07777, "$dracutmpath/installkernel"); - my $dracutmodulelist = "xcat nfs base network kernel-modules syslog"; + my $dracutmodulelist = "xcat nfs base network kernel-modules kernel-modules-extra syslog"; foreach (qw/systemd systemd-initrd dracut-systemd fadump/) { my ($dir) = glob($dracutmoduledir . "[0-9]*" . $_); From 2111baba473cd292c5a177a920d03304577fa731 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 17 Aug 2020 16:06:37 -0400 Subject: [PATCH 54/95] Verify if kernel-modules-extra exists before adding --- xCAT-server/share/xcat/netboot/rh/genimage | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 0e27f9491..0620ec5af 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1079,9 +1079,9 @@ sub mkinitrd_dracut { #update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - my $dracutmodulelist = "xcat nfs base network kernel-modules kernel-modules-extra syslog"; + my $dracutmodulelist = "xcat nfs base network kernel-modules syslog"; - foreach (qw/systemd systemd-initrd dracut-systemd fadump/) { + foreach (qw/systemd systemd-initrd dracut-systemd fadump kernel-modules-extra/) { my ($dir) = glob($dracutmoduledir . "[0-9]*" . $_); if (-d $dir) { $dracutmodulelist .= " $_"; @@ -1120,9 +1120,9 @@ sub mkinitrd_dracut { $perm = (stat("$fullpath/$dracutdir/installkernel"))[2]; chmod($perm & 07777, "$dracutmpath/installkernel"); - my $dracutmodulelist = "xcat nfs base network kernel-modules kernel-modules-extra syslog"; + my $dracutmodulelist = "xcat nfs base network kernel-modules syslog"; - foreach (qw/systemd systemd-initrd dracut-systemd fadump/) { + foreach (qw/systemd systemd-initrd dracut-systemd fadump kernel-modules-extra/) { my ($dir) = glob($dracutmoduledir . "[0-9]*" . $_); if (-d $dir) { $dracutmodulelist .= " $_"; From a1b49ffa01ec214de81d659739d18a7ddff8c6bf Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 18 Aug 2020 09:45:35 -0400 Subject: [PATCH 55/95] xcat-inventory backend testcase fix --- xCAT-test/autotest/testcase/xcat_inventory/cases.backend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend index 029878e6f..201a833ab 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend @@ -6,7 +6,7 @@ cmd: rm -rf /tmp/backend_test/ cmd:rm -rf ~/.xcatinv/inventory.cfg.bak.backend_init check: rc==0 cmd: mkdir -p ~/.xcatinv/ -cmd: [ -f ~/.xcatinv/inventory.cfg ] && mv ~/.xcatinv/inventory.cfg ~/.xcatinv/inventory.cfg.bak.backend_init +cmd: if [[ -f ~/.xcatinv/inventory.cfg ]]; then mv ~/.xcatinv/inventory.cfg ~/.xcatinv/inventory.cfg.bak.backend_init; fi cmd: cp /opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/templates/inventory.cfg ~/.xcatinv/inventory.cfg cmd: xcat-inventory init check: rc==0 @@ -86,7 +86,7 @@ check: output!=~ws cmd: XCATBYPASS=1 restorexCATdb -p /tmp/backend_test/backup/db check: rc==0 -cmd: [ -f "~/.xcatinv/inventory.cfg.bak.backend_init" ] && rm -rf "~/.xcatinv/inventory.cfg" && mv "~/.xcatinv/inventory.cfg.bak.backend_init" "~/.xcatinv/inventory.cfg" +cmd: if [[ -f "~/.xcatinv/inventory.cfg.bak.backend_init" ]]; then rm -rf "~/.xcatinv/inventory.cfg"; mv "~/.xcatinv/inventory.cfg.bak.backend_init" "~/.xcatinv/inventory.cfg"; fi cmd: rm -rf /tmp/backend_test/ end From 0861f49afab6208087eaf932756616f87fc3d644 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 21 Aug 2020 15:04:56 -0400 Subject: [PATCH 56/95] Move debug link from Connections --- docs/source/troubleshooting/index.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/troubleshooting/index.rst b/docs/source/troubleshooting/index.rst index d8f69a11b..e09ac69de 100644 --- a/docs/source/troubleshooting/index.rst +++ b/docs/source/troubleshooting/index.rst @@ -1,7 +1,9 @@ Troubleshooting =============== -This chapter introduces the methods of troubleshooting a xCAT cluster. It includes the following parts. +This chapter introduces the methods of debugging and troubleshooting a xCAT cluster. `General xCAT troubleshooting and debugging suggestions `_ + +Additional recomendations: .. toctree:: :maxdepth: 2 From 9c831a659f3e839517b9a1ac5a1dfc97c8695e27 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 24 Aug 2020 12:27:43 -0400 Subject: [PATCH 57/95] Better testcase output when makedhcp -q fails --- .../installation/reg_linux_diskless_installation_flat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b07c66ed2..3c8628865 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -20,7 +20,7 @@ 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 +cmd:a=0;while true; do [ $a -eq 100 ] && { echo "After 100 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 @@ -106,7 +106,7 @@ 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 +cmd:a=0;while true; do [ $a -eq 100 ] && { echo "After 100 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 From b11027958cfcf14c6858527a6c8e52c21c855ba6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 1 Sep 2020 13:16:11 -0400 Subject: [PATCH 58/95] Improve genesistest script --- .../autotest/testcase/genesis/genesistest.pl | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index ed886e3fc..0d63f40de 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -113,9 +113,13 @@ if ($genesis_nodesetshell_test) { #################################### if ($genesis_runcmd_test) { send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); - if (&testxdsh(&rungenesiscmd(&get_arch))) { - send_msg(0, "[$$]:Could not verify test results using xdsh..............."); - exit 1; + my $testxdsh_value = &rungenesiscmd(&get_arch); + if (&testxdsh($testxdsh_value)) { + send_msg(0, "[$$]:Could not verify test results using xdsh($testxdsh_value) on first attempt, will try again..............."); + if (&testxdsh($testxdsh_value)) { + send_msg(0, "[$$]:Could not verify test results using xdsh($testxdsh_value) on second attempt, giving up..............."); + exit 1; + } } send_msg(2, "[$$]:Running runcmd test success..............."); } @@ -199,9 +203,13 @@ sub rungenesiscmd { if ($?) { send_msg(0, "mknb $arch failed for runcmd test."); } - `rinstall $noderange "runcmd=cmdtest,shell"`; + my $rinstall_cmd = "rinstall $noderange \"runcmd=cmdtest,shell\""; + `$rinstall_cmd`; if ($?) { - send_msg(0, "rinstall noderange shell failed for runcmd test"); + send_msg(0, "Command \"$rinstall_cmd\" failed for runcmd test"); + } + else { + send_msg(2, "Installing with \"$rinstall_cmd\" for runcmd test"); } return $value; } @@ -247,7 +255,7 @@ sub rungenesisimg { ######################################### sub testxdsh { my $value = shift; - print "The input parameter is $value \n"; + send_msg(2, "The input parameter for testxdsh() is $value \n"); my $checkstring; my $checkfile; my $nodestatus; @@ -266,7 +274,7 @@ sub testxdsh { if (($value == 1) || ($value == 2) || ($value == 3)) { `$xdsh_command`; if ($?) { - my @i = (1..10); + my @i = (1..5); for (@i) { sleep 300; $nodestatus=`lsdef $noderange -i status -c 2>&1 | awk -F'=' '{print \$2}'`; From 7a203eaf42803279ca6663e1cd7ab20b0507021d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 3 Sep 2020 14:45:33 -0400 Subject: [PATCH 59/95] Retry rpower boot command --- xCAT-test/autotest/testcase/rpower/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 37837a98e..e05ec1421 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -47,7 +47,7 @@ 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 -m; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi -cmd:rpower $$CN boot +cmd:rpower_boot_out=`rpower $$CN boot`; if [[ $rpower_boot_out =~ qemu-kvm ]]; then echo "rpower boot failed with $rpower_boot_out. Will retry"; rpower $$CN boot; else echo "rpower boot success on first try"; exit 0; 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 From d9a1f127dc351beee903702fe65bb33be0417141 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 4 Sep 2020 11:25:52 -0400 Subject: [PATCH 60/95] Add extra output to confignetwork testcase --- xCAT-test/autotest/testcase/confignetwork/cases0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 264dc00f3..586e218de 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -864,6 +864,8 @@ check:output=~br22 check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 +cmd:xdsh $$CN "ip addr show bond0.3" +cmd:xdsh $$CN "ip addr show br33" cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi From 6f4c59fece2b3c62d182557bf13d7894fafe7e77 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 10 Sep 2020 14:23:33 -0400 Subject: [PATCH 61/95] Verify nbk kernel file is present before defaulting to use it --- docs/source/advanced/hierarchy/define_service_nodes.rst | 6 ++++-- xCAT-server/lib/xcat/plugins/destiny.pm | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index 259a748a0..8b13f99df 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -103,5 +103,7 @@ The following table illustrates the cluster being used in this example: chdef -t site clustersite installloc= rsync -auv --exclude 'autoinst' /install r1n01:/ rsync -auv --exclude 'autoinst' /install r2n01:/ - rsync -auv --exclude 'autoinst' /tftpboot r1n01:/ - rsync -auv --exclude 'autoinst' /tftpboot r2n01:/ + rsync -auv /tftpboot r1n01:/ + rsync -auv /tftpboot r2n01:/ + +.. note:: If ``/install`` and ``/tftpboot`` directories local to each Service Node are used and ``mknb`` command is executed to generate a diskless network boot image with custom changes, it will not be automatically copied to the Service Node. Make sure to run the above ``rsync`` commands after executing the ``mknb``. Verify ``/tftpboot/xcat`` directory on Service node contains ``genesis.kernel.`` and ``genesis.fs..gz`` files. diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index f194bfd64..2832d7710 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -711,10 +711,16 @@ sub setdestiny { $bphash->{$_}->[0]->{initrd} = "xcat/genesis.fs.$arch.$othersuffix"; $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport destiny=$state"; } - } else { #'legacy' environment + } else { # genesis.kernel file is not there, assume 'legacy' environment + if (-r "$tftpdir/xcat/nbk.$arch") { $bphash->{$_}->[0]->{kernel} = "xcat/nbk.$arch"; $bphash->{$_}->[0]->{initrd} = "xcat/nkfs.$arch.gz"; $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport"; + $callback->({ warning => ["No genesis.kernel.$arch file found. Defaulting to legacy nbk.$arch"]}); + } else { # can not find genesis.kernel or nbk file + $callback->({ error => ["Could not find genesis.kernel.$arch or legacy nbk.$arch files"], errorcode => [1] }); + exit(1); + } } } From 1edc9c91ace2a44e5019fa2d88d1ee5f8b84844e Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 11 Sep 2020 10:43:38 -0400 Subject: [PATCH 62/95] Add extra debug output to confignetwork script --- xCAT/postscripts/nicutils.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 780b1da7b..c59d39592 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -756,9 +756,12 @@ function check_brctl() { function check_and_set_device_managed() { devname=$1 rc=1 + log_info "check_and_set_device_managed for device $devname" $nmcli device show $devname >/dev/null 2>/dev/null if [ $? -ne 0 ]; then log_error "Device $devname not found" + # Could not find the device we wanted. Display all devices + $nmcli device show else $nmcli -g GENERAL.STATE device show $devname|grep unmanaged >/dev/null 2>/dev/null if [ $? -eq 0 ]; then From 4164d661528b2319fb3de1bb9bd1b541cf2b535a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 14 Sep 2020 09:53:48 -0400 Subject: [PATCH 63/95] Improve genesistest script(2) --- xCAT-test/autotest/testcase/genesis/genesistest.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 0d63f40de..eaec03810 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -115,9 +115,9 @@ if ($genesis_runcmd_test) { send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); my $testxdsh_value = &rungenesiscmd(&get_arch); if (&testxdsh($testxdsh_value)) { - send_msg(0, "[$$]:Could not verify test results using xdsh($testxdsh_value) on first attempt, will try again..............."); + send_msg(0, "[$$]:Could not verify runcmd test results using xdsh($testxdsh_value) on first attempt, will try again..............."); if (&testxdsh($testxdsh_value)) { - send_msg(0, "[$$]:Could not verify test results using xdsh($testxdsh_value) on second attempt, giving up..............."); + send_msg(0, "[$$]:Could not verify runcmd test results using xdsh($testxdsh_value) on second attempt, giving up..............."); exit 1; } } @@ -128,9 +128,13 @@ if ($genesis_runcmd_test) { ################################## if ($genesis_runimg_test) { send_msg(2, "[$$]:Run nodeset NODE runimage test..............."); - if (&testxdsh(&rungenesisimg)) { - send_msg(0, "[$$]:Could not verify test results using xdsh ..............."); - exit 1; + my $testxdsh_value = &rungenesisimg; + if (&testxdsh($testxdsh_value)) { + send_msg(0, "[$$]:Could not verify runimage test results using xdsh($testxdsh_value) on first attmpt, will try again..............."); + if (&testxdsh($testxdsh_value)) { + send_msg(0, "[$$]:Could not verify runimage test results using xdsh($testxdsh_value) on second attempt, giving up..............."); + exit 1; + } } send_msg(2, "[$$]:Running runimage test success..............."); From 71423981123bf9c8ac7c27313fe778dc5ec33443 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 14 Sep 2020 10:47:17 -0400 Subject: [PATCH 64/95] Add extra debug output to nicutils script --- xCAT/postscripts/nicutils.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index c59d39592..1fdbe9c7b 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -2074,12 +2074,15 @@ function create_bridge_interface_nmcli { nmcli con modify $tmp_slave_con_name connection.id $xcat_slave_con fi else + log_error "$nmcli con up $xcat_con_name success with return code equals to $is_active" is_nmcli_connection_exist $tmp_con_name if [ $? -eq 0 ]; then + log_info "delete connection $tmp_con_name" $nmcli con delete $tmp_con_name fi is_nmcli_connection_exist $tmp_slave_con_name if [ $? -eq 0 ]; then + log_info "delete connection $tmp_slave_con_name" $nmcli con delete $tmp_slave_con_name fi if [ -n "$xcatcreatedcon" ]; then @@ -2089,6 +2092,7 @@ function create_bridge_interface_nmcli { wait_for_ifstate $ifname UP 40 40 [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info + $ip address show # Show all for debug fi return $rc From c27e3ea51c1a5f7a70336b0880e05c8aabc500f5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 16 Sep 2020 10:06:06 -0400 Subject: [PATCH 65/95] More debug output for rpower testcases --- xCAT-test/autotest/testcase/rpower/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index e05ec1421..561ea7683 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -18,7 +18,7 @@ Attribute: $$CN-The operation object of rpower command label:cn_bmc_ready,hctrl_general #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: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' VM with memory $memory failed with error ${out}. Trying with smaller memory $((memory-2048))."; 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 @@ -47,7 +47,7 @@ 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 -m; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi -cmd:rpower_boot_out=`rpower $$CN boot`; if [[ $rpower_boot_out =~ qemu-kvm ]]; then echo "rpower boot failed with $rpower_boot_out. Will retry"; rpower $$CN boot; else echo "rpower boot success on first try"; exit 0; fi +cmd:rpower_boot_out=`rpower $$CN boot`; if [[ $rpower_boot_out =~ qemu-kvm ]]; then echo "rpower boot failed with $rpower_boot_out. Will retry"; rpower $$CN boot; else echo "rpower boot success on first try: $rpower_boot_out"; exit 0; 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 From bb4b219b25db9ea2bf9c6c17f093df8cf1bb44ab Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 21 Sep 2020 11:28:49 -0400 Subject: [PATCH 66/95] Revert "Add extra debug output to nicutils script" --- xCAT/postscripts/nicutils.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 1fdbe9c7b..c59d39592 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -2074,15 +2074,12 @@ function create_bridge_interface_nmcli { nmcli con modify $tmp_slave_con_name connection.id $xcat_slave_con fi else - log_error "$nmcli con up $xcat_con_name success with return code equals to $is_active" is_nmcli_connection_exist $tmp_con_name if [ $? -eq 0 ]; then - log_info "delete connection $tmp_con_name" $nmcli con delete $tmp_con_name fi is_nmcli_connection_exist $tmp_slave_con_name if [ $? -eq 0 ]; then - log_info "delete connection $tmp_slave_con_name" $nmcli con delete $tmp_slave_con_name fi if [ -n "$xcatcreatedcon" ]; then @@ -2092,7 +2089,6 @@ function create_bridge_interface_nmcli { wait_for_ifstate $ifname UP 40 40 [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info - $ip address show # Show all for debug fi return $rc From 08bef2a972913556d76daf801204dd470bfdbac7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 21 Sep 2020 12:05:57 -0400 Subject: [PATCH 67/95] Improve genesistest script(3) --- .../autotest/testcase/genesis/genesistest.pl | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index eaec03810..60b5efc27 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -113,11 +113,10 @@ if ($genesis_nodesetshell_test) { #################################### if ($genesis_runcmd_test) { send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); - my $testxdsh_value = &rungenesiscmd(&get_arch); - if (&testxdsh($testxdsh_value)) { - send_msg(0, "[$$]:Could not verify runcmd test results using xdsh($testxdsh_value) on first attempt, will try again..............."); - if (&testxdsh($testxdsh_value)) { - send_msg(0, "[$$]:Could not verify runcmd test results using xdsh($testxdsh_value) on second attempt, giving up..............."); + if (&testxdsh(&rungenesiscmd(&get_arch))) { + send_msg(0, "[$$]:Could not verify runcmd test results using testxdsh() on first attempt, will try again..............."); + if (&testxdsh(&rungenesiscmd(&get_arch))) { + send_msg(0, "[$$]:Could not verify runcmd test results using testxdsh() on second attempt, giving up..............."); exit 1; } } @@ -128,11 +127,10 @@ if ($genesis_runcmd_test) { ################################## if ($genesis_runimg_test) { send_msg(2, "[$$]:Run nodeset NODE runimage test..............."); - my $testxdsh_value = &rungenesisimg; - if (&testxdsh($testxdsh_value)) { - send_msg(0, "[$$]:Could not verify runimage test results using xdsh($testxdsh_value) on first attmpt, will try again..............."); - if (&testxdsh($testxdsh_value)) { - send_msg(0, "[$$]:Could not verify runimage test results using xdsh($testxdsh_value) on second attempt, giving up..............."); + if (&testxdsh(&rungenesisimg)) { + send_msg(0, "[$$]:Could not verify runimage test results using testxdsh() on first attmpt, will try again..............."); + if (&testxdsh(&rungenesisimg)) { + send_msg(0, "[$$]:Could not verify runimage test results using itestxdsh() on second attempt, giving up..............."); exit 1; } } From 9067d1ba420130832e8da23e4fbc266682ee04ec Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 22 Sep 2020 16:38:21 -0400 Subject: [PATCH 68/95] Add REST test cases, a new bundle and this bundle to the ppcle daily.bundle --- .../autotest/bundle/rhels_ppcle_daily.bundle | 1 + .../bundle/rhels_ppcle_restapi.bundle | 24 +++ xCAT-test/autotest/testcase/restapi/cases0 | 184 ++++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle create mode 100644 xCAT-test/autotest/testcase/restapi/cases0 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 7d0fd3d3b..e06f4c460 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -307,3 +307,4 @@ xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab go_xcat_devel_from_repo +#INCLUDE:rhels_ppcle_restapi.bundle# diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle new file mode 100644 index 000000000..0d4b7acda --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle @@ -0,0 +1,24 @@ +restapi_setup_on_MN_SN_CN +restapi_list_all_resources +restapi_list_globalconf +restapi_list_groups +restapi_list_nodes +restapi_list_node_CN +restapi_list_networks +restapi_list_osimages +restapi_list_policy +restapi_create_temp_CN_put +restapi_delete_temp_CN_put +restapi_create_temp_CN_post +restapi_create_temp_CN_put +restapi_delete_temp_CN_2 +restapi_create_temp_CN_put +restapi_add_id_temp_CN +restapi_modify_vmmemory_temp_CN +restapi_delete_id_temp_CN +restapi_show_temp_CN_osimage +restapi_list_nodes_wrong_password +restapi_list_wrong_osimage +restapi_modify_wrong_field_CN +restapi_delete_temp_CN_put +restapi_cleanup_on_MN_SN_CN diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 new file mode 100644 index 000000000..f7db774c0 --- /dev/null +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -0,0 +1,184 @@ +start:restapi_setup_on_MN_SN_CN +description: Set up the REST API on MN and CN +label:restapi +cmd:yum install mod_ssl -y +check:rc==0 +cmd:sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf +cmd:sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf +cmd:service httpd restart +check:rc==0 +cmd:scp /install/postscripts/ca/ca-cert.pem $$CN:/root +check:rc==0 +cmd:tabch key=xcat,username=root passwd.password=cluster +check:rc==0 +end + +start:restapi_cleanup_on_MN_SN_CN +description: Set up the REST API on MN and CN +label:restapi +cmd:xdsh $$CN "rm /root/ca-cert.pem" +check:rc==0 +cmd:tabch -d key=xcat passwd +check:rc==0 +cmd:yum remove mod_ssl -y +check:rc==0 +cmd:service httpd restart +check:rc==0 +end + +start:restapi_list_all_resources +description: List all resources on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws?userName=$username&userPW=$password'" +check:rc==0 +check:output=~nodes +end + +start:restapi_list_globalconf +description: List globalconf on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/globalconf?debug=2&userName=$username&userPW=$password'" +check:rc==0 +check:output=~"tftpdir":"/tftpboot" +end + +start:restapi_list_groups +description: List groups on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETTABLEVALUE(node,$$CN,groups,nodelist)__ +end + +start:restapi_list_nodes +description: List nodes on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?&userName=$username&userPW=$password'" +check:rc==0 +check:output=~$$CN +end + +start:restapi_list_node_CN +description: Display details of the compute node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/$$CN?pretty=1&xcoll=1&userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__ +end + +start:restapi_list_networks +description: List networks on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/networks?userName=$username&userPW=$password'" +check:rc==0 +check:output!="" +end + +start:restapi_list_osimages +description: List osimages on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/osimages?userName=$username&userPW=$password'" +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +end + +start:restapi_list_policy +description: List policies on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/policy?userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETTABLEVALUE(rule,trusted,priority,policy)__ +end + +start:restapi_create_temp_CN_put +description: Created a temporary compute node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"groups\":\"all\",\"mgt\":\"kvm\",\"vmmemory\":\"2048\"}'" +check:rc==0 +cmd:lsdef +check:output=~temp_node1 +end + +start:restapi_delete_temp_CN_put +description: Delete a temporary compute node with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password'" +check:rc==0 +cmd:lsdef +check:output!=temp_node1 +end + +start:restapi_delete_temp_CN_2 +description: Delete a temporary compute node with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" +check:rc==0 +cmd:lsdef +check:output!=temp_node1 +end + +start:restapi_create_temp_CN_post +description: Created a temporary compute node with "curl -X POST" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X POST -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node2?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"groups\":\"all\",\"mgt\":\"kvm\",\"vmmemory\":\"2048\"}'" +check:rc==0 +cmd:lsdef +check:output=~temp_node2 +end + +start:restapi_add_id_temp_CN +description: Add an id field of a temporary compute node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"id\":\"100\"}'" +check:rc==0 +cmd:lsdef temp_node1 +check:output=~id=100 +end + +start:restapi_modify_vmmemory_temp_CN +description: Modify the vmmemory field of a temporary computer node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?xcoll=1&userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"vmmemory\":\"4096\"}'" +check:rc==0 +cmd:lsdef temp_node1 +check:output=~vmmemory=4096 +end + +start:restapi_delete_id_temp_CN +description: Delete the id field of a temporary compute node with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"id\":\" \"}'" +check:rc==0 +cmd:lsdef temp_node1 +check:output!~id= +end + +start:restapi_show_temp_CN_osimage +description: Show the detail of the osimage of CN with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/osimages/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute?pretty=1&userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +end + +start:restapi_list_nodes_wrong_password +description: List nodes on the management node with an invalid password with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?userName=$username&userPW=invalid_password'" +check:rc==0 +check:output=~Authentication failure +end + +start:restapi_list_wrong_osimage +description: List a wrong osimage on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/osimages/wrong_image?userName=$username&userPW=$password'" +check:output=~Could not find an object named 'wrong_image' +end + +start:restapi_modify_wrong_field_CN +description: Modify the vmmemori field of the computer node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/$$CN?debug=1&userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"vmmemori\":\"4096\"}'" +check:rc==0 +check:output=~'vmmemori' is not a valid attribute name for an object type +end From ea5ec0fac7583c9f8149041069357a8d667f9b53 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 23 Sep 2020 16:28:33 -0400 Subject: [PATCH 69/95] Enhanced and updated REST test casees and bundle --- xCAT-test/autotest/bundle/restapi.bundle | 27 +++++++++++++++++++ .../autotest/bundle/rhels_ppcle_daily.bundle | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 xCAT-test/autotest/bundle/restapi.bundle diff --git a/xCAT-test/autotest/bundle/restapi.bundle b/xCAT-test/autotest/bundle/restapi.bundle new file mode 100644 index 000000000..ebd58aa63 --- /dev/null +++ b/xCAT-test/autotest/bundle/restapi.bundle @@ -0,0 +1,27 @@ +restapi_setup_on_MN_CN +restapi_list_all_resources +restapi_list_globalconf +restapi_list_groups +restapi_list_nodes +restapi_list_node_CN +restapi_list_networks +restapi_list_osimages +restapi_list_policy +restapi_create_temp_CN_put +restapi_delete_temp_CN_put +restapi_create_temp_CN_post +restapi_create_temp_CN_put +restapi_list_temp_CN_2 +restapi_delete_temp_CN_2 +restapi_create_temp_CN_put +restapi_add_id_temp_CN +restapi_modify_vmmemory_temp_CN +restapi_delete_id_temp_CN +restapi_show_temp_CN_osimage +restapi_list_nodes_wrong_password +restapi_list_nodes_invalid_option +restapi_list_invalid_resource +restapi_list_wrong_osimage +restapi_modify_wrong_field_CN +restapi_delete_temp_CN_put +restapi_cleanup_on_MN_CN diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index e06f4c460..d1eabfd82 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -307,4 +307,4 @@ xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab go_xcat_devel_from_repo -#INCLUDE:rhels_ppcle_restapi.bundle# +#INCLUDE:restapi.bundle# From c2876c9a1bb4308144bf128e6d2e0cac4c857e72 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 23 Sep 2020 16:40:06 -0400 Subject: [PATCH 70/95] Remove rhels_ppcle_restapi.bundle and push the new cases0 --- .../bundle/rhels_ppcle_restapi.bundle | 24 ------- xCAT-test/autotest/testcase/restapi/cases0 | 69 +++++++++++++++---- 2 files changed, 56 insertions(+), 37 deletions(-) delete mode 100644 xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle deleted file mode 100644 index 0d4b7acda..000000000 --- a/xCAT-test/autotest/bundle/rhels_ppcle_restapi.bundle +++ /dev/null @@ -1,24 +0,0 @@ -restapi_setup_on_MN_SN_CN -restapi_list_all_resources -restapi_list_globalconf -restapi_list_groups -restapi_list_nodes -restapi_list_node_CN -restapi_list_networks -restapi_list_osimages -restapi_list_policy -restapi_create_temp_CN_put -restapi_delete_temp_CN_put -restapi_create_temp_CN_post -restapi_create_temp_CN_put -restapi_delete_temp_CN_2 -restapi_create_temp_CN_put -restapi_add_id_temp_CN -restapi_modify_vmmemory_temp_CN -restapi_delete_id_temp_CN -restapi_show_temp_CN_osimage -restapi_list_nodes_wrong_password -restapi_list_wrong_osimage -restapi_modify_wrong_field_CN -restapi_delete_temp_CN_put -restapi_cleanup_on_MN_SN_CN diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index f7db774c0..a77399217 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -1,29 +1,29 @@ -start:restapi_setup_on_MN_SN_CN +start:restapi_setup_on_MN_CN description: Set up the REST API on MN and CN label:restapi -cmd:yum install mod_ssl -y +#Install the mod_ssl package on Red Hat +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi check:rc==0 cmd:sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf cmd:sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf -cmd:service httpd restart +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then service httpd restart; fi check:rc==0 cmd:scp /install/postscripts/ca/ca-cert.pem $$CN:/root check:rc==0 -cmd:tabch key=xcat,username=root passwd.password=cluster +cmd:tabch key=xcat,username=__GETTABLEVALUE(key,system,username,passwd)__ passwd.password=__GETTABLEVALUE(key,system,password,passwd)__ check:rc==0 end -start:restapi_cleanup_on_MN_SN_CN -description: Set up the REST API on MN and CN +start:restapi_cleanup_on_MN_CN +description: Clean up the REST API on MN and CN label:restapi cmd:xdsh $$CN "rm /root/ca-cert.pem" check:rc==0 cmd:tabch -d key=xcat passwd check:rc==0 -cmd:yum remove mod_ssl -y -check:rc==0 -cmd:service httpd restart -check:rc==0 +#Remove the mod_ssl package on Red Hat +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; rpm -qa | grep mod_ssl; fi +check:rc==1 end start:restapi_list_all_resources @@ -71,7 +71,7 @@ description: List networks on the management node with "curl -X GET" label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/networks?userName=$username&userPW=$password'" check:rc==0 -check:output!="" +check:output!~"" end start:restapi_list_osimages @@ -104,7 +104,7 @@ label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password'" check:rc==0 cmd:lsdef -check:output!=temp_node1 +check:output!~temp_node1 end start:restapi_delete_temp_CN_2 @@ -113,7 +113,35 @@ label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" check:rc==0 cmd:lsdef -check:output!=temp_node1 +check:output!~temp_node1 +end + +start:restapi_list_temp_CN_2 +description: Delete a temporary compute node with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1+1/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/all/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/mgt==kvm/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:lsdef +check:output=~temp_node1 +check:output=~temp_node2 end start:restapi_create_temp_CN_post @@ -168,6 +196,21 @@ check:rc==0 check:output=~Authentication failure end +start:restapi_list_nodes_invalid_option +description: List nodes on the management node with an invalid option with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?xyz=123&userName=$username&userPW=$password'" +check:rc==0 +end + +start:restapi_list_invalid_resource +description: List nodes on the management node with an invalid option with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/abc?userName=$username&userPW=invalid_password&xyz=123'" +check:rc==0 +check:output=~Unsupported resource +end + start:restapi_list_wrong_osimage description: List a wrong osimage on the management node with "curl -X GET" label:restapi From 4c5cd2c52b045259f2ea92b702c45c37c6f1eace Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 24 Sep 2020 13:54:06 -0400 Subject: [PATCH 71/95] Additional changes to the REST test cases and bundle based on Mark's comments --- xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle | 2 +- xCAT-test/autotest/testcase/restapi/cases0 | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index d1eabfd82..e948f0cda 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -306,5 +306,5 @@ xcatstanzafile_normal xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab -go_xcat_devel_from_repo #INCLUDE:restapi.bundle# +go_xcat_devel_from_repo diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index a77399217..52d2a1bd8 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -4,7 +4,7 @@ label:restapi #Install the mod_ssl package on Red Hat cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi check:rc==0 -cmd:sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf +cmd:sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf cmd:sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then service httpd restart; fi check:rc==0 @@ -55,7 +55,7 @@ description: List nodes on the management node with "curl -X GET" label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?&userName=$username&userPW=$password'" check:rc==0 -check:output=~$$CN +check:output=~$$SN end start:restapi_list_node_CN @@ -71,7 +71,7 @@ description: List networks on the management node with "curl -X GET" label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/networks?userName=$username&userPW=$password'" check:rc==0 -check:output!~"" +check:output=~__GETTABLEVALUE(mtu,1500,netname,networks)__ end start:restapi_list_osimages @@ -108,7 +108,7 @@ check:output!~temp_node1 end start:restapi_delete_temp_CN_2 -description: Delete a temporary compute node with "curl -X DELETE" +description: Delete two temporary compute nodes with "curl -X DELETE" label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" check:rc==0 @@ -117,7 +117,7 @@ check:output!~temp_node1 end start:restapi_list_temp_CN_2 -description: Delete a temporary compute node with "curl -X DELETE" +description: List two temporary compute nodes with "curl -X DELETE" and with various range options label:restapi cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" check:rc==0 From 90d1b1eca2326645877fd3b4a83fbb7fe68f8117 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 25 Sep 2020 16:40:47 -0400 Subject: [PATCH 72/95] Add perl to the rhels8 pkglist --- xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist index 0feb58550..13eb3c39b 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist @@ -9,3 +9,4 @@ wget python3 tar bzip2 +perl-interpreter 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 cbeb2b5ab..635bd5046 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 @@ -26,4 +26,5 @@ bash vim-minimal rpm iputils +perl-interpreter From b81ec51f6704607bd6fbd30f9e6d66ba3f5e5324 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 28 Sep 2020 10:35:01 -0400 Subject: [PATCH 73/95] Add `perl-interpreter` to other pkglist --- xCAT-server/share/xcat/install/centos/compute.centos8.pkglist | 1 + xCAT-server/share/xcat/install/rh/service.rhels8.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist | 1 + 3 files changed, 3 insertions(+) diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist index 0feb58550..13eb3c39b 100644 --- a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist @@ -9,3 +9,4 @@ wget python3 tar bzip2 +perl-interpreter diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist index 1cc601f9e..c21e00a25 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist @@ -13,3 +13,4 @@ unixODBC python3 tar bzip2 +perl-interpreter 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 a3ac65d01..a0ee5780b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -30,3 +30,4 @@ gzip grub2 grub2-tools lsvpd +perl-interpreter From e71e76d63fe083e55c356e4ce58cee4bbc18b062 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 28 Sep 2020 17:13:58 -0400 Subject: [PATCH 74/95] Move the REST bundle after updatenode test cases. --- xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index e948f0cda..0e45189e3 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -24,6 +24,7 @@ updatenode_syncfile_MERGE updatenode_v updatenode_without_flag updatenode_without_options +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdcp_src_dst xdsh_E @@ -306,5 +307,4 @@ xcatstanzafile_normal xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab -#INCLUDE:restapi.bundle# go_xcat_devel_from_repo From 0e4ce55881fd632f7e9daa8440a32ae52c8b2558 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 28 Sep 2020 21:50:17 -0400 Subject: [PATCH 75/95] Remove experimental warnings of using given-when and smartmatch. --- xCAT-server/lib/perl/xCAT/OPENBMC.pm | 3 ++- xCAT-server/lib/xcat/plugins/kvm.pm | 36 ++++++++++++------------- xCAT-server/lib/xcat/plugins/openbmc.pm | 3 ++- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 85188c14b..5ace2f59c 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -102,7 +102,8 @@ sub run_cmd_in_perl { # List of commands currently not supported in Python my @unsupported_in_python_commands = ('rflash', 'getopenbmccons'); - if ($command ~~ @unsupported_in_python_commands) { + my @temp = grep ({$command =~ $_ } @unsupported_in_python_commands); + if ( $command eq $temp[0]) { # Command currently not supported in Python if ($support_obmc and uc($support_obmc) eq 'YES') { return (0, ''); # Go Python: unsuppored command, but XCAT_OPENBMC_DEVEL=YES overrides diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 54b2c56fc..89be54d85 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3571,25 +3571,23 @@ sub lsvm { if (exists $domain_info->{"state"}) { my $state = $domain_info->{"state"}; my $state_string; - given($state) { - when ($state == &Sys::Virt::Domain::STATE_NOSTATE) - {$state_string = "The domain is active, but is not running / blocked (eg idle)";} - when ($state == &Sys::Virt::Domain::STATE_RUNNING) - {$state_string = "The domain is active and running";} - when ($state == &Sys::Virt::Domain::STATE_BLOCKED) - {$state_string = "The domain is active, but execution is blocked";} - when ($state == &Sys::Virt::Domain::STATE_PAUSED) - {$state_string = "The domain is active, but execution has been paused";} - when ($state == &Sys::Virt::Domain::STATE_SHUTDOWN) - {$state_string = "The domain is active, but in the shutdown phase";} - when ($state == &Sys::Virt::Domain::STATE_SHUTOFF) - {$state_string = "The domain is inactive, and shut down";} - when ($state == &Sys::Virt::Domain::STATE_CRUSHED) - {$state_string = "The domain is inactive, and crashed";} - when ($state == &Sys::Virt::Domain::STATE_PMSUSPENDED) - {$state_string = "The domain is active, but in power management suspend state";} - default {$state_string = "Unknown"}; - } + if ($state == &Sys::Virt::Domain::STATE_NOSTATE) + {$state_string = "The domain is active, but is not running / blocked (eg idle)";} + elsif ($state == &Sys::Virt::Domain::STATE_RUNNING) + {$state_string = "The domain is active and running";} + elsif ($state == &Sys::Virt::Domain::STATE_BLOCKED) + {$state_string = "The domain is active, but execution is blocked";} + elsif ($state == &Sys::Virt::Domain::STATE_PAUSED) + {$state_string = "The domain is active, but execution has been paused";} + elsif ($state == &Sys::Virt::Domain::STATE_SHUTDOWN) + {$state_string = "The domain is active, but in the shutdown phase";} + elsif ($state == &Sys::Virt::Domain::STATE_SHUTOFF) + {$state_string = "The domain is inactive, and shut down";} + elsif ($state == &Sys::Virt::Domain::STATE_CRUSHED) + {$state_string = "The domain is inactive, and crashed";} + elsif ($state == &Sys::Virt::Domain::STATE_PMSUSPENDED) + {$state_string = "The domain is active, but in power management suspend state";} + else {$state_string = "Unknown"}; push @vms, "State :" . $domain_info->{"state"} . " ($state_string)"; } # The following block of code copied from rscan command processng for disks diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6681768f9..02556f403 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1255,7 +1255,8 @@ sub parse_args { my $option_s; GetOptions( 's' => \$option_s ); return ([ 1, "The -s option is not supported for OpenBMC." ]) if ($option_s); - if ( "resolved=" ~~ @ARGV) { + my @temp = grep ({$command =~ $_ } @ARGV); + if ( "resolved=" eq $temp[0]) { return ([ 1, "$usage_errormsg $reventlog_no_id_resolved_errormsg" ]); } return ([ 1, "Only one option is supported at the same time for $command" ]); From a5535becc56273f8d64067dbece7ab5bf155171d Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Mon, 28 Sep 2020 22:10:47 -0400 Subject: [PATCH 76/95] Make one correction. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 02556f403..456a8b802 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1255,7 +1255,7 @@ sub parse_args { my $option_s; GetOptions( 's' => \$option_s ); return ([ 1, "The -s option is not supported for OpenBMC." ]) if ($option_s); - my @temp = grep ({$command =~ $_ } @ARGV); + my @temp = grep ({"resolved" =~ $_ } @ARGV); if ( "resolved=" eq $temp[0]) { return ([ 1, "$usage_errormsg $reventlog_no_id_resolved_errormsg" ]); } From 3fbf3bba032a5dbe398d9992b1be4425253f2bf7 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 29 Sep 2020 12:38:37 -0400 Subject: [PATCH 77/95] Add REST test cases to RHEL x86 systems. --- xCAT-test/autotest/bundle/rhels_x86_daily.bundle | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index ebb084bab..29bda82ab 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -24,6 +24,7 @@ updatenode_syncfile_MERGE updatenode_v updatenode_without_flag updatenode_without_options +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdcp_src_dst xdsh_E From dda618c903310cfca1e2e33a28b94a9d08ba36b4 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 30 Sep 2020 15:56:10 -0400 Subject: [PATCH 78/95] Modify restapi_list_groups for correct output matching --- xCAT-test/autotest/testcase/restapi/cases0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 52d2a1bd8..e61d1de55 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -45,7 +45,8 @@ end start:restapi_list_groups description: List groups on the management node with "curl -X GET" label:restapi -cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password'" +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$ +username&userPW=$password' | sed 's/\"//g'" check:rc==0 check:output=~__GETTABLEVALUE(node,$$CN,groups,nodelist)__ end From e46c41ad7d7597aecd91f95b757740fc29ba7791 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 1 Oct 2020 12:47:20 -0400 Subject: [PATCH 79/95] Fix restapi_list_groups: The command was in TWO lines, not ONE. --- xCAT-test/autotest/testcase/restapi/cases0 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index e61d1de55..06eba7fa6 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -45,8 +45,7 @@ end start:restapi_list_groups description: List groups on the management node with "curl -X GET" label:restapi -cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$ -username&userPW=$password' | sed 's/\"//g'" +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g'" check:rc==0 check:output=~__GETTABLEVALUE(node,$$CN,groups,nodelist)__ end From 5c799f6d4490cb65eac5593a18c266c740b7da19 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 1 Oct 2020 21:55:52 -0400 Subject: [PATCH 80/95] Extend the REST test cases to SLES --- xCAT-test/autotest/testcase/restapi/cases0 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 06eba7fa6..7a1e86558 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -4,10 +4,19 @@ label:restapi #Install the mod_ssl package on Red Hat cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi check:rc==0 -cmd:sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf -cmd:sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi +check:rc==0 cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then service httpd restart; fi check:rc==0 +#Configure the SLES environment +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then a2enmod ssl; a2enflag SSL; cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/vhost-ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/apache2/vhosts.d/vhost-ssl.conf; fi +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/apache2/vhosts.d/vhost-ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then service apache2 restart; fi +check:rc==0 cmd:scp /install/postscripts/ca/ca-cert.pem $$CN:/root check:rc==0 cmd:tabch key=xcat,username=__GETTABLEVALUE(key,system,username,passwd)__ passwd.password=__GETTABLEVALUE(key,system,password,passwd)__ @@ -22,8 +31,11 @@ check:rc==0 cmd:tabch -d key=xcat passwd check:rc==0 #Remove the mod_ssl package on Red Hat -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; rpm -qa | grep mod_ssl; fi -check:rc==1 +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi +check:rc==0 +#Clean up the SLES environment +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then rm /etc/apache2/vhosts.d/vhost-ssl.conf; service apache2 restart; fi +check:rc==0 end start:restapi_list_all_resources From e74c6a904bb15f5ae8a8f01d5676d28f2b32cb2c Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 2 Oct 2020 08:48:33 -0400 Subject: [PATCH 81/95] Include restapi.bundle to SLES bundles --- xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index a8cd4835e..63dfc7e00 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -7,6 +7,7 @@ assign_certain_command_permission bmcdiscover_help bmcdiscover_q bmcdiscover_version +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdsh_E xdsh_Q_command diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index b4f20bab7..7aaf23dc5 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -7,6 +7,7 @@ assign_certain_command_permission bmcdiscover_help bmcdiscover_q bmcdiscover_version +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdsh_E xdsh_Q_command From 765defe136ba3c0bd63506fbb645961695714536 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 6 Oct 2020 17:03:24 -0400 Subject: [PATCH 82/95] Compare the curl and lsdef output in restapi_list_groups --- xCAT-test/autotest/testcase/restapi/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 7a1e86558..42c38d861 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -57,9 +57,9 @@ end start:restapi_list_groups description: List groups on the management node with "curl -X GET" label:restapi -cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g'" +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; if [[ $curl_v = $lsdef_v ]]; then echo YES; else echo NO; fi check:rc==0 -check:output=~__GETTABLEVALUE(node,$$CN,groups,nodelist)__ +check:output=~YES end start:restapi_list_nodes From f847bc85c1a2575a8461229da71f53d911aad570 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 6 Oct 2020 17:18:11 -0400 Subject: [PATCH 83/95] remove list list1 --- xCAT-test/autotest/testcase/restapi/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 42c38d861..10c5ce40b 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -57,7 +57,7 @@ end start:restapi_list_groups description: List groups on the management node with "curl -X GET" label:restapi -cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; if [[ $curl_v = $lsdef_v ]]; then echo YES; else echo NO; fi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; rm -f list list1; if [[ $curl_v = $lsdef_v ]]; then echo YES; else echo NO; fi check:rc==0 check:output=~YES end From a7be7e6929742287b383fde5fc9c86451223abca Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Tue, 6 Oct 2020 17:35:29 -0400 Subject: [PATCH 84/95] Return Match or No-Match --- xCAT-test/autotest/testcase/restapi/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 10c5ce40b..6b7b2cb6f 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -57,9 +57,9 @@ end start:restapi_list_groups description: List groups on the management node with "curl -X GET" label:restapi -cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; rm -f list list1; if [[ $curl_v = $lsdef_v ]]; then echo YES; else echo NO; fi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; rm -f list list1; if [[ $curl_v = $lsdef_v ]]; then echo Match; else echo No-Match; fi check:rc==0 -check:output=~YES +check:output=~Match end start:restapi_list_nodes From 762e1becc2704f4a9fc27ca1e5201e45c5effc85 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Wed, 7 Oct 2020 09:46:38 -0400 Subject: [PATCH 85/95] Replace No-Match by No-match for correct regex comparison --- xCAT-test/autotest/testcase/restapi/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 6b7b2cb6f..94b30dd59 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -57,7 +57,7 @@ end start:restapi_list_groups description: List groups on the management node with "curl -X GET" label:restapi -cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; rm -f list list1; if [[ $curl_v = $lsdef_v ]]; then echo Match; else echo No-Match; fi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; rm -f list list1; if [[ $curl_v = $lsdef_v ]]; then echo Match; else echo No-match; fi check:rc==0 check:output=~Match end From 6013ccd5a16f068c679249dd8996ef2359a9b193 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 8 Oct 2020 16:45:00 -0400 Subject: [PATCH 86/95] Get the correct path for nice command --- .../add-on/statelite/rc.statelite.ppc.redhat | 7 ++++++- xCAT/postscripts/getcredentials.awk | 17 +++++++++++++++-- xCAT/postscripts/getpostscript.awk | 17 +++++++++++++++-- xCAT/postscripts/startsyncfiles.awk | 17 +++++++++++++++-- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 8aa5dac22..9cc8b7a14 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -128,7 +128,12 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null + if [ -f "/usr/bin/nice" ]; then + NICE="/usr/bin/nice" + else + NICE="/bin/nice" + fi + echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand ${NICE} 2>/dev/null } diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 67300becf..31f1c1750 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -1,9 +1,22 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /bin/nice")) { + nice = "/bin/nice" + } else if (!system("test -f /usr/bin/nice")) { + nice = "/usr/bin/nice" + } else { + print "Error: nice utility missing" + exit 1 + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) { - server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index 985b34dcb..062636f7f 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -1,9 +1,22 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /bin/nice")) { + nice = "/bin/nice" + } else if (!system("test -f /usr/bin/nice")) { + nice = "/usr/bin/nice" + } else { + print "Error: nice utility missing" + exit 1 + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index c9af5345b..0cf6489f7 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -1,9 +1,22 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /bin/nice")) { + nice = "/bin/nice" + } else if (!system("test -f /usr/bin/nice")) { + nice = "/usr/bin/nice" + } else { + print "Error: nice utility missing" + exit 1 + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" From 2878022b95ae7d53c7250abb044aecee0484e210 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 9 Oct 2020 15:19:27 -0400 Subject: [PATCH 87/95] able to run no random bytes if /usr/bin/nice is not available --- .../add-on/statelite/rc.statelite.ppc.redhat | 6 +++--- xCAT/postscripts/getcredentials.awk | 13 +++++-------- xCAT/postscripts/getpostscript.awk | 13 +++++-------- xCAT/postscripts/startsyncfiles.awk | 13 +++++-------- 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 9cc8b7a14..deaadde40 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -129,11 +129,11 @@ xCATCmd () { # $1 is the xCAT server # $2 is the command if [ -f "/usr/bin/nice" ]; then - NICE="/usr/bin/nice" + RANDOMBYTES="-rand /usr/bin/nice" else - NICE="/bin/nice" + RANDOMBYTES="" fi - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand ${NICE} 2>/dev/null + echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} ${RANDOMBYTES} 2>/dev/null } diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 31f1c1750..0cbf2fdfb 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -1,12 +1,9 @@ #!/usr/bin/awk -f BEGIN { - if (!system("test -f /bin/nice")) { - nice = "/bin/nice" - } else if (!system("test -f /usr/bin/nice")) { - nice = "/usr/bin/nice" + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" } else { - print "Error: nice utility missing" - exit 1 + randombytes = "" } if (!system("test -f openssl")) { print "Error: openssl utility missing" @@ -14,9 +11,9 @@ BEGIN { } if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) { - server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index 062636f7f..e4ffd3006 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -1,12 +1,9 @@ #!/usr/bin/awk -f BEGIN { - if (!system("test -f /bin/nice")) { - nice = "/bin/nice" - } else if (!system("test -f /usr/bin/nice")) { - nice = "/usr/bin/nice" + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" } else { - print "Error: nice utility missing" - exit 1 + randombytes = "" } if (!system("test -f openssl")) { print "Error: openssl utility missing" @@ -14,9 +11,9 @@ BEGIN { } if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index 0cf6489f7..0c85ae262 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -1,12 +1,9 @@ #!/usr/bin/awk -f BEGIN { - if (!system("test -f /bin/nice")) { - nice = "/bin/nice" - } else if (!system("test -f /usr/bin/nice")) { - nice = "/usr/bin/nice" + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" } else { - print "Error: nice utility missing" - exit 1 + randombytes = "" } if (!system("test -f openssl")) { print "Error: openssl utility missing" @@ -14,9 +11,9 @@ BEGIN { } if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" From ac6f13a107837565f1cdbb88cf6229019e1bed42 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 12 Oct 2020 16:18:53 -0400 Subject: [PATCH 88/95] Undo genesistest retries --- xCAT-test/autotest/testcase/genesis/genesistest.pl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 60b5efc27..06fb8c869 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -114,11 +114,8 @@ if ($genesis_nodesetshell_test) { if ($genesis_runcmd_test) { send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); if (&testxdsh(&rungenesiscmd(&get_arch))) { - send_msg(0, "[$$]:Could not verify runcmd test results using testxdsh() on first attempt, will try again..............."); - if (&testxdsh(&rungenesiscmd(&get_arch))) { - send_msg(0, "[$$]:Could not verify runcmd test results using testxdsh() on second attempt, giving up..............."); - exit 1; - } + send_msg(0, "[$$]:Could not verify runcmd test results using testxdsh() ..............."); + exit 1; } send_msg(2, "[$$]:Running runcmd test success..............."); } @@ -128,11 +125,8 @@ if ($genesis_runcmd_test) { if ($genesis_runimg_test) { send_msg(2, "[$$]:Run nodeset NODE runimage test..............."); if (&testxdsh(&rungenesisimg)) { - send_msg(0, "[$$]:Could not verify runimage test results using testxdsh() on first attmpt, will try again..............."); - if (&testxdsh(&rungenesisimg)) { - send_msg(0, "[$$]:Could not verify runimage test results using itestxdsh() on second attempt, giving up..............."); - exit 1; - } + send_msg(0, "[$$]:Could not verify runimage test results using testxdsh() ..............."); + exit 1; } send_msg(2, "[$$]:Running runimage test success..............."); From 9387fdd33bb2ab9247f403cd010a0e267f0f9791 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 13 Oct 2020 12:09:04 -0400 Subject: [PATCH 89/95] Add cpio command as required for xCAT-client packages --- xCAT-client/xCAT-client.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 5b44dabcf..cd64489bd 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -25,6 +25,7 @@ BuildArch: noarch %endif Requires: perl-xCAT = 4:%{version}-%{release} +Requires: cpio # fping or nmap is needed by pping (in case xCAT-client is installed by itself on a remote client) %ifos linux From caea18c0f541f2f23b4dd1cd003e14c168af4c0e Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 13 Oct 2020 16:23:31 -0400 Subject: [PATCH 90/95] rinv dimm display for Power nodes --- xCAT-server/lib/xcat/plugins/ipmi.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index c1acfe332..916a8b081 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -3950,7 +3950,8 @@ sub initfru_zero { next; } - if ($sdr->fru_subtype == 0x1) { #DIMM + if ($sdr->id_string =~ "DIMM") { #DIMM. + # Can not always use "fru_subtype=1" for DIMM, sometimes on Power it is 2 push @{ $sessdata->{dimmfru} }, $sdr; } elsif ($sdr->fru_subtype == 0 or $sdr->fru_subtype == 2) { push @{ $sessdata->{genhwfru} }, $sdr; @@ -4213,7 +4214,14 @@ sub add_fruhash { $sessdata->{frudex} += 1; } elsif ($sessdata->{currfrutype} and $sessdata->{currfrutype} eq 'dimm') { $fruhash = decode_spd(@{ $sessdata->{currfrudata} }); + if ($fruhash->{product}->{model} =~ "Unrecognized SPD") { + # If decode_spd() was not able to parse SPD data for DIMM, try parsefru() + # + # Yes, it is a goto statement here. Ugly, but removes the need to restructure + goto PARSEFRU_DIMM; + } } else { +PARSEFRU_DIMM: my $err; $global_sessdata = $sessdata; #pass by global, evil, but practical this time ($err, $fruhash) = parsefru($sessdata->{currfrudata}); @@ -4226,7 +4234,7 @@ sub add_fruhash { $fru->rec_type("hw"); } $fru->value($err); - if ($sessdata->{currfrusdr}) { + if ($sessdata->{currfrusdr} and scalar keys %{$sessdata->{currfrusdr}} ) { $fru->desc($sessdata->{currfrusdr}->id_string); } if (exists($sessdata->{frudex})) { @@ -4245,6 +4253,7 @@ sub add_fruhash { } elsif (ref $sessdata->{currfrudata}) { if ($sessdata->{currfrutype} and $sessdata->{currfrutype} eq 'dimm') { add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "", "product", "dimm,hw", $sessdata); + add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "Board ", "board", "dimm,hw", $sessdata); } else { add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "Board ", "board", undef, $sessdata); add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "Product ", "product", undef, $sessdata); From 75bccc6d7f24b0c5fb64cbb551f56d5cfd079fe5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Oct 2020 13:15:50 -0400 Subject: [PATCH 91/95] Only install bridge-utils on RH7.x --- xCAT-test/autotest/testcase/confignetwork/cases0 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 586e218de..b1b4b6ed4 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -607,7 +607,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -663,7 +663,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -712,7 +712,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -780,7 +780,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -835,7 +835,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -902,7 +902,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 @@ -968,7 +968,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 check:rc==0 cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 From d96faa74300d347baee41b7c2ebb7cf93254cc1b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Oct 2020 16:37:30 -0400 Subject: [PATCH 92/95] Use yum list to check if package is available --- xCAT-test/autotest/testcase/confignetwork/cases0 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index b1b4b6ed4..911f01641 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -607,7 +607,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -663,7 +663,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -712,7 +712,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -780,7 +780,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -835,7 +835,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -902,7 +902,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 @@ -968,7 +968,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release | grep "release 7";then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 check:rc==0 cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 From a6a0f92096e0147cf64e87a2ee12188c9a1910ac Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 22 Oct 2020 13:53:02 -0400 Subject: [PATCH 93/95] Use number of SDR records for SDR cache filename --- xCAT-server/lib/xcat/plugins/ipmi.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 916a8b081..7e3580561 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -7537,20 +7537,22 @@ sub initsdr_withrepinfo { my $dev_rev = $sessdata->{device_rev}; my $fw_rev1 = $sessdata->{firmware_rev1}; my $fw_rev2 = $sessdata->{firmware_rev2}; + my $num_sdr_records = $sessdata->{sdr_info}->{rec_count}; #TODO: beware of dynamic SDR contents - my $cache_file = "$cache_dir/sdr_$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"; + my $cache_name_id = "$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2.$num_sdr_records"; + my $cache_file = "$cache_dir/sdr_$cache_name_id"; $sessdata->{sdrcache_file} = $cache_file; if ($enable_cache eq "yes") { - if ($sdr_caches{"$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"}) { - $sessdata->{sdr_hash} = $sdr_caches{"$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"}; + if ($sdr_caches{"$cache_name_id"}) { + $sessdata->{sdr_hash} = $sdr_caches{"$cache_name_id"}; on_bmc_connect("SUCCESS", $sessdata); #retry bmc_connect since sdr_cache is validated return; #don't proceed to slow load } else { my $rc = loadsdrcache($sessdata, $cache_file); if ($rc == 0) { - $sdr_caches{"$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"} = $sessdata->{sdr_hash}; + $sdr_caches{"$cache_name_id"} = $sessdata->{sdr_hash}; on_bmc_connect("SUCCESS", $sessdata); #retry bmc_connect since sdr_cache is validated return; #don't proceed to slow load } @@ -8210,6 +8212,7 @@ sub decodebcd { return ($text); } +# Save SDR "metadata" into cache file sub storsdrcache { my $file = shift; my $sessdata = shift; @@ -8237,6 +8240,7 @@ sub storsdrcache { return (0); } +# Load SDR "metadata" from cache file sub loadsdrcache { my $sessdata = shift; my $file = shift; From af8aab33748ab532c5ad7634be1f452d7e7e9806 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 28 Oct 2020 11:13:18 -0400 Subject: [PATCH 94/95] Adding 2.16.1 release information --- docs/source/overview/_files/2.15.x.csv | 4 +--- docs/source/overview/_files/2.16.x.csv | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/source/overview/_files/2.15.x.csv b/docs/source/overview/_files/2.15.x.csv index 6002574dc..4f4fca053 100644 --- a/docs/source/overview/_files/2.15.x.csv +++ b/docs/source/overview/_files/2.15.x.csv @@ -1,5 +1,3 @@ Version,Release Date,New OS Supported,Release Notes - -2.15.1,2020-03-06,"RHEL 8.1,RHEL 7.7,SLES 15.0",`2.15.1 Release Notes `_ +2.15.1,2020-03-06,"RHEL 7.7",`2.15.1 Release Notes `_ 2.15.0,2019-11-11,"RHEL 8.0",`2.15.0 Release Notes `_ - diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index 004364bfb..d38a4fa6e 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,4 +1,3 @@ Version,Release Date,New OS Supported,Release Notes - -2.16.0,2020-06-17,,`2.16.0 Release Notes `_ - +2.16.0,2020-06-17,"RHEL 8.1,SLES 15",`2.16.0 Release Notes `_ +2.16.1,2020-11-06,"RHEL 8.2",`2.16.1 Release Notes `_ From 8507da495c472918a45c145ef49a7f29397dc451 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 28 Oct 2020 13:42:02 -0400 Subject: [PATCH 95/95] Entry order change --- docs/source/overview/_files/2.16.x.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index d38a4fa6e..ae69165bc 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,3 +1,3 @@ Version,Release Date,New OS Supported,Release Notes -2.16.0,2020-06-17,"RHEL 8.1,SLES 15",`2.16.0 Release Notes `_ 2.16.1,2020-11-06,"RHEL 8.2",`2.16.1 Release Notes `_ +2.16.0,2020-06-17,"RHEL 8.1,SLES 15",`2.16.0 Release Notes `_