From 3b114aa3538e199eb4f0c3ee2f37a5357fc266cf Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 20 Apr 2017 02:59:20 -0400 Subject: [PATCH 001/201] This case is to verify bug 2521 to test when there is mgtifname is defined as remote networks, makedhcp could work correctly and create entrys in dhcp lease file --- xCAT-test/autotest/testcase/makedhcp/cases0 | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 64f87a839..40b772526 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -176,3 +176,31 @@ check:output!~$$CN cmd:makedhcp -a end +start:makedhcp_remote_network_bug2521 +descriptiion:This case is to verify bug 2521 to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. +cmd:mkdef -t network -o testnetwork net=100.100.100.0 mask=255.255.255.0 mgtifname='!remote!eth0' gateway=100.100.100.1 +check:rc==0 +cmd:lsdef -t network +check:rc==0 +check:output=~testnetwork +check:rc==0 +cmd:mkdef -t node -o testnode ip=100.100.100.2 groups=all mac=42:3d:0a:05:27:0b +check:rc==0 +cmd: cp -f /etc/hosts /etc/hosts.bak +cmd:echo "100.100.100.2 testnode" >> /etc/hosts +check:rc==0 +cmd:makedhcp testnode +check:rc==0 +cmd:makdhcp -q testnode +check:rc==0 +check:output=~testnode: ip-address = 100.100.100.2 +cmd:makdhcp -d testnode +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:noderm testnode +check:rc==0 +cmd:chtab -d netname=testnetwork networks +check:rc==0 +cmd:cp -f /etc/hosts.bak /etc/hosts +end From b7868cccef7bce1ccac0bac460ed2367fb9ad4b0 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 21 Apr 2017 04:47:32 -0400 Subject: [PATCH 002/201] update according to comments --- xCAT-test/autotest/testcase/makedhcp/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 40b772526..b56db6f91 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -176,8 +176,8 @@ check:output!~$$CN cmd:makedhcp -a end -start:makedhcp_remote_network_bug2521 -descriptiion:This case is to verify bug 2521 to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. +start:makedhcp_remote_network +descriptiion:This case is to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. cmd:mkdef -t network -o testnetwork net=100.100.100.0 mask=255.255.255.0 mgtifname='!remote!eth0' gateway=100.100.100.1 check:rc==0 cmd:lsdef -t network From 3f03d53e8b71e854494c4191832d5c1a90a029aa Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 25 Apr 2017 16:51:24 -0400 Subject: [PATCH 003/201] Initialized more_options variable to avoid uninitialized error message --- xCAT-server/lib/xcat/plugins/nodestat.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index 94c2969f2..3dfb73b67 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -649,7 +649,10 @@ sub process_request_nmap { # get additional options from site table my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); - my $more_options = $nmap_options[0]; + my $more_options = ""; + if (defined($nmap_options[0])) { + $more_options = $nmap_options[0]; + } foreach my $ip6 (0, 1) { #first pass, ipv4, second pass ipv6 if ($ip6 and scalar(@ip6s)) { From a9bf99652503a7eabc5bcd9985b6072bf1d7f5cf Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 3 May 2017 04:55:43 -0400 Subject: [PATCH 004/201] Modify xcat-genesis-builder script for Fedora26 ppc64 --- xCAT-genesis-builder/buildrpm | 39 +++++++++++++++++++---------------- xCAT-genesis-builder/install | 17 +++++++-------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index f301961a3..25a37c743 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -133,30 +133,32 @@ if [ "$HOSTOS" = "mcp" ]; then # For ppc64 platform, needs to remove some files, # # and some files are in different directories elif [ $BUILDARCH = "ppc64" ]; then - sed -i 's/dracut_install efibootmgr//' $DRACUTMODDIR/install + sed -i 's/ efibootmgr//' $DRACUTMODDIR/install sed -i 's/ dmidecode//' $DRACUTMODDIR/install - sed -i 's/\/lib\/libncurses.so.5.7/\/lib64\/libncurses.so.5.7/' $DRACUTMODDIR/install - sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.13/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libgcc_s.so.1/\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.7/' $DRACUTMODDIR/install + # Remove the libraries with special version number, starting from Fedora 26 Alpha ppc64 + # ========================================================== + #sed -i 's/\/lib\/libncurses.so.5.7/\/lib64\/libncurses.so.5.7/' $DRACUTMODDIR/install + #sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.13/' $DRACUTMODDIR/install + #sed -i 's/\/lib\/libgcc_s.so.1/\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install + #sed -i 's/\/lib\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.7/' $DRACUTMODDIR/install # following changes are required on Fedora 20 ppc64 # sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install - # following changes are required on Fedora 23 ppc64 - sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.22.so/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libc.so.6/\/lib64\/libc.so.6/' $DRACUTMODDIR/install + # following changes are required on Fedora 26 Alpha ppc64 + #sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.25.so/' $DRACUTMODDIR/install + #sed -i 's/\/lib\/libc.so.6/\/lib64\/libc.so.6/' $DRACUTMODDIR/install # following changes are required on Fedora 23 ppc64 #sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.18.so/' $DRACUTMODDIR/install - sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.22.so/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libdl.so.2/\/lib64\/libdl.so.2/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libm.so.6/\/lib64\/libm.so.6/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libpthread.so.0/\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install - sed -i 's/\/lib64\/libncurses.so.5.7/\/lib64\/libncurses.so.5.9/' $DRACUTMODDIR/install - # following changes are required on Fedora 22 ppc64 + #sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.25.so/' $DRACUTMODDIR/install + #sed -i 's/\/lib\/libdl.so.2/\/lib64\/libdl.so.2/' $DRACUTMODDIR/install + #sed -i 's/\/lib\/libm.so.6/\/lib64\/libm.so.6/' $DRACUTMODDIR/install + #sed -i 's/\/lib\/libpthread.so.0/\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install + #sed -i 's/\/lib64\/libncurses.so.5.7/\/lib64\/libncurses.so.6.0/' $DRACUTMODDIR/install #sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.19/' $DRACUTMODDIR/install - sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.21/' $DRACUTMODDIR/install - sed -i 's/\/lib64\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.9/' $DRACUTMODDIR/install - sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install + #sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.23/' $DRACUTMODDIR/install + #sed -i 's/\/lib64\/libtinfo.so.5.7/\/lib64\/libtinfo.so.6.0/' $DRACUTMODDIR/install + #sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install #sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install + # ========================================================== sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install fi @@ -189,7 +191,8 @@ cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi # add the perl library -PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5" +# add /usr/share/ntp/lib for Fedora26 ppc64, the ntp-perl will installed libraries under it +PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/share/ntp/lib" for d in `echo $PERL_LIB_DIR`; do if [ -e $d ]; then echo Adding perl libary "$d" diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 2f1d0507f..36ee6207b 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -5,18 +5,16 @@ dracut_install netstat # broadcom update requires dracut_install uniq # mellanox update requires dracut_install grep ip hostname /usr/bin/awk egrep grep dirname expr dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 mkfs.xfs xfs_db #mkfs.btrfs removed -dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad -dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 dracut_install poweroff ntpq ntpd ntp-wait hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc -dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements -dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si -dracut_install dmidecode /usr/lib64/libstdc++.so.5 #broadcom firmware update links against old lib -dracut_install /lib/libpthread.so.0 #32 bit lib because UXSPI will not ship a native 64 bit build -dracut_install /lib/libncurses.so.5.7 /usr/lib/libstdc++.so.6.0.13 /lib/libgcc_s.so.1 /lib/libtinfo.so.5.7 -dracut_install /lib64/libldap-2.4.so.2 /lib64/liblber-2.4.so.2 /usr/lib64/libsasl2.so.2 #uxspi has incurred these... +dracut_install chmod /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements +dracut_install efibootmgr lldptool dmidecode #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si +#dracut_install dmidecode /usr/lib64/libstdc++.so.5 #broadcom firmware update links against old lib +#dracut_install /lib/libpthread.so.0 #32 bit lib because UXSPI will not ship a native 64 bit build +#dracut_install /lib/libncurses.so.5.7 /usr/lib/libstdc++.so.6.0.13 /lib/libgcc_s.so.1 /lib/libtinfo.so.5.7 +#dracut_install /lib64/libldap-2.4.so.2 /lib64/liblber-2.4.so.2 /usr/lib64/libsasl2.so.2 #uxspi has incurred these... dracut_install /usr/share/zoneinfo/posix/Zulu dracut_install /usr/share/zoneinfo/posix/GMT-0 dracut_install /usr/share/zoneinfo/posix/Europe/Istanbul @@ -594,7 +592,6 @@ inst_dir /var/lib/nfs/statd/sm inst_dir /var/lib/nfs/statd/sm.bak inst_dir /var/lib/nfs/rpc_pipefs/nfs inst "/bin/bash" "/bin/sh" -inst "/lib64/libnss_dns-2.12.so" inst "/lib/terminfo/l/linux" "/lib/terminfo/l/linux" inst "/lib/terminfo/v/vt100" "/lib/terminfo/v/vt100" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" @@ -624,4 +621,4 @@ dracut_install /lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/share/hwdata/pci.ids # The DB files for udevadm dracut_install /etc/udev/hwdb.bin -dracut_install /lib64/libform.so.5 /lib64/libpanel.so.5 /lib64/libmenu.so.5 /lib64/libsysfs.so.2 /usr/sbin/iprconfig # iprconfig for IBM Power RAID configuration +dracut_install /usr/sbin/iprconfig # iprconfig for IBM Power RAID configuration From 7a8d431650b1be81112c5e8e971f942d51eaecc1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 2 May 2017 10:49:39 -0400 Subject: [PATCH 005/201] Initialize IPMI variables earlier In some scenarios, an IPMI instance could be called to handle data earlier than it should. Ensure the state of the object is in adequate shape to react as soon as possible. --- xCAT-server/lib/perl/xCAT/IPMI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index d7223dc6b..54d33289a 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -181,6 +181,7 @@ sub new { my $self = {}; bless $self, $class; my %args = @_; + $self->init(); unless ($ipmi2support) { $self->{ipmi15only} = 1; } @@ -238,7 +239,6 @@ sub new { } else { $self->{peeraddr} = sockaddr_in($self->{port}, $bmc_n); } - $self->init(); return $self; } From 13ee6733e706b76f50f23e7c9e8fae30e5b2c602 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 2 May 2017 11:19:54 -0400 Subject: [PATCH 006/201] Fix FPC reseat behavior on multiple nodes --- xCAT-server/lib/perl/xCAT/IPMI.pm | 8 ++++++++ xCAT-server/lib/xcat/plugins/ipmi.pm | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 54d33289a..bd0b480c6 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -471,6 +471,11 @@ sub checksum { sub subcmd { my $self = shift; my %args = @_; + while ($self->{incommand}) { + $self->waitforrsp(); + } + $self->{incommand} = 1; + $self->{expectedcmd} = $args{command}; $self->{expectednetfn} = $args{netfn} + 1; if ($self->{onlogon_args}->{xcatdebugmode}) { @@ -573,6 +578,7 @@ sub timedout { $self->{timeout} = $initialtimeout + (0.5 * rand()); my $rsp = {}; $rsp->{error} = "timeout"; + $self->{incommand} = 0; $self->{ipmicallback}->($rsp, $self->{ipmicallback_args}); $self->{nowait} = 0; return; @@ -833,6 +839,7 @@ sub init { #if we should incur 7 bumps, clear the taboo list and continue on, hoping for best (pessimistically assuming the spec means seq number or that someone could at least interpret it that way) #I'll implement this later... $self->{'logged'} = 0; + $self->{'incommand'} = 0; } sub relog { @@ -1008,6 +1015,7 @@ sub parse_ipmi_payload { $rsp->{code} = shift @payload; $rsp->{data} = \@payload; $self->{timeout} = $initialtimeout + (0.5 * rand()); + $self->{incommand} = 0; $self->{ipmicallback}->($rsp, $self->{ipmicallback_args}); return 0; } diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 00302d365..9bbecab53 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2301,6 +2301,8 @@ sub fpc_firmxfer_watch { } } +my %fpcsessions; + sub reseat_node { my $sessdata = shift; if (1) { # TODO: FPC path checked for @@ -2321,8 +2323,19 @@ sub reseat_node { my $nodeuser = $authdata->{$fpc}->{username}; my $nodepass = $authdata->{$fpc}->{password}; $sessdata->{slotnumber} = $mpent->{id}; - $sessdata->{fpcipmisession} = xCAT::IPMI->new(bmc => $mpent->{mpa}, userid => $nodeuser, password => $nodepass); - $sessdata->{fpcipmisession}->login(callback => \&fpc_node_reseat, callback_args => $sessdata); + if (exists $fpcsessions{$mpent->{mpa}}) { + $sessdata->{fpcipmisession} = $fpcsessions{$mpent->{mpa}}; + until ($sessdata->{fpcipmisession}->{logged}) { + $sessdata->{fpcipmisession}->waitforrsp(); + } + $sessdata->{fpcipmisession}->subcmd(netfn => 0x32, command => 0xa4, + data => [ $sessdata->{slotnumber}, 2 ], + callback => \&fpc_node_reseat_complete, callback_args => $sessdata); + } else { + $sessdata->{fpcipmisession} = xCAT::IPMI->new(bmc => $mpent->{mpa}, userid => $nodeuser, password => $nodepass); + $fpcsessions{$mpent->{mpa}} = $sessdata->{fpcipmisession}; + $sessdata->{fpcipmisession}->login(callback => \&fpc_node_reseat, callback_args => $sessdata); + } } } From e61b6c3789fa3d77b08d3693800962c5858699db Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 3 May 2017 11:34:22 -0400 Subject: [PATCH 007/201] Implement timeout for session sharing When an ipmi session is shared, have waitforrsp have a specified timeout. --- xCAT-server/lib/perl/xCAT/IPMI.pm | 2 +- xCAT-server/lib/xcat/plugins/ipmi.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index bd0b480c6..4b444ac48 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -472,7 +472,7 @@ sub subcmd { my $self = shift; my %args = @_; while ($self->{incommand}) { - $self->waitforrsp(); + $self->waitforrsp(timeout=>1); } $self->{incommand} = 1; diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 9bbecab53..fc10adc97 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2326,7 +2326,7 @@ sub reseat_node { if (exists $fpcsessions{$mpent->{mpa}}) { $sessdata->{fpcipmisession} = $fpcsessions{$mpent->{mpa}}; until ($sessdata->{fpcipmisession}->{logged}) { - $sessdata->{fpcipmisession}->waitforrsp(); + $sessdata->{fpcipmisession}->waitforrsp(timeout=>1); } $sessdata->{fpcipmisession}->subcmd(netfn => 0x32, command => 0xa4, data => [ $sessdata->{slotnumber}, 2 ], From a17edd7080107375e41f7e36258302569e5928b0 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 5 May 2017 09:53:28 -0400 Subject: [PATCH 008/201] Support vlan configration for Mellanox Ethernet switch --- xCAT-server/share/xcat/scripts/configMellanox | 100 +++++++++++++++++- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 2e6f1db34..6ae339bf2 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -46,6 +46,9 @@ if ( 'user=s' => \$::USER, 'password=s' => \$::PASSWORD, 'auth=s' => \$::AUTH, + 'vlan=s' => \$::VLAN, + 'port=s' => \$::PORT, + 'mode=s' => \$::MODE, 'all' => \$::ALL, ) ) @@ -93,6 +96,16 @@ my $user; my $cmd; my $rc; my $master; +my $vlan; +my $port; +my $mode; + +#set community string for switch +my $community = "public"; +my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); +my $tmp = $snmpcs[0]; +if (defined($tmp)) { $community = $tmp } + if (($::IP) || ($::ALL)) { config_ip(); @@ -111,6 +124,9 @@ if (($::CONFIG) || ($::ALL)) { run_rspconfig(); } +if ($::VLAN) { + config_vlan(); +} sub config_ip { my @config_switches; @@ -125,7 +141,6 @@ sub config_ip { @nets = $nettab->getAllAttribs('net','mask'); } foreach my $switch (@nodes) { - print "change $switch to static ip address\n"; my $dip= $nodehash->{$switch}->[0]->{otherinterfaces}; if (!$dip) { print "Add otherinterfaces attribute for discover ip: chdef $switch otherinterfaces=x.x.x.x\n"; @@ -150,6 +165,7 @@ sub config_ip { #get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); + # if hostnames are same, created different one for discovery name if ($dswitch eq $switch) { $dswitch=""; @@ -161,6 +177,7 @@ sub config_ip { $ip_str =~ s/\./\-/g; $dswitch = "switch-$ip_str"; } + $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin nodetype=switch"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts $dswitch"; @@ -193,6 +210,8 @@ sub config_ip { my $csw = join(",",@config_switches); $cmd = "chdef $csw status=ip_configed otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); + $cmd = "makehosts $csw"; + $rc= xCAT::Utils->runcmd($cmd, 0); } if (@discover_switches) { @@ -212,7 +231,6 @@ sub config_hostname { foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; @@ -244,7 +262,6 @@ sub config_snmp { foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; @@ -288,7 +305,6 @@ sub run_rspconfig { my $switchtab = xCAT::Table->new('switches'); my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername']); $master = `hostname -i`; - print "master=$master\n"; foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; #call rspconfig command to setup switch @@ -317,6 +333,71 @@ sub run_rspconfig { } +sub config_vlan { + # checking for port number, switches is checked earlier + if ($::PORT) { + $port = $::PORT; + } else { + xCAT::MsgUtils->message("E","Error - When setting vlan, a port must be provided."); + &usage; + exit(1); + } + + #will default to trunk mode + if ($::MODE) { + $mode = $::MODE; + if (!($mode =~ m/(access|trunk|hybrid|access-dcb|dot1q-tunnel)/) ) + { + xCAT::MsgUtils->message("E","Error - Please provided supported mode"); + &usage; + exit(1); + } + } else { + $mode = "access"; + } + + $vlan = $::VLAN; + + foreach my $switch (@nodes) { + my $devicetype; + + # check if it is ethernet switch or ib switch + my $ccmd = "snmpwalk -Os -v1 -c $community $switch 1.3.6.1.2.1.1.1"; + my $result = xCAT::Utils->runcmd($ccmd, 0); + + # only supports MSX1410 and MSX1400 for Mellanox Ethernet switch now + if ( $result =~ /MSX14/ ) { + $devicetype = "EthSwitch::Mellanox"; + }else { + xCAT::MsgUtils->message("E","Config IB switch vlan is not support yet"); + $devicetype = "IBSwitch::Mellanox"; + next; + } + + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; + my $cmd; + + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "vlan $vlan\;"; + $cmd = $cmd . "exit\;"; + $cmd = $cmd . "interface ethernet 1/$port\;"; + $cmd = $cmd . "switchport mode $mode\;"; + if ($mode =~ /access/) { + $cmd = $cmd . "switchport access vlan $vlan\;"; + } else { + $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + } + $cmd = $cmd . "exit\;exit\;exit\;"; + + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; + + `$final_cmd` + } +} + + #--------------------------------------------------------- =head3 usage @@ -339,6 +420,17 @@ sub usage To run rspconfig command: configMellanox --switches switchnames --config + + To set Vlan for interface commmand (only for Mellanox Ethernet switch) : + configMellanox --switches switchnames --port port --vlan vlan --mode mode + + The following mode are supported for switchport: + * access Only untagged ingress Ethernet packets are allowed + * trunk Only tagged ingress Ethernet packets are allowed + * hybrid Both tagged and untagged ingress Ethernet packets are allowed + * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + \n"; } From 4434d4a6ffa4dffefaaf037d9ec5ade95bb4b049 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 8 May 2017 02:56:31 -0400 Subject: [PATCH 009/201] Fix issue 2350: Wcons IPMI not working due to xcat code --- xCAT-server/share/xcat/cons/ipmi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index fd4546c3c..631e7200a 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -125,7 +125,9 @@ if (grep /IPMI Version : 1.5/, @mcinfo) { $solcom = "isol"; $iface = "lan"; } elsif (grep /Manufacturer ID : 343/, @mcinfo && ! grep /Product ID : 117/,@mcinfo) { - $isintel = 1; + if (! grep /Product ID\s*:\s*64/,@mcinfo) { + $isintel = 1; + } } my $inteloption = ""; if ($isintel) { From 494cf232f46d00b6621b6c5d2f24e2efd417b300 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 May 2017 10:19:58 -0400 Subject: [PATCH 010/201] Support newer PDU firmware Newer PDU firmware renumbered OIDs. Detect and adapt to new OIDs on the newer firmware. --- xCAT-server/lib/xcat/plugins/pdu.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 9d54d92fc..895d56184 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -271,8 +271,6 @@ sub powerpduoutlet { my $value; my $statstr; - my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; - my $type = "INTEGER"; my $tmpnodestr = join(",", @$noderange); my $nodetab = xCAT::Table->new('pduoutlet'); @@ -341,6 +339,9 @@ sub outletpower { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $type = "INTEGER"; + if ($session->newmib) { + $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; + } my $varbind = new SNMP::Varbind([ $oid, $outlet, $value, $type ]); return $session->set($varbind); @@ -392,6 +393,9 @@ sub outletstat { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $output; my $statstr; + if ($session->newmib) { + $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; + } $output = $session->get("$oid.$outlet"); if ($output eq 1) { @@ -431,6 +435,15 @@ sub connectTopdu { unless ($session) { return; } + $session->newmib = 0; + my $pduversion = $session->get(".1.3.6.1.4.1.2.6.223.7.3.0"); + if ($pduversion =~ /(\d+)\.(\d+)_(\d+)/) { + if ($1 >= 1 and $2 >= 3 and $3 >= 3) { + $session->newmib = 1; + } + } + + return $session; } From 27613cdc18f7e9eafd0f09cac74828845f586408 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 May 2017 10:25:07 -0400 Subject: [PATCH 011/201] Fix syntax of newmib It has to be referenced as a hash element. --- xCAT-server/lib/xcat/plugins/pdu.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 895d56184..17e66f50c 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -339,7 +339,7 @@ sub outletpower { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $type = "INTEGER"; - if ($session->newmib) { + if ($session->{newmib}) { $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; } @@ -393,7 +393,7 @@ sub outletstat { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $output; my $statstr; - if ($session->newmib) { + if ($session->{newmib}) { $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; } @@ -435,11 +435,11 @@ sub connectTopdu { unless ($session) { return; } - $session->newmib = 0; + $session->{newmib} = 0; my $pduversion = $session->get(".1.3.6.1.4.1.2.6.223.7.3.0"); if ($pduversion =~ /(\d+)\.(\d+)_(\d+)/) { if ($1 >= 1 and $2 >= 3 and $3 >= 3) { - $session->newmib = 1; + $session->{newmib} = 1; } } From e9b8a3bbbf96b068ec7add801c747487dc1e3169 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 10 May 2017 13:48:18 -0400 Subject: [PATCH 012/201] modification for configMellanox scripts --- xCAT-server/lib/perl/xCAT/MellanoxIB.pm | 11 ++ .../lib/xcat/plugins/switchdiscover.pm | 2 +- xCAT-server/share/xcat/scripts/configMellanox | 101 ++++++++++-------- 3 files changed, 68 insertions(+), 46 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm index dbfec4b69..c26f18c9f 100644 --- a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm +++ b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm @@ -568,11 +568,13 @@ sub setSSHcfg { my $enable_cmd = "enable\r"; my $config_cmd = "configure terminal\r"; my $exit_cmd = "exit\r"; + my $init_cmd = "no\r"; my $pwd_prompt = "Password: "; my $sw_prompt = "^.*\] > "; my $enable_prompt = "^.*\] \#"; my $config_prompt = "^.*\\\(config\\\) \#"; + my $init_prompt = "Do you want to use the wizard for initial configuration?"; my $debug = 0; @@ -664,6 +666,15 @@ sub setSSHcfg { $mysw->exp_continue(); } ], + [ + "-re", $init_prompt, + sub { + #print "$node: sending command: $init_cmd\n"; + $mysw->clear_accum(); + $mysw->send($init_cmd); + $mysw->exp_continue(); + } + ], [ "-re", $sw_prompt, sub { diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ebc6cb61b..12b3dc03c 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -37,7 +37,7 @@ my %global_mac_identity = ( "a8:97:dc" => "BNT G8052 switch", "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", - "7c:fe:90" => "Mellanox IB switch", + "7c:fe:90" => "Mellanox switch", "8c:ea:1b" => "Edgecore Networks Switch" ); diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 6ae339bf2..397ac58e8 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -43,9 +43,6 @@ if ( 'ip' => \$::IP, 'name' => \$::NAME, 'snmp' => \$::SNMP, - 'user=s' => \$::USER, - 'password=s' => \$::PASSWORD, - 'auth=s' => \$::AUTH, 'vlan=s' => \$::VLAN, 'port=s' => \$::PORT, 'mode=s' => \$::MODE, @@ -115,8 +112,7 @@ if (($::NAME) || ($::ALL)) { config_hostname(); } -if (($::SNMP) || ($::ALL)) -{ +if (($::SNMP) || ($::ALL)) { config_snmp(); } @@ -165,7 +161,6 @@ sub config_ip { #get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); - # if hostnames are same, created different one for discovery name if ($dswitch eq $switch) { $dswitch=""; @@ -177,17 +172,29 @@ sub config_ip { $ip_str =~ s/\./\-/g; $dswitch = "switch-$ip_str"; } - - $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin nodetype=switch"; + $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin password=admin mgt=switch nodetype=switch"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts $dswitch"; $rc= xCAT::Utils->runcmd($cmd, 0); + $cmd = "makedns $dswitch"; + $rc= xCAT::Utils->runcmd($cmd, 0); + + $cmd="rspconfig $dswitch sshcfg=enable"; + $rc= xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message("E"," Failed to config ssh passwordless for $dip"); + print "Failed to config ssh passwordless for $dswitch, $dip\n"; + push (@discover_switches, $dswitch); + next; + } # verify if xdsh works $cmd = "xdsh $dswitch -l admin --devicetype IBSwitch::Mellanox 'enable;configure terminal;exit' "; $rc= xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E","Couldn't communicate with $dswitch, $dip"); + xCAT::MsgUtils->message("E","Couldn't communicate with $dip"); + print "$cmd failed, Couldn't communicate with $dswitch, $dip\n"; + push (@discover_switches, $dswitch); next; } #get netmask @@ -203,6 +210,7 @@ sub config_ip { push (@discover_switches, $dswitch); push (@config_switches, $switch); + print "changed $switch ip address to static ip $static_ip\n"; } if (@config_switches) { @@ -217,6 +225,8 @@ sub config_ip { if (@discover_switches) { my $dsw = join(",",@discover_switches); #remove discover switch from xCATdb and /etc/hosts + $cmd = "makedns -d $dsw"; + $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts -d $dsw"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "rmdef $dsw"; @@ -231,6 +241,7 @@ sub config_hostname { foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { + print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; @@ -241,7 +252,8 @@ sub config_hostname { xCAT::MsgUtils->message("E","Failed to setup hostname for $switch"); next; } - push (@config_switches, $switch); + push (@config_switches, $switch); + print "switch host name changed to $switch\n"; } if (@config_switches) { #update switch status @@ -258,45 +270,42 @@ sub config_snmp { my $snmp_auth; my $switchtab = xCAT::Table->new('switches'); - my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','username','password','auth']); + my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','username','password','auth','privacy']); foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { + print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; } - if ($::USER) { - $snmp_user = $::USER; - } elsif ($switchhash->{$switch}->[0]->{username}) { - $snmp_user = $switchhash->{$switch}->[0]->{username}; - } else { - $snmp_user = "xcatadmin\r"; + $snmp_user = $switchhash->{$switch}->[0]->{username}; + if (!$snmp_user) { + print "no snmp user is defined for this switch $switch, not going to set up snmpv3\n"; + next; } - if ($::PASSWORD) { - $snmp_passwd = $::PASSWORD; - } elsif ($switchhash->{$switch}->[0]->{password}) { - $snmp_passwd = $switchhash->{$switch}->[0]->{password}; + $snmp_passwd = $switchhash->{$switch}->[0]->{password}; + $snmp_auth = $switchhash->{$switch}->[0]->{auth}; + my $snmp_privacy = $switchhash->{$switch}->[0]->{privacy}; + + my $cmd_prefix = "xdsh $switch -l $user --devicetype IBSwitch::Mellanox"; + my $cmd; + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "snmp-server user $snmp_user v3 enable\;"; + if ($snmp_privacy) { + $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd priv $snmp_privacy $snmp_passwd\;"; } else { - # Need a special character - $snmp_passwd = "passw0rd\r"; - } - if ($::AUTH) { - $snmp_auth = $::AUTH; - } elsif ($switchhash->{$switch}->[0]->{auth}) { - $snmp_auth = $switchhash->{$switch}->[0]->{auth}; - } else { - $snmp_auth = "sha\r"; + $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd\; no snmp-server user $snmp_user v3 require-privacy\;"; } - $cmd = "xdsh $switch -l $user --devicetype IBSwitch::Mellanox 'enable;configure terminal;snmp-server user $snmp_user v3 enable;snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd;no snmp-server user $snmp_user v3 require-privacy;configuration write;exit' "; - $rc= xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E","Failed to set snmpv3 for $switch"); - } else { - $cmd = "chdef $switch status=snmp_configed snmpversion=3 snmpauth=$snmp_auth snmpusername=$snmp_user snmppassword=$snmp_passwd"; - $rc= xCAT::Utils->runcmd($cmd, 0); - } + print "snmpv3 configured for switch $switch\n"; + + $cmd = $cmd . "configuration write\;exit\;"; + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; + + `$final_cmd` } } @@ -342,7 +351,7 @@ sub config_vlan { &usage; exit(1); } - + #will default to trunk mode if ($::MODE) { $mode = $::MODE; @@ -373,10 +382,12 @@ sub config_vlan { $devicetype = "IBSwitch::Mellanox"; next; } - + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; my $cmd; + print "Tagging VLAN=$vlan for $switch port $port\n"; + # Build up the commands for easier readability $cmd = $cmd . "enable\;"; $cmd = $cmd . "configure terminal\;"; @@ -390,10 +401,10 @@ sub config_vlan { $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; } $cmd = $cmd . "exit\;exit\;exit\;"; - my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; `$final_cmd` + } } @@ -413,7 +424,7 @@ sub usage configMellanox -h│--help configMellanox --switches switchnames --ip configMellanox --switches switchnames --name - configMellanox --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--auth snmp_auth] + configMellanox --switches switchnames --snmp To set the ip address, hostname, config snmp and run rspconfig command: configMellanox --switches switchnames --all @@ -422,14 +433,14 @@ sub usage configMellanox --switches switchnames --config To set Vlan for interface commmand (only for Mellanox Ethernet switch) : - configMellanox --switches switchnames --port port --vlan vlan --mode mode + configMellanox --switches switchnames --port port --vlan vlan --mode mode - The following mode are supported for switchport: + The following mode are supported for switchport: * access Only untagged ingress Ethernet packets are allowed * trunk Only tagged ingress Ethernet packets are allowed * hybrid Both tagged and untagged ingress Ethernet packets are allowed * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged - * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header \n"; } From 83f5ea9321abd5649c1fe386f18a430205d64c5b Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 11 May 2017 23:12:15 -0400 Subject: [PATCH 013/201] Get username and password from passwd table for openbmc discover --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 27 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 439203163..4f6bce095 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -41,6 +41,8 @@ if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { my $parent_fd; my $bmc_user; my $bmc_pass; +my $openbmc_user; +my $openbmc_pass; #------------------------------------------------------- @@ -211,10 +213,11 @@ sub bmcdiscovery_processargs { # Get the default bmc account from passwd table, # this is only done for the discovery process ############################################ - ($bmc_user, $bmc_pass) = bmcaccount_from_passwd(); + ($bmc_user, $bmc_pass, $openbmc_user, $openbmc_pass) = bmcaccount_from_passwd(); # overwrite the default user and password if one is provided if ($::opt_U) { $bmc_user = $::opt_U; + $openbmc_user = $::opt_U; } elsif ($::opt_P) { # If password is provided, but no user, set the user to blank # Support older FSP and Tuletta machines @@ -222,6 +225,7 @@ sub bmcdiscovery_processargs { } if ($::opt_P) { $bmc_pass = $::opt_P; + $openbmc_pass = $::opt_P; } ######################################### @@ -868,12 +872,16 @@ sub bmcdiscovery { sub bmcaccount_from_passwd { my $bmcusername = "ADMIN"; my $bmcpassword = "admin"; + my $openbmcusername = "root"; + my $openbmcpassword = "0penBmc"; my $passwdtab = xCAT::Table->new("passwd", -create => 0); if ($passwdtab) { my $bmcentry = $passwdtab->getAttribs({ 'key' => 'ipmi' }, 'username', 'password'); if (defined($bmcentry)) { $bmcusername = $bmcentry->{'username'}; $bmcpassword = $bmcentry->{'password'}; + + # if username or password is undef or empty in passwd table, bmcusername or bmcpassword is empty unless ($bmcusername) { $bmcusername = ''; } @@ -881,8 +889,21 @@ sub bmcaccount_from_passwd { $bmcpassword = ''; } } + + my $openbmcentry = $passwdtab->getAttribs({ 'key' => 'openbmc' }, 'username', 'password'); + if (defined($openbmcentry)) { + $openbmcusername = $openbmcentry->{'username'}; + $openbmcpassword = $openbmcentry->{'password'}; + # if username or password is undef or empty in passwd table, openbmcusername or openbmcpassword is empty + unless ($openbmcusername) { + $openbmcusername = ''; + } + unless ($openbmcpassword) { + $openbmcpassword = ''; + } + } } - return ($bmcusername, $bmcpassword); + return ($bmcusername, $bmcpassword, $openbmcusername, $openbmcpassword); } #---------------------------------------------------------------------------- @@ -1020,7 +1041,7 @@ sub bmcdiscovery_openbmc{ my $node_data = $ip; my $cjar_file = "/tmp/cjar_$ip"; - my $data = '{"data": [ "' . $bmc_user .'", "' . $bmc_pass . '" ] }'; + my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; my $output = `curl -c $cjar_file -k -X POST -H \"Content-Type: application/json\" -d '$data' https://$ip/login`; From e07b607b44051957cfc503c5a4adac179c60ef48 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 12 May 2017 06:33:37 -0400 Subject: [PATCH 014/201] Fix issue 2577: chdef -m should return correct warning message when some attributes is not permit to be changed. --- .../references/man5/postscripts.5.rst | 4 +- .../admin-guides/references/man7/node.7.rst | 4 +- perl-xCAT/xCAT/DBobjUtils.pm | 24 +++++++- perl-xCAT/xCAT/Schema.pm | 4 +- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 57 ++++++++++++------- 5 files changed, 65 insertions(+), 28 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst index a87cd902c..7e0615d2d 100644 --- a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst +++ b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst @@ -44,13 +44,13 @@ postscripts Attributes: \ **postscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command \ **postbootscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 77646859a..cb1f1b529 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -807,13 +807,13 @@ node Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 0bc7e2286..3d463a475 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -675,6 +675,7 @@ sub setobjdefs # update the tables a row at a time foreach my $objname (keys %objhash) { + my $obj_need_update = 0; # get attr=val that are set in the DB ?? my $type = $objhash{$objname}{objtype}; @@ -1023,6 +1024,7 @@ sub setobjdefs $rsp->{data}->[0] = "access_tabentry \'$this_attr->{access_tabentry}\' is not valid."; xCAT::MsgUtils->message("E", $rsp, $::callback); + $objhash{$objname}{error} = 1; next; } $lookup_table = $tabentry{'lookup_table'}; @@ -1075,19 +1077,26 @@ sub setobjdefs split(/$delim/, $DBattrvals{$objname}{$attr_name}); my @minusList = split(/$delim/, $objhash{$objname}{$attr_name}); + my $operation_failed = 0; foreach my $em (@minusList) { if (!(grep { $_ eq $em } @currentList)) { if (($::opt_t eq 'group') && ($DBattrvals{$objname}{'grouptype'} ne 'dynamic')) { my $rsp; $rsp->{data}->[0] = "$objname is not a member of \'$em\'."; - xCAT::MsgUtils->message("W", $rsp, $::callback); + xCAT::MsgUtils->message("E", $rsp, $::callback); + $operation_failed = 1; } else { my $rsp; $rsp->{data}->[0] = "$em is not in the attribute of \'$attr_name\' for the \'$objname\' definition."; - xCAT::MsgUtils->message("W", $rsp, $::callback); + xCAT::MsgUtils->message("E", $rsp, $::callback); + $operation_failed = 1; } } } + if ($operation_failed) { + $objhash{$objname}{error} = 1; + next; + } # make a new list without the one specified my $first = 1; @@ -1106,6 +1115,12 @@ sub setobjdefs } $val = $newlist; } + else { + my $rsp; + $rsp->{data}->[0] = "No value got for attribute \'$attr_name\' for the \'$objname\' definition."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + next; + } } else { @@ -1118,10 +1133,13 @@ sub setobjdefs # the key is 'tabattrs' $allupdates{$lookup_table}{$objname}{$attr_name}{'tabattrs'}{$::tabattr} = $val; $setattrs = 1; - + $obj_need_update = 1; push(@setattrlist, $attr_name); } # end - foreach attribute + if ($obj_need_update) { + $objhash{$objname}{updated} = 1; + } my $rsp; foreach my $att (keys %$invalidattr) { diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index bf4816595..3821acee6 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -893,8 +893,8 @@ passed as argument rather than by table value', table_desc => 'The scripts that should be run on each node after installation or diskless boot.', descriptions => { node => 'The node name or group name.', - postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute.', - postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list.', + postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command', + postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 973f1d4c0..3a2d4d7bd 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1999,6 +1999,18 @@ sub defmk } else { + my $nodenum = 0; + my $ret = 0; + my @nodes_updated = (); + foreach my $node (keys %::FINALATTRS) { + if ($::FINALATTRS{$node}{updated}) { + $nodenum++; + push @nodes_updated, $node; + } + if ($::FINALATTRS{$node}{error}) { + $ret = 1; + } + } if ($::verbose) { @@ -2007,7 +2019,7 @@ sub defmk xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; - foreach my $o (sort(keys %::FINALATTRS)) + foreach my $o (sort( @nodes_updated)) { $rsp->{data}->[$n] = "$o"; $n++; @@ -2023,21 +2035,17 @@ sub defmk xCAT::MsgUtils->message("E", $rsp, $::callback); } } - else - { - my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); - $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; - if ($nodenum > 0) { - # Some objects were created, report as success - xCAT::MsgUtils->message("I", $rsp, $::callback); - } - else { - # No objects were created, report as error - xCAT::MsgUtils->message("E", $rsp, $::callback); - } + my $rsp; + $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; + if ($nodenum > 0) { + # Some objects were created, report as success + xCAT::MsgUtils->message("I", $rsp, $::callback); } - return 0; + else { + # No objects were created, report as error + xCAT::MsgUtils->message("E", $rsp, $::callback); + } + return $ret; } } @@ -2786,18 +2794,29 @@ sub defch } else { + my $nodenum = 0; + my $ret = 0; + my @nodes_updated = (); + foreach my $node (keys %::FINALATTRS) { + if ($::FINALATTRS{$node}{updated}) { + $nodenum++; + push @nodes_updated, $node; + } + if ($::FINALATTRS{$node}{error}) { + $ret = 1; + } + } if ($::verbose) { # give results my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); if ($nodenum) { $rsp->{data}->[0] = "The database was updated for the following objects:"; xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; - foreach my $o (sort(keys %::FINALATTRS)) + foreach my $o (sort(@nodes_updated)) { $rsp->{data}->[$n] = "$o\n"; $n++; @@ -2810,7 +2829,7 @@ sub defch else { my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); + if ($nodenum) { $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; } else { @@ -2842,7 +2861,7 @@ sub defch } } } - return 0; + return $ret; } } From d4383de06daef49f719fc9c7336a0daa309fcf42 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 12 May 2017 09:54:14 -0400 Subject: [PATCH 015/201] modified from reviews --- xCAT-server/lib/perl/xCAT/MellanoxIB.pm | 1 - xCAT-server/share/xcat/scripts/configMellanox | 30 +++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm index c26f18c9f..3d9b395a6 100644 --- a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm +++ b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm @@ -669,7 +669,6 @@ sub setSSHcfg { [ "-re", $init_prompt, sub { - #print "$node: sending command: $init_cmd\n"; $mysw->clear_accum(); $mysw->send($init_cmd); $mysw->exp_continue(); diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 397ac58e8..8538eb5b9 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -210,7 +210,7 @@ sub config_ip { push (@discover_switches, $dswitch); push (@config_switches, $switch); - print "changed $switch ip address to static ip $static_ip\n"; + print "$switch: Changing IP address to static IP $static_ip\n"; } if (@config_switches) { @@ -253,7 +253,7 @@ sub config_hostname { next; } push (@config_switches, $switch); - print "switch host name changed to $switch\n"; + print "$switch: Changing host name to $switch\n"; } if (@config_switches) { #update switch status @@ -274,14 +274,12 @@ sub config_snmp { foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; - $cmd = "chdef $switch username=admin"; - $rc= xCAT::Utils->runcmd($cmd, 0); + print "switch ssh username is not defined, use default one\n"; $user="admin"; } $snmp_user = $switchhash->{$switch}->[0]->{username}; if (!$snmp_user) { - print "no snmp user is defined for this switch $switch, not going to set up snmpv3\n"; + print "No snmp user defined for switch $switch. Will not configure snmpv3\n"; next; } $snmp_passwd = $switchhash->{$switch}->[0]->{password}; @@ -300,7 +298,7 @@ sub config_snmp { $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd\; no snmp-server user $snmp_user v3 require-privacy\;"; } - print "snmpv3 configured for switch $switch\n"; + print "$switch: snmpv3 configured\n"; $cmd = $cmd . "configuration write\;exit\;"; my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; @@ -347,7 +345,7 @@ sub config_vlan { if ($::PORT) { $port = $::PORT; } else { - xCAT::MsgUtils->message("E","Error - When setting vlan, a port must be provided."); + xCAT::MsgUtils->message("E","Error - When configuring VLAN, a port must be provided."); &usage; exit(1); } @@ -378,7 +376,7 @@ sub config_vlan { if ( $result =~ /MSX14/ ) { $devicetype = "EthSwitch::Mellanox"; }else { - xCAT::MsgUtils->message("E","Config IB switch vlan is not support yet"); + xCAT::MsgUtils->message("E","Config IB switch VLAN is not support yet"); $devicetype = "IBSwitch::Mellanox"; next; } @@ -432,15 +430,15 @@ sub usage To run rspconfig command: configMellanox --switches switchnames --config - To set Vlan for interface commmand (only for Mellanox Ethernet switch) : + To configure VLAN on a specified port (Mellanox Ethernet switch ONLY): configMellanox --switches switchnames --port port --vlan vlan --mode mode - The following mode are supported for switchport: - * access Only untagged ingress Ethernet packets are allowed - * trunk Only tagged ingress Ethernet packets are allowed - * hybrid Both tagged and untagged ingress Ethernet packets are allowed - * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged - * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + The following mode are supported for switchport: + * access Only untagged ingress Ethernet packets are allowed + * trunk Only tagged ingress Ethernet packets are allowed + * hybrid Both tagged and untagged ingress Ethernet packets are allowed + * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header \n"; } From 27dcfbbd7a0e8a5285aa881a59c2cd6152e9a548 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 12 May 2017 21:40:11 -0400 Subject: [PATCH 016/201] enhance descript of postscripts.postscripts and postscripts.postbootscripts --- .../guides/admin-guides/references/man5/postscripts.5.rst | 4 ++-- docs/source/guides/admin-guides/references/man7/group.7.rst | 4 ++-- docs/source/guides/admin-guides/references/man7/node.7.rst | 4 ++-- perl-xCAT/xCAT/Schema.pm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst index 7e0615d2d..6bac116b9 100644 --- a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst +++ b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst @@ -44,13 +44,13 @@ postscripts Attributes: \ **postscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command \ **postbootscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 8aea1128b..9a67dd224 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -801,13 +801,13 @@ group Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index cb1f1b529..0ab71ac4d 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -807,13 +807,13 @@ node Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 3821acee6..50241e8e5 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -893,8 +893,8 @@ passed as argument rather than by table value', table_desc => 'The scripts that should be run on each node after installation or diskless boot.', descriptions => { node => 'The node name or group name.', - postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command', - postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', + postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command', + postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, From cc198bef122e7b39ba0cffe0a4862e2e4edb0a21 Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Mon, 15 May 2017 15:26:58 -0400 Subject: [PATCH 017/201] Enable switches to run findme for autodiscovery (#2662) --- xCAT-server/lib/xcat/plugins/switch.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index ba3d1281f..61dbce696 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -293,15 +293,19 @@ sub process_request { #discovery working. Food for thought. return; } + my $discoverswitch = 0; + if (defined $req->{nodetype} and $req->{nodetype}->[0] eq 'switch') { + $discoverswitch = 1; + } my $firstpass = 1; if ($mac) { - $node = $macmap->find_mac($mac, $req->{cacheonly}->[0]); + $node = $macmap->find_mac($mac, $req->{cacheonly}->[0], $discoverswitch); $firstpass = 0; } if (not $node) { # and $req->{checkallmacs}->[0]) { foreach (@{ $req->{mac} }) { /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; - $node = $macmap->find_mac($1, $firstpass); + $node = $macmap->find_mac($1, $firstpass, $discoverswitch); $firstpass = 0; if ($node) { last; } } From e2b25f57a3445ba197c97d68fc0a0fbca4dac373 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 16 May 2017 04:42:06 -0400 Subject: [PATCH 018/201] Modify output for rpower state when return Quiesced --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 17657824d..4f0663d41 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -830,6 +830,8 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { xCAT::SvrUtils::sendmsg("off", $callback, $node); + } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { + xCAT::SvrUtils::sendmsg("quiesced", $callback, $node); } else { xCAT::SvrUtils::sendmsg("on", $callback, $node); } From 2e017e2c105c6f0a71eab8832137d31bf827b4a8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 May 2017 15:56:49 -0400 Subject: [PATCH 019/201] OpenBMC rinv sorted output --- xCAT-server/lib/xcat/plugins/openbmc.pm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 4f0663d41..6014eb72b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -876,6 +876,7 @@ sub rinv_response { my $grep_string = $status_info{RINV_RESPONSE}{argv}; my $src; my $content_info; + my @sorted_output; foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; @@ -893,19 +894,23 @@ sub rinv_response { } if (($grep_string eq "vpd" or $grep_string eq "mprom")) { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if (($grep_string eq "vpd" or $grep_string eq "deviceid")) { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if ($grep_string eq "uuid") { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if ($grep_string eq "guid") { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) { @@ -923,10 +928,16 @@ sub rinv_response { foreach my $key (keys %content) { $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); + push (@sorted_output, $node . ": ". $content_info); #Save output in array } } } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + @sorted_output = sort @sorted_output; #Sort all output + my $result = join "\n", @sorted_output; #Join into a single string for easier display + xCAT::SvrUtils::sendmsg("$result", $callback); + } if ($next_status{ $node_info{$node}{cur_status} }) { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; From d30d0156e7ef5d65cfb2db653cc55221a361ed62 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 May 2017 16:07:44 -0400 Subject: [PATCH 020/201] rinv man page fix --- docs/source/guides/admin-guides/references/man1/rinv.1.rst | 4 ++-- xCAT-client/pods/man1/rinv.1.pod | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 9d44f4377..df454d284 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -32,14 +32,14 @@ OpenPOWER (using ipmi) server specific: ======================================= -\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ] OpenPOWER (using openbmc) server specific: ========================================== -\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index e0799d15b..3a5c92f29 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -12,11 +12,11 @@ B I {B|B|B|B|B|B|B I {B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B] =head2 OpenPOWER (using openbmc) server specific: -B I {B|B|B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B|B|B] =head2 PPC (with HMC) specific: From 4dd1407d059abc2212de82afcc770a37fecc5cb9 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 17 May 2017 07:09:50 -0400 Subject: [PATCH 021/201] Migration test just need to run under flat environment or will two dns server:SN and MN for CN --- .../autotest/testcase/migration/redhat_migration | 12 ++++++------ xCAT-test/autotest/testcase/migration/sles_migration | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 27a489882..0cd7f859c 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -2,9 +2,9 @@ start:redhat_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -103,9 +103,9 @@ os:Linux description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file stop:yes -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index e287ec852..a03bfc0d3 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -2,9 +2,9 @@ start:sles_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -105,9 +105,9 @@ start:sles_migration2 os:Linux description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n From d4dd40c292ad8f3ea71e09b6580614c89d1f9fde Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 17 May 2017 08:19:23 -0400 Subject: [PATCH 022/201] add stop lable for Dev to debug --- xCAT-test/autotest/testcase/installation/SN_setup_case | 2 +- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../installation/reg_linux_diskfull_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- .../installation/reg_linux_diskless_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_statelite_installation_flat | 2 +- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 +- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 271427394..ee92b76c2 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -1,4 +1,4 @@ -start:SN_setup_case +start:SN_setup_case:stop:yes os:Linux cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index b5ef8f841..62c61bf97 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,4 +1,4 @@ -start:reg_linux_diskfull_installation_flat +start:reg_linux_diskfull_installation_flat:stop:yes os:Linux cmd:fdisk -l cmd:df -T 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 a3a04ba54..28d2392cd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,4 +1,4 @@ -start:reg_linux_diskfull_installation_hierarchy +start:reg_linux_diskfull_installation_hierarchy:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T 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 a6e90df47..12fdda8dd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,4 +1,4 @@ -start:reg_linux_diskless_installation_flat +start:reg_linux_diskless_installation_flat:stop:yes os:Linux cmd:fdisk -l cmd:df -T 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 5e16e29af..e689d60f8 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,4 +1,4 @@ -start:reg_linux_diskless_installation_hierarchy +start:reg_linux_diskless_installation_hierarchy:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 829460d05..f4937fdc9 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,4 +1,4 @@ -start:reg_linux_statelite_installation_flat +start:reg_linux_statelite_installation_flat:stop:yes os:Linux cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 7c8e83622..7a6f561c7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,4 +1,4 @@ -start:reg_linux_statelite_installation_hierarchy_by_nfs +start:reg_linux_statelite_installation_hierarchy_by_nfs:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index c2140c00d..3bc4f5e95 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,4 +1,4 @@ -start:reg_linux_statelite_installation_hierarchy_by_ramdisk +start:reg_linux_statelite_installation_hierarchy_by_ramdisk:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T From 3b78dff3a0142e9176b04eeb0b2d9d88404ee03c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 17 May 2017 08:26:37 -0400 Subject: [PATCH 023/201] add stop lable for Dev to debug --- xCAT-test/autotest/testcase/installation/SN_setup_case | 3 ++- .../testcase/installation/reg_linux_diskfull_installation_flat | 3 ++- .../installation/reg_linux_diskfull_installation_hierarchy | 3 ++- .../testcase/installation/reg_linux_diskless_installation_flat | 3 ++- .../installation/reg_linux_diskless_installation_hierarchy | 3 ++- .../installation/reg_linux_statelite_installation_flat | 3 ++- .../reg_linux_statelite_installation_hierarchy_by_nfs | 3 ++- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index ee92b76c2..330bdeaa2 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -1,5 +1,6 @@ -start:SN_setup_case:stop:yes +start:SN_setup_case os:Linux +stop:yes cmd:fdisk -l cmd:df -T cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__ diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 62c61bf97..cbe7a6991 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,5 +1,6 @@ -start:reg_linux_diskfull_installation_flat:stop:yes +start:reg_linux_diskfull_installation_flat os:Linux +stop:yes cmd:fdisk -l cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi 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 28d2392cd..eca702914 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,5 +1,6 @@ -start:reg_linux_diskfull_installation_hierarchy:stop:yes +start:reg_linux_diskfull_installation_hierarchy os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" 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 12fdda8dd..1541fae4b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,5 +1,6 @@ -start:reg_linux_diskless_installation_flat:stop:yes +start:reg_linux_diskless_installation_flat os:Linux +stop:yes cmd:fdisk -l cmd:df -T cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 e689d60f8..8ca853faa 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,5 +1,6 @@ -start:reg_linux_diskless_installation_hierarchy:stop:yes +start:reg_linux_diskless_installation_hierarchy os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index f4937fdc9..fa994e2c6 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,5 +1,6 @@ -start:reg_linux_statelite_installation_flat:stop:yes +start:reg_linux_statelite_installation_flat os:Linux +stop:yes cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 7a6f561c7..cfb83253f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,5 +1,6 @@ -start:reg_linux_statelite_installation_hierarchy_by_nfs:stop:yes +start:reg_linux_statelite_installation_hierarchy_by_nfs os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 3bc4f5e95..a15e412f1 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,5 +1,6 @@ -start:reg_linux_statelite_installation_hierarchy_by_ramdisk:stop:yes +start:reg_linux_statelite_installation_hierarchy_by_ramdisk os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" From e664018cc493b5453874aa6d7e637460f560cc99 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 17 May 2017 11:25:38 -0400 Subject: [PATCH 024/201] Changes after review comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6014eb72b..3ea0c7419 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -893,23 +893,23 @@ sub rinv_response { next if ($grep_string eq "serial"); } - if (($grep_string eq "vpd" or $grep_string eq "mprom")) { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); - last; + if (($grep_string eq "vpd" or $grep_string eq "mprom") and $key_url =~ /\/motherboard$/) { + xCAT::SvrUtils::sendmsg("No mprom information is available", $callback, $node); + next if ($grep_string eq "mprom"); } - if (($grep_string eq "vpd" or $grep_string eq "deviceid")) { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); - last; + if (($grep_string eq "vpd" or $grep_string eq "deviceid") and $key_url =~ /\/motherboard$/) { + xCAT::SvrUtils::sendmsg("No deviceid information is available", $callback, $node); + next if ($grep_string eq "deviceid"); } if ($grep_string eq "uuid") { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + xCAT::SvrUtils::sendmsg("No uuid information is available", $callback, $node); last; } if ($grep_string eq "guid") { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + xCAT::SvrUtils::sendmsg("No guid information is available", $callback, $node); last; } From 70cc3ac1c9616583f92ff643fe6ac1fae0532154 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 18 May 2017 02:18:04 +0800 Subject: [PATCH 025/201] Create a mailmap file to coalesce together commits by the same person. --- .mailmap | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..cc6d51051 --- /dev/null +++ b/.mailmap @@ -0,0 +1,69 @@ +BAI Yuan +Bruce Potter +CAO Li +CAO Meng Meng +CAO Meng Meng +CAO Meng Meng +Casandra Qiu +Casandra Qiu +CHENG Long +CHU De Gao +CHU De Gao +CHU De Gao +GAO Feng +GAO Ling +GAO Ling +GONG Jie +GONG Jie +GONG Jie +HU Wei Hua +Jarrod Johnson +Jarrod Johnson +Jarrod Johnson +Jarrod Johnson +JIN Jie Hua +JIN Jie Hua +LI Guang Cheng +LI Guang Cheng +LI Guang Cheng +LI Ting Ting +Linda O. Mellor +Linda O. Mellor +Lissa Valletta +Lissa Valletta +Mark Gurevich +Mark Gurevich +Norm Nott +Norm Nott +Patrick Lundgren +Patrick Lundgren +Patrick Lundgren +SUN Jing +SUN Jing +Victor Hu +Victor Hu +Victor Hu +WANG Hua Zhong +WANG Hua Zhong +WANG Jun Xia +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WU Xian +XU Bin +XU Bin +XU Qing +XU Qing +XU Wei +YANG Peng +YANG Song +YANG Song +YANG Song +YANG Song +YIN Le +YIN Le +ZHAO Er Tao +ZHAO Er Tao +ZHAO Er Tao From 7057ab5208b5b01da502a84095c0d43e1103e154 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 18 May 2017 01:41:33 -0400 Subject: [PATCH 026/201] Modify process of rinv firm/all depending on new url --- xCAT-server/lib/xcat/plugins/openbmc.pm | 49 +++++++++++++++++++++---- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 3ea0c7419..519a4a13c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -106,6 +106,14 @@ my %status_info = ( process => \&rinv_response, }, + RINV_FIRM_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RINV_FIRM_RESPONSE => { + process => \&rinv_response, + }, + RPOWER_ON_REQUEST => { method => "PUT", init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", @@ -322,7 +330,7 @@ sub process_request { push @donargs, [ $node,$bmcip,$node_info{$node}{username}, $node_info{$node}{password}]; } else { $login_url = "$http_protocol://$bmcip/login"; - $content = '{"data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; + $content = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; $handle_id = xCAT::OPENBMC->new($async, $login_url, $content); $handle_id_node{$handle_id} = $node; $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; @@ -496,9 +504,20 @@ sub parse_command_status { $subcommand = "all"; } - $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; - $next_status{RINV_REQUEST} = "RINV_RESPONSE"; - $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + if ($subcommand eq "firm") { + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } elsif ($subcommand eq "all") { + $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; + $next_status{RINV_REQUEST} = "RINV_RESPONSE"; + $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + $next_status{RINV_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } else { + $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; + $next_status{RINV_REQUEST} = "RINV_RESPONSE"; + $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + } } if ($command eq "rsetboot") { @@ -552,7 +571,7 @@ sub parse_command_status { if ($command eq "rspconfig") { my @options = (); foreach $subcommand (@ARGV) { - if ($subcommand =~ /^ip$|^netmask$|^gateway$/) { + if ($subcommand =~ /^ip$|^netmask$|^gateway$|^vlan$/) { $next_status{LOGIN_RESPONSE} = "RSPCONFIG_GET_REQUEST"; $next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE"; push @options, $subcommand; @@ -873,7 +892,13 @@ sub rinv_response { my $response_info = decode_json $response->content; - my $grep_string = $status_info{RINV_RESPONSE}{argv}; + my $grep_string; + if ($node_info{$node}{cur_status} eq "RINV_FIRM_RESPONSE") { + $grep_string = "firm"; + } else { + $grep_string = $status_info{RINV_RESPONSE}{argv}; + } + my $src; my $content_info; my @sorted_output; @@ -881,6 +906,14 @@ sub rinv_response { foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; + if ($grep_string eq "firm") { + if (defined($content{Version}) and $content{Version}) { + my $firm_ver = "System Firmware Product Version: " . "$content{Version}"; + xCAT::SvrUtils::sendmsg("$firm_ver", $callback, $node); + next; + } + } + if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); @@ -919,7 +952,7 @@ sub rinv_response { next; } - if ($grep_string eq "all" or $key_url =~ /\/$grep_string/ or ($grep_string eq "firm" and defined($content{Name}) and $content{Name} eq "OpenPOWER Firmware")) { + if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { $src = "$1 $2"; } else { @@ -1030,7 +1063,7 @@ sub reventlog_response { my $response_info = decode_json $response->content; - if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_REQUEST") { + if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { xCAT::SvrUtils::sendmsg("clear", $callback, $node); } From 80e5e965420edaa5480dd3a2c7f629248dba3a8d Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 18 May 2017 14:00:50 +0800 Subject: [PATCH 027/201] fix mtu support (#3083) --- xCAT-server/lib/xcat/plugins/networks.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 894d0518a..49f318854 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -372,8 +372,10 @@ sub donets # For Linux systems my @ip6table = split /\n/, `/sbin/ip -6 route`; my @rtable = split /\n/, `/bin/netstat -rn`; + my @mtable = split /\n/, `/bin/netstat -i`; splice @rtable, 0, 2; + splice @mtable, 0, 2; my %netgw = (); foreach my $rtent (@rtable) @@ -517,6 +519,15 @@ sub donets } } + # get mtu value + my $mtu; + my @rowm; + foreach (grep /\s*$mgtifname\b/, @mtable) + { + @rowm = split(/\s+/, $_); + $mtu = $rowm[1]; + } + if ($::DISPLAY) { push @{ $rsp->{data} }, "\n#From $host."; push @{ $rsp->{data} }, "$netname:"; @@ -528,9 +539,13 @@ sub donets push @{ $rsp->{data} }, " gateway=$gw"; } push @{ $rsp->{data} }, " mgtifname=$mgtifname"; + if ($mtu) + { + push @{ $rsp->{data} }, " mtu=$mtu"; + } } else { if (!$foundmatch) { - $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { 'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw }); + $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { 'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw, 'mtu' => $mtu }); } } From 317845a04cc28795688c716b549f8253f80ac67f Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 18 May 2017 01:23:29 -0500 Subject: [PATCH 028/201] merge 2.13.perfopt branch to master branch (#3044) * Add trace point for perf tool in xcatd (#903) This patch aims to enable nytprof library to analyze the performance of xcat code in statement level. - Add perf trace point in xcatd - Add sleep time for db prcess to solve the race condition when - perf instraction is used. More reference To enable prof: perl -dt:NYTProf /opt/xcat/sbin/xcatd -f Some perf test sample: https://github.com/chenglch/xcatperf * refine the performance of makedhcp (#2901), it including: - refine the code logic in getSNList to get better performance - refine the getipaddr, cache the dns lookup result - refine noderangecontainsMn - refine ishostinsubnet --- perl-xCAT/xCAT/MsgUtils.pm | 61 ++++++++ perl-xCAT/xCAT/NetworkUtils.pm | 217 ++++++++++++++++++++--------- perl-xCAT/xCAT/ServiceNodeUtils.pm | 33 ++++- perl-xCAT/xCAT/Utils.pm | 15 ++ xCAT-server/sbin/xcatd | 32 ++++- 5 files changed, 287 insertions(+), 71 deletions(-) diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index b2e6484be..577d97ec4 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -16,6 +16,7 @@ use xCAT::Utils; #use locale; use Socket; use File::Path; +use constant PERF_LOG => "/var/log/xcat/perf.log"; $::NOK = -1; $::OK = 0; @@ -823,5 +824,65 @@ sub trace() { } } +#------------------------------------------------------------------ + +=head3 _perf_log + Libary function to write the perf log. Do not use it directly. +=cut + +#----------------------------------------------------------------- +sub _perf_log +{ + my $type = shift; + my $msg = shift; + my $fh; + my $ret = open($fh, '>>', PERF_LOG); + if (!$ret) { + xCAT::MsgUtils->message("S", "Open perf log file error: $!"); + } + my $line = localtime()."\t$type\t$msg\n"; + print $fh $line; + close $fh; +} + +#------------------------------------------------------------------ + +=head3 perf_log_info + Trace information for perf + Argument: + $msg (trace message) +=cut + +#----------------------------------------------------------------- +sub perf_log_info +{ + shift; + my $msg = shift; + _perf_log('info', $msg); +} + +#------------------------------------------------------------------ + +=head3 perf_log_process + Trace process information for perf + Arguments: + $process_type (immediate, plugin, etc) + $req (xcat reqeust) + $msg (additional message, optional) +=cut + +#----------------------------------------------------------------- +sub perf_log_process +{ + shift; + my ($process_type, $req, $msg, $pid) = @_; + if (defined($req)) { + my $command = $req->{command}->[0]; + _perf_log($process_type, "$$\t$command\t$msg"); + } else { + _perf_log($process_type, "$pid\t$msg"); + } +} + 1; diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index a66576cf4..0c62fb7a0 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -19,8 +19,7 @@ use File::Path; use Math::BigInt; use Socket; use xCAT::GlobalDef; - -#use Data::Dumper; +use Sys::Hostname; use strict; use warnings "all"; my $socket6support = eval { require Socket6 }; @@ -229,6 +228,9 @@ sub gethostname() hostname Optional: GetNumber=>1 (return the address as a BigInt instead of readable string) + GetAllAddresses=>1 (return the ) + OnlyV6=>1 () + OnlyV4=> () Returns: ip address Globals: cache: %::hostiphash @@ -270,69 +272,117 @@ sub getipaddr # #pass in an ip and only want an ip?? # return $iporhost; #} + my $isip=0; + if ($iporhost and ($iporhost =~ /\d+\.\d+\.\d+\.\d+/) || ($iporhost =~ /:/)){ + $isip=1; + } + + +#print "============================\n"; +#print Dumper(\%::hostiphash); +#print "\n"; +#print Dumper(\%extraarguments); +#print "\n"; +#print "iporhost=$iporhost"; +#print "\n"; +#print "============================\n"; #cache, do not lookup DNS each time - if ($::hostiphash and defined($::hostiphash{$iporhost}) && $::hostiphash{$iporhost}) + if ( + ((not $extraarguments{OnlyV6}) and (not $extraarguments{GetAllAddresses})) and defined($::hostiphash{$iporhost}) and $::hostiphash{$iporhost}) { - return $::hostiphash{$iporhost}; + + if($extraarguments{GetNumber} ) { + if($::hostiphash{$iporhost}{Number}){ + #print "YYYYYYYYYY GetNumber Cache Hit!!!YYYYYYYYY\n"; + return $::hostiphash{$iporhost}{Number}; + } + } elsif($::hostiphash{$iporhost}{hostip}) { + #print "YYYYYYYYYY dns Cache Hit!!!YYYYYYYYY\n"; + return $::hostiphash{$iporhost}{hostip}; + } + } + + if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6 + { + my @returns; + my $reqfamily = AF_UNSPEC; + if ($extraarguments{OnlyV6}) { + $reqfamily = AF_INET6; + } elsif ($extraarguments{OnlyV4}) { + $reqfamily = AF_INET; + } + my @addrinfo; + if($isip) { + @addrinfo=Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6,Socket6::AI_NUMERICHOST()); + }else{ + @addrinfo=Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6); + } + my ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); + unless($reqfamily == AF_INET6){ + if($isip){ + if($name){ + $::hostiphash{$iporhost}{hostip}=$name; + } + }elsif($ip){ + $::hostiphash{$iporhost}{hostip}=$ip; + } + } + while ($ip) + { + if ($extraarguments{GetNumber}) { #return a BigInt for compare, e.g. for comparing ip addresses for determining if they are in a common network or range + my $ip = (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; + my $bignumber = Math::BigInt->new(0); + foreach (unpack("N*", Socket6::inet_pton($family, $ip))) { #if ipv4, loop will iterate once, for v6, will go 4 times + $bignumber->blsft(32); + $bignumber->badd($_); + } + push(@returns, $bignumber); + $::hostiphash{$iporhost}{Number}=$returns[0]; + } else { + push @returns, (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; + $::hostiphash{$iporhost}{hostip}=$returns[0]; + } + if (scalar @addrinfo and $extraarguments{GetAllAddresses}) { + ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); + } else { + $ip = 0; + } + } + unless ($extraarguments{GetAllAddresses}) { + return $returns[0]; + } + return @returns; } else { - if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6 - { - my @returns; - my $reqfamily = AF_UNSPEC; - if ($extraarguments{OnlyV6}) { - $reqfamily = AF_INET6; - } elsif ($extraarguments{OnlyV4}) { - $reqfamily = AF_INET; - } - my @addrinfo = Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6); - my ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); - while ($ip) - { - if ($extraarguments{GetNumber}) { #return a BigInt for compare, e.g. for comparing ip addresses for determining if they are in a common network or range - my $ip = (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; - my $bignumber = Math::BigInt->new(0); - foreach (unpack("N*", Socket6::inet_pton($family, $ip))) { #if ipv4, loop will iterate once, for v6, will go 4 times - $bignumber->blsft(32); - $bignumber->badd($_); - } - push(@returns, $bignumber); - } else { - push @returns, (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; - } - if (scalar @addrinfo and $extraarguments{GetAllAddresses}) { - ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); - } else { - $ip = 0; - } - } - unless ($extraarguments{GetAllAddresses}) { - return $returns[0]; - } - return @returns; - } - else - { - #return inet_ntoa(inet_aton($iporhost)) - #TODO, what if no scoket6 support, but passing in a IPv6 hostname? - if ($iporhost =~ /:/) { #ipv6 - return undef; + #return inet_ntoa(inet_aton($iporhost)) + #TODO, what if no scoket6 support, but passing in a IPv6 hostname? + if ($iporhost =~ /:/) { #ipv6 + return undef; - #die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support"; - } - my $packed_ip; - $iporhost and $packed_ip = inet_aton($iporhost); - if (!$packed_ip) - { - return undef; - } - if ($extraarguments{GetNumber}) { #only 32 bits, no for loop needed. - return Math::BigInt->new(unpack("N*", $packed_ip)); - } - return inet_ntoa($packed_ip); + #die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support"; } + my $packed_ip; + $iporhost and $packed_ip = inet_aton($iporhost); + if (!$packed_ip) + { + return undef; + } + + my $myip=inet_ntoa($packed_ip); + + unless($isip) { + $::hostiphash{$iporhost}{hostip}=$myip; + } + + if ($extraarguments{GetNumber}) { #only 32 bits, no for loop needed. + my $number=Math::BigInt->new(unpack("N*", $packed_ip)); + $::hostiphash{$iporhost}{Number}=$number; + return $number; + } + + return $myip; } } @@ -417,7 +467,7 @@ sub linklocaladdr { =cut #------------------------------------------------------------------------------- -sub ishostinsubnet { +sub ishostinsubnet{ my ($class, $ip, $mask, $subnet) = @_; #safe guard @@ -425,6 +475,40 @@ sub ishostinsubnet { { return 0; } + + my $maskType=0; + + #CIDR notation supported + if ($subnet && ($subnet =~ /\//)) { + ($subnet, $mask) = split /\//, $subnet, 2; + $subnet =~ s/\/.*$//; + $maskType=1; + }elsif ($mask) { + if ($mask =~ /\//) { + $mask =~ s/^\///; + $maskType=1; + } elsif($mask =~ /^0x/i ) { + $maskType=2; + } + } + + my $ret=xCAT::NetworkUtils::isInSameSubnet( $ip, $subnet, $mask, $maskType); + if(defined $ret and $ret==1){ + return 1; + }else{ + return 0; + } +} + +sub ishostinsubnet_orig { + my ($class, $ip, $mask, $subnet) = @_; + + #safe guard + if (!defined($ip) || !defined($mask) || !defined($subnet)) + { + return 0; + } + my $numbits = 32; if ($ip =~ /:/) { #ipv6 $numbits = 128; @@ -1314,7 +1398,7 @@ sub formatNetmask Returns: 1: they are in same subnet - 2: not in same subnet + undef: not in same subnet Globals: none @@ -1853,16 +1937,13 @@ sub get_subnet_aix sub determinehostname { my $hostname; - my $hostnamecmd = "/bin/hostname"; - my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); - if ($::RUNCMD_RC != 0) - { # could not get hostname - xCAT::MsgUtils->message("S", - "Error $::RUNCMD_RC from $hostnamecmd command\n"); - exit $::RUNCMD_RC; + eval { + $hostname = hostname; + }; + if($@){ + xCAT::MsgUtils->message("S","Fail to get hostname: $@\n"); + exit -1; } - $hostname = $thostname[0]; - #get all potentially valid abbreviations, and pick the one that is ok #by 'noderange' my @hostnamecandidates; diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index 5daf5c237..c27601874 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -14,7 +14,6 @@ if ($^O =~ /^aix/i) { } use lib "$::XCATROOT/lib/perl"; use strict; - #----------------------------------------------------------------------------- =head3 readSNInfo @@ -353,6 +352,37 @@ sub getSNandNodes #----------------------------------------------------------------------------- sub getSNList +{ + require xCAT::Table; + require xCAT::NodeRange; + my ($class, $service, $options) = @_; + my @servicenodes; + my $servicenodetab = xCAT::Table->new('servicenode'); + my $nodetab = xCAT::Table->new('nodelist'); + unless ($servicenodetab) # no servicenode table + { + xCAT::MsgUtils->message('I', "Unable to open servicenode table.\n"); + $servicenodetab->close; + return @servicenodes; + } + + + if($service){ + @servicenodes = $servicenodetab->getAllAttribsWhere(["$service==1"],'node'); + }else{ + @servicenodes = $servicenodetab->getAllAttribs(('node')); + } + + @servicenodes=xCAT::NodeRange::noderange(join(',',map {$_->{node}} @servicenodes)); + if($options eq "ALL"){ + return @servicenodes; + } + + @servicenodes = $nodetab->getAllAttribsWhere("node in ("."\'".join("\',\'", @servicenodes)."\'".") and groups not like '%__mgmtnode%'",'node'); + return map {$_->{node}} @servicenodes; +} + +sub getSNList_orig { require xCAT::Table; my ($class, $service, $options) = @_; @@ -367,6 +397,7 @@ sub getSNList } my @nodes = $servicenodetab->getAllNodeAttribs([$service]); $servicenodetab->close; + foreach my $node (@nodes) { if (!defined($service) || ($service eq "")) # want all the service nodes diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index a39ea8bb2..06b08ae68 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -3306,10 +3306,25 @@ sub isSELINUX =cut #------------------------------------------------------------------------------- + + sub noderangecontainsMn { my ($class, @noderange) = @_; + # check if any node in the noderange is the Management Node return the + # name + my @mnames; # management node names in the database, members of __mgmtnode + my $tab = xCAT::Table->new('nodelist'); + + my @nodelist = $tab->getAllAttribsWhere("node in ("."\'".join("\',\'", @noderange)."\'".") and groups like '%__mgmtnode%'",'node'); + return map {$_->{node}} @nodelist; # if no MN in the noderange, return nothing +} + +sub noderangecontainsMn_orig +{ + my ($class, @noderange) = @_; + # check if any node in the noderange is the Management Node return the # name my @mnames; # management node names in the database, members of __mgmtnode diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 2bc097027..8132fad96 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -221,6 +221,20 @@ my $cmdlog_alllog = "====================================================\n"; my $cmdlog_starttime=undef; # ----used for command log end--------- +my $enable_perf = $sitetab->getAttribs({'key'=>'enableperf'},'value'); +if($enable_perf) { + # Enabled by user, check whether nytperf library is enabled + if (!defined(&DB::disable_profile)) { + xCAT::MsgUtils->message("S", "Perf is enabled in sitetable, but can not load the library."); + $enable_perf = 0; + } else { + if ($enable_perf) { + xCAT::MsgUtils->perf_log_info("start profiling"); + DB::enable_profile(); + } + } +} + $sitetab->close; @@ -926,7 +940,9 @@ unless ($foreground) { } $dbmaster = xCAT::Table::init_dbworker; - +if ($enable_perf) { + xCAT::MsgUtils->perf_log_process( "db", undef, "dbprocess", $dbmaster ); +} # Make sure DB process is ready. wait_db_process(); my $CHILDPID = 0; # Global for reapers @@ -1026,7 +1042,9 @@ $SIG{TERM} = $SIG{INT} = sub { if ($cmdlog_svrpid) { kill 'INT', $cmdlog_svrpid; } - + if ($enable_perf) { +# DB::finish_profile(); + } # ----used for command log end--------- }; @@ -1525,6 +1543,10 @@ until ($quit) { if ($sslfudgefactor) { $sslfudgefactor -= 1; } $sslclients++; # THROTTLE $cnnection->close(); + if ($enable_perf) { + xCAT::MsgUtils->perf_log_info("stop profiling"); +# DB::disable_profile(); + } } if (open($mainpidfile, "<", "/var/run/xcat/mainservice.pid")) { my $pid = <$mainpidfile>; @@ -1949,6 +1971,9 @@ sub plugin_command { } } $$progname = $oldprogname; + if ($enable_perf) { + xCAT::MsgUtils->perf_log_process('plugin', $req, "modname:$modname"); + } $parent_fd = $org_parent_fd; if ($sock) { close($parent_fd); @@ -2689,6 +2714,9 @@ sub service_connection { $req = get_request($sock, $globalencode, $line); unless ($req) { last; } + if ($enable_perf) { + xCAT::MsgUtils->perf_log_process('immediate', $req); + } # ----used for command log start---------- $cmdlog_starttime = time(); my ($sec, $min, $hour, $mday, $mon, $year) = localtime($cmdlog_starttime); From dd91546a8497bd7ca351defd763591ef34d70ae6 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 18 May 2017 02:52:28 -0400 Subject: [PATCH 029/201] Modify release information for 2.13.4 --- docs/source/overview/xcat2_release.rst | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 18b27871b..21a39166b 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -14,11 +14,19 @@ xCAT 2.13.x |xCAT |New OS |New |New Feature | |Version | |Hardware | | +=================================+===============+=============+==================================+ -|| xCAT 2.13.3 |- RHEL 6.9 | |- rpower for OpenBMC(experimental)| -|| 2017/4/7 | | |- Add -C for rmdef to run nodeset | -|| | | | nodeset offline | -| `2.13.3 Release Notes `_ | | | | +| | | | | ++---------------------------------+---------------+-------------+----------------------------------+ +|| xCAT 2.13.3 |- RHEL 6.9 | |- OpenBMC support(experimental): | +|| 2017/4/14 | | | | +|| | | | rpower rcons | +| `2.13.3 Release Notes `_ | | | | | | | | | +---------------------------------+---------------+-------------+----------------------------------+ From 6c8002cddde6d0a4fc5136498a25f65d4cf3b17e Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Thu, 18 May 2017 15:05:48 +0800 Subject: [PATCH 030/201] [DO NOT MERGE] Refine xcattest script (#3048) * Simplify xcattest usage * Modify usage depending on Mark's comments --- xCAT-test/xcattest | 2444 +++++++++++++++++++++++++------------------- 1 file changed, 1400 insertions(+), 1044 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 30e940801..6c7f0b5d8 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -14,292 +14,650 @@ BEGIN $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; -my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; -my $needhelp = 0; -my $configinfo = undef; -my $configfile = undef; -my $casedir = "$rootdir/testcase"; -my $bundledir = "$rootdir/bundle"; -my $resultdir = "$rootdir/result"; -my $bundlelist = undef; -my $caselist = undef; -my $cmdlist = undef; -my $showbundlesorcommands = undef; -my $needshow = 0; -my $restore = 0; -my $ret = 0; -my $string1 = undef; -my $showbundlefiles = 0; -my $showcommandslist = 0; -my $stop_to_keep_env = 0; -#----------------------------------- -=head1 - System label usage: - In order to make install xCAT to be the first case for automation daily regression, "System" label is used in this xcattest command. - xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_rhels_sles - xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_ubuntu - System label means only the [System] aspect will be loaded and no other inital action will be done. -=cut +#--------------global attributes---------------- +my $prpgram_path = dirname(File::Spec->rel2abs(__FILE__)); +my $program_name = basename($0); +my $rootdir = "$prpgram_path/../share/xcat/tools/autotest"; +my $casedir = "$rootdir/testcase/"; +my $bundledir = "$rootdir/bundle/"; +my $resultdir = "$rootdir/result/"; +my $rst = 0; +my $setup_env_by_config_file = 1; +my $stop_to_keep_env = 0; -#----------------------------------- -my $initallabel = undef; -my $loadsysteminfo = "System"; +#Array to save all cases planed to handle +#these cases can be passed by option -b/-t/-c +#if without value passed by option -b/-t/-c, for "show information" function, +#the search scope is the all cases shipped by xcat_test package +my @cases_to_be_run = (); -#Create result directory -mkdir $resultdir unless -d $resultdir; - -# create a log for xcattest -my $timestamp = `date +"%Y%m%d%H%M%S"`; -open(LOG, ">$resultdir/xcattest.log.$timestamp") - or die "Can't open logfile for writing: $!"; - -if ( - !GetOptions("h|?" => \$needhelp, - "f=s" => \$configinfo, - "b=s" => \$bundlelist, - "t=s" => \$caselist, - "c=s" => \$cmdlist, - "s=s" => \$showbundlesorcommands, - "l" => \$needshow, - "restore" => \$restore) - ) -{ - &usage; - exit 1; -} - -if ($needhelp) -{ - &usage; - exit 0; -} - - -if (&checkoptions) -{ - &usage; - exit 1; -} - -#show bundle files under $bundledir with .bundle as file suffix -my %bundlefilesinfo = (); -if ($showbundlefiles) -{ - &listbundlefiles; - exit 0; -} - -#show commands, which is the folder name $casedir, with case* files and test cases -if ($showcommandslist) -{ - &listcommands; - exit 0; -} - -#load case to $cases -# key type -#$cases[x](x>0): hash -# name string -# os:AIX/Linux string -# arch:ppc64/x386 string -# hcp:hmc/mm/bmc/fsp string -# cmd: array -# check: array - -my @cases = (); -if ($needshow) { - &loadcase; - exit 0; -} - - -# create a log for run test cases -&log_this("xCAT automated test started at " . scalar(localtime())); -open(LOG_ERR, ">$resultdir/failedcases.$timestamp") - or die "Can't open error logfile for writing: $!"; - -#read config file -log_this("******************************"); -log_this("Reading Configure"); -log_this("******************************"); +#A hash to save the contect of config file +#The structure of %config #config{object}{type}{name}{attr} #config{table}{name}{entry}{key} #config{script_prev}->[] #config{script_post}->[] #config{var}{varname} my %config = (); -$ret = &getConfig; -if ($ret != 0) { - goto EXIT; + +#Array of hash, to save the information of case +my @cases = (); +my %case_name_index_map; + +#when loading cases, NORUN means just load case without attribute replacement. +#this is used for "show information" function +my $NORUN = 0; +my $RUN = 1; + +#----------global logs attributes--------------- +my $running_log_fd = undef +my $running_log_name = undef; +my $failed_log_name = undef; +my $performance_log_name = undef; + +#--------------command line attrbutes-------------- +my $needhelp = 0; +my $configfile = undef; +my $bundlelist = undef; +my $caselist = undef; +my $cmdlist = undef; +my $list = undef; +my $restore = 0; +my $quiet = 0; + +#-------------usage-------------------- +$::USAGE = "Usage: +To get help: + $program_name -h + +To list the information about all cases shipped by xcat test package + $program_name -l {caselist|caseinfo|casenum} +To list the information about all bunldes shipped by xcat test package + $program_name -l bundleinfo +To list the information about cases in specific bundles + $program_name -l {caselist|caseinfo|casenum} -b +To list the information about cases related to specific commands + $program_name -l {caselist|caseinfo|casenum} -c +To list the information about specific cases + $program_name -l {caselist|caseinfo|casenum} -t + +To run test cases in specific bundles + $program_name [-f {configure_file|configure_file:System}] -b [-r] [-q] +To run specific test cases + $program_name [-f {configure_file|configure_file:System}] -t [-r] [-q] +To run all cases related to specific commands + $program_name [-f {configure_file|configure_file:System}] -c [-r] [-q] + +Options: + -h : Get $program_name usage information. + -l : list specific information. The valid options are caselist,caseinfo,casenum,bundleinfo + -f : specify the configuration file. If 'System' tag is used, only [System] section in the configuration file will be used. If 'System' is not used all other sections of the configuration file will be used, like [Table], [Object], etc. + -c : Comma separated list of command names to test. + -t : Comma separated list of test case names to test. + -b : Comma separated list of bundle names to test. If a bundle name is specified without an absolute path, bundles under $bundledir will be searched + -r : Back up the original environment settings before running test, and restore them after running test. + -q : Just record all the output of $program_name into log file under $resultdir, not print to STDOUT. Print to STDOUT by default. +"; + +#============================================================================================== +# main process +#============================================================================================== +$rst = pro_init(); +if ($rst) { + print "Program $program_name initialization failed to exit.\n"; + to_exit(1); } -#if not only load System aspects from config file, then init test enviroment -if (!defined($initallabel)){ - log_this("******************************"); - log_this("Initialize xCAT test evironment"); - log_this("******************************"); - $ret = &init; - if ($ret != 0) { - goto EXIT; +if ( + !GetOptions("h" => \$needhelp, + "f=s" => \$configfile, + "b=s" => \$bundlelist, + "t=s" => \$caselist, + "c=s" => \$cmdlist, + "l=s" => \$list, + "q" => \$quiet, + "r" => \$restore) + ) +{ + log_this($running_log_fd, "$::USAGE"); + to_exit(1); +} + +if ($needhelp) { + log_this($running_log_fd, "$::USAGE"); + to_exit(0); +} + +my $error; +$rst = check_option_validity(\$error); +if ($rst) { + log_this($running_log_fd, "$error", "$::USAGE"); + to_exit(1); +} + +$rst = calculate_cases_to_be_run(\@cases_to_be_run, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} + +#print "----case to be run-----------------\n"; +#print Dumper \@cases_to_be_run; + +if ($list) { + if ($list eq "caselist") { + if (@cases_to_be_run) { + + #list the cases indicated by option -b,-c,-t + foreach (@cases_to_be_run) { + log_this($running_log_fd, "$_"); + } + } else { + + #list the cases shipped by xcat test package + $rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $NORUN); + if ($rst) { + log_this($running_log_fd, "$error"); + } + foreach my $case (@cases) { + log_this($running_log_fd, "$case->{name}"); + } + } + } elsif ($list eq "caseinfo") { + $rst = show_case_info(\@cases_to_be_run, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } + } elsif ($list eq "casenum") { + if (@cases_to_be_run) { + + #list the case number indicated by option -b,-c,-t + my $casenum = @cases_to_be_run; + log_this($running_log_fd, "$casenum"); + } else { + + #list the case number shipped by xcat test package + $rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $NORUN); + if ($rst) { + log_this($running_log_fd, "$error"); + } + my $casenum = @cases; + log_this($running_log_fd, "$casenum"); + } + } elsif ($list eq "bundleinfo") { + + #list the bundle information shipped by xcat test package + $rst = show_bundle_info(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } + } + to_exit(0); +} + +unless (@cases_to_be_run) { + log_this($running_log_fd, "Please indicate the cases to run by option -b,-c,-t"); + to_exit(1); +} + +if (defined($configfile) && ($configfile =~ /(.*):(System)/)) { + $configfile = $1; + $setup_env_by_config_file = 0; +} + +log_this($running_log_fd, "xCAT automated test started at " . scalar(localtime())); +if (defined($configfile)) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "loading Configure file"); + log_this($running_log_fd, "******************************"); + $rst = load_config_file($configfile, \%config, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } +} else { + $setup_env_by_config_file = 0; +} + +if ($restore) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "Backup current xCAT database"); + log_this($running_log_fd, "******************************"); + $rst = bakup_current_env(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); } } -my @filespath = (); -#loading and check cases -log_this("******************************"); -log_this("loading test cases"); -log_this("******************************"); -$ret = &loadcase; -if ($ret != 0) { - goto EXIT; +if ($setup_env_by_config_file) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "Initialize xCAT test environment by definition in configure file"); + log_this($running_log_fd, "******************************"); + $rst = setup_env_by_configure_file(\%config, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } } -#run case -log_this("******************************"); -log_this("Start to run test cases"); -log_this("******************************"); -&reordercases if (defined($bundlelist) || defined($caselist)); -&runcase; +log_this($running_log_fd, "******************************"); +log_this($running_log_fd, "loading test cases"); +log_this($running_log_fd, "******************************"); +$rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $RUN); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} + +#print "======Dumper loaded cases=======\n"; +#print Dumper \@cases; +#print "=====Dumper case_name_index_map=======================\n"; +#print Dumper \%case_name_index_map; + +log_this($running_log_fd, "******************************"); +log_this($running_log_fd, "Start to run test cases"); +log_this($running_log_fd, "******************************"); +$rst = run_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} -EXIT: -log_this("******************************"); -log_this("un-initialize xCAT test evironment"); -log_this("******************************"); if ($restore) { - &uninit; + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "restore xCAT test evironment"); + log_this($running_log_fd, "******************************"); + $rst = restore_current_env(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } } -&log_this("\nxCAT automated test finished at " . scalar(localtime())); -&log_this("Please check results in the $resultdir, \nand see $resultdir/failedcases.$timestamp file for failed cases.\nsee $resultdir/performance.report.$timestamp file for time consumption"); -close(LOG); -close(LOG_ERR); -my $reportfile = "$resultdir/performance.report.$timestamp"; -my $tmpreport = "$resultdir/xcattest.log.$timestamp"; -&getreport($tmpreport, $reportfile); +log_this($running_log_fd, "xCAT automated test finished at" . scalar(localtime())); +log_this($running_log_fd, "Please check results in the $resultdir, \nand see $failed_log_name file for failed cases."); + +#To generate performance report +$rst = generate_performance_report($running_log_name, $performance_log_name, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} +log_this($running_log_fd, "see $performance_log_name file for time consumption"); if ($stop_to_keep_env) { - exit 1; + to_exit(1); } else { - exit 0; + to_exit(0); } -# end main -# -# logger -# +#============================================================================================== +# sub function implementation +#============================================================================================== -sub log_this -{ - print LOG join("\n", @_), "\n"; +#-------------------------------------------------------- +# Fuction name: log_this +# Description: print message to log file and STDOUT. +# Set '-q' option in command line, just print message to log file +# Atrributes: $logdf: the file description of openning log file +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub log_this { + my $logdf = shift; my $msg = join("\n", @_); - if ($msg =~ /\[Pass\]/) { - print color("green"), "$msg\n", color("reset"); - } elsif ($msg =~ /\[Failed\]/) { - print color("red"), "$msg\n", color("reset"); - } else { - print "$msg\n"; - } -} -sub log_error -{ - print LOG_ERR join("\n", @_), "\n"; -} - -sub include_file -{ - my $file = shift; - my $idir = shift; - my @text = (); - unless ($file =~ /^\//) { - $file = $idir . "/" . $file; - } - open(INCLUDE, $file) || return "#INCLUDEBAD:cannot open $file#"; - while () { - chomp($_); - s/\s+$//; #remove trailing spaces - next if /^\s*$/; #-- skip empty lines - push(@text, $_); - } - close(INCLUDE); - return join(",", @text); -} - -sub sort_caserange -{ - my @caserange = @_; - my $bundletext = join(',', @caserange); - #handle the #INLCUDE# tag recursively - my $idir = "$rootdir/bundle"; - my $doneincludes = 0; - while (not $doneincludes) { - $doneincludes = 1; - if ($bundletext =~ /#INCLUDE:[^#^\n]+#/) { - $doneincludes = 0; - $bundletext =~ s/#INCLUDE:([^#^\n]+)#/include_file($1,$idir)/eg; + #print message to STDOUT + if (!$quiet) { + if ($msg =~ /\[Pass\]/) { + print color("green"), "$msg\n", color("reset"); + } elsif ($msg =~ /\[Failed\]/) { + print color("red"), "$msg\n", color("reset"); + } else { + print "$msg\n"; } } - @caserange=split(",",$bundletext); - my @diff; - foreach my $case (@caserange) { - unless (grep { $_ eq $case } @diff) { - push @diff, $case; - } - } - my %index; - my @same = grep($index{$_}++, @caserange); - my @error =grep /INCLUDEBAD/, @caserange; - return (\@diff, \@same, \@error); + + #record message to log file + print $logdf "$msg\n"; + + return 0; } -sub getConfig -{ - my $type = undef; #Script_Prev,Script_Post,Table,Object,System,Custom - my $sub_type = undef; # The string after $type_ - # Script--> - # Script_Prev - # Script_Post - # Table---> - # Table_xxxxx - # Object--> - # Object_xxxx - # System----> - # Custom----> +#-------------------------------------------------------- +# Fuction name: pro_init +# Description: Do program initialization +# Atrributes: +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub pro_init { + mkpath("$resultdir") unless (-d "$resultdir"); - my $name = undef; - my $attr = undef; - my $value = undef; - my $c = 0; - my $cmd = undef; - my $mgt_name = undef; - - if (!open(FILE, "$configfile")) { - log_this("Error: can't open xCAT config file: $configfile"); - return 1; - } - - #Only load System information - if (defined($initallabel) && ($initallabel eq $loadsysteminfo)) { - while (my $line = ) { - $line = &trim($line); - next if (length($line) == 0); + my $timestamp = `date +"%Y%m%d%H%M%S"`; + chomp($timestamp); + $running_log_name = "$resultdir/xcattest.log.$timestamp"; + if (!open($running_log_fd, ">$running_log_name")) { + print "Failed to generate running log file for $program_name: $!\n"; + return 1; + } - #Only read System variable - if ($line =~ /\[System\]/) { - $type = "Varible"; - } - if (defined($type) && ($type eq "Varible")) { - if ($line =~ /(\w+)\s*=\s*([\w\.\-\+\/:]+)/) { - $config{var}{$1} = $2; + $failed_log_name = "$resultdir/failedcases.$timestamp"; + $performance_log_name = "$resultdir/performance.report.$timestamp"; + return 0; +} + +#-------------------------------------------------------- +# Fuction name: calculate_cases_to_be_run +# Description: calculate the case scope to be handle depending on option -b,-c,-t +# Atrributes: +# $cases_to_be_run_ref (output attribe) +# The reference of array to save the cases to be handled +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#------------------------------------------------------- +sub calculate_cases_to_be_run { + my $cases_to_be_run_ref = shift; + my $error_ref = shift; + + my $fd = undef; + my @cases = (); + + $$error_ref = ""; + if ($bundlelist) { + my @bundles = split(",", $bundlelist); + foreach my $bundle (@bundles) { + + #if $bundle doesn't include path information, find $bundle under $bundledir by default + my $bundlepath = dirname($bundle); + if ($bundlepath eq ".") { + $bundle = "$bundledir/$bundle"; + } + if (!-e "$bundle") { + $$error_ref = "There isn't file $bundle\n"; + last; + } + if (!open($fd, "$bundle")) { + $$error_ref = "Can't open file $bundle:$!\n"; + last; + } + while (my $line = <$fd>) { + chomp($line); + $line =~ s/#.+//g if ($line =~ "#" && $line !~ "^#INCLUDE"); + $line =~ s/^\s+|\s+$//g; + next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); + push(@cases, $line); + } + close($fd); + } + + return 1 if (length($$error_ref) != 0); + + #to handle "#INCLUDE:XXXXXXX#" line + my $casetxt = join(',', @cases); + for (; ;) { + if ($casetxt =~ /#INCLUDE:[^#^\n]+#/) { + $casetxt =~ s/#INCLUDE:([^#^\n]+)#/expend_include_file($1)/eg; + } else { + last; + } + } + @cases = split(",", $casetxt); + + my @error = grep /INCLUDEBAD/, @cases; + if (@error) { + $$error_ref = join("\n", @error); + return 1; + } + @{$cases_to_be_run_ref} = @cases; + } elsif ($caselist) { + @cases_to_be_run = split(",", $caselist); + } elsif ($cmdlist) { + my @cmds = split /,/, $cmdlist; + my @files = (); + my @cmdfiles = (); + get_files_recursive("$casedir", \@files); + for (my $countfile = 0 ; $countfile < @files ; $countfile++) { + for (my $countcmd = 0 ; $countcmd < @cmds ; $countcmd++) { + if ($files[$countfile] =~ m/\/$cmds[$countcmd]\/case/) { + push(@cmdfiles, glob("$files[$countfile]")); } - } - } - }else{ - #Load all config files information - while (my $line = ) { - $line = &trim($line); + } + } + + my $fd = undef; + foreach my $file (@cmdfiles) { + if (!open($fd, "<$file")) { + $$error_ref = "can't open $file:$!"; + return 1; + } + while (my $line = <$fd>) { + $line =~ s/^\s+|#[^!].+|\s+$//g; + + #skip blank and comment lines + next if (length($line) == 0 || ($line =~ /^\s*#/)); + if ($line =~ /^start\s*:\s*(.*)/) { + push @{$cases_to_be_run_ref}, $1; + } + } + close($fd); + } + } + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: expend_include_file +# Description: To support '#INCLUDE" label in bundle file, to expend the include file +# Atrributes: $bundle (input attribute): the name of bundle +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub expend_include_file { + my $bundle = shift; + + my $fd = undef; + my $bundlepath = dirname($bundle); + my @cases = (); + + if ($bundlepath eq ".") { + $bundle = "$bundledir/$bundle"; + } + if (!-e "$bundle") { + return "#INCLUDEBAD:cannot find $bundle#"; + } + if (!open($fd, "<$bundle")) { + return "#INCLUDEBAD:cannot open $bundle $!#"; + } + while (my $line = <$fd>) { + chomp($line); + $line =~ s/#.+//g if ($line =~ "#" && $line !~ "^#INCLUDE"); + $line =~ s/^\s+|\s+$//g; + next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); + push(@cases, $line); + } + close($fd); + return join(",", @cases); +} + +#-------------------------------------------------------- +# Fuction name: to_exit +# Description: customize exit function, include clean up environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub to_exit { + my $exit_code = shift; + close($running_log_fd) if (defined $running_log_fd); + &runcmd("rm -rf /tmp/xCATdbbackup") if (-d "/tmp/xCATdbbackup"); + exit $exit_code; +} + + +#-------------------------------------------------------- +# Fuction name: check_option_validity +# Description: check the validity of command line +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub check_option_validity { + my $error_ref = shift; + + if ($list) { + my @vaild_list_method = (); + if ($bundlelist || $caselist || $cmdlist) { + @vaild_list_method = ("caselist", "caseinfo", "casenum"); + } else { + @vaild_list_method = ("caselist", "caseinfo", "casenum", "bundleinfo"); + } + if (!(grep { /^$list$/ } @vaild_list_method)) { + $$error_ref = "Unsupport list method for option l"; + return 1; + } + } + + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: show_case_info +# Description: to show case name and description +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub show_case_info { + my $cases_to_be_run_ref = shift; + my $error_ref = shift; + + my @cases = (); + my %case_name_index_map; + my $rst = load_case($cases_to_be_run_ref, \@cases, \%case_name_index_map, $error_ref, $NORUN); + if ($rst) { + return 1; + } + + #print Dumper \@cases; + my %caseinfo; + my $case_num = @{$cases_to_be_run_ref}; + if ($case_num) { + foreach my $case (@{$cases_to_be_run_ref}) { + my $casedes = "without description"; + $casedes = $cases[ $case_name_index_map{$case} ]->{description} if ($cases[ $case_name_index_map{$case} ]->{description}); + $caseinfo{$case} = $casedes; + } + } else { + foreach my $case (@cases) { + my $casedes = "without description"; + $casedes = $case->{description} if ($case->{description}); + $caseinfo{ $case->{name} } = $casedes; + } + } + print_table(\%caseinfo); + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: show_bundle_info +# Description: show bundle name and description +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub show_bundle_info { + my $error_ref = shift; + + my %bundleinfo; + my $dd = undef; + my @bundlefiles = (); + if (!opendir(DIR, $bundledir)) { + $$error_ref = "Can't open directory $bundledir: $!"; + return 1; + } + my @files = readdir(DIR); + foreach my $file (@files) { + next if (-d $file); + next if ($file =~ /^\./); + push(@bundlefiles, $file); + } + closedir(DIR); + + foreach my $bundlefile (@bundlefiles) { + $bundleinfo{$bundlefile} = "without description"; + } + my $fd = undef; + foreach my $bundlefile (@bundlefiles) { + if (!open($fd, "< $bundledir$bundlefile")) { + $$error_ref = "Can't open bundle file $bundledir$bundlefile $!"; + return 1; + } + while (my $line = <$fd>) { + $line =~ s/^\s+|#.+|\s+$//g; + if ($line =~ /^description\s*:\s*(.*)/) { + $bundleinfo{$bundlefile} = $1; + last; + } + } + close($fd); + } + + print_table(\%bundleinfo); + return 0; +} + +#-------------------------------------------------------- +# Fuction name: load_config_file +# Description: load config file indicated by option -f +# Atrributes: +# $configfile (input attribute) +# The config file name +# $config_ref (output attribute) +# The reference of a hash to save the contect of config file +# The hash %config is a global attribute. +# The structure of %config: +# config{object}{type}{name}{attr} +# config{table}{name}{entry}{key} +# config{script_prev}->[] +# config{script_post}->[] +# config{var}{varname} +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub load_config_file { + my $configfile = shift; + my $config_ref = shift; + my $error_ref = shift; + + my $type = undef; + my $sub_type = undef; + my $name = undef; + my $attr = undef; + my $value = undef; + my $c = 0; + my $cmd = undef; + my $mgt_name = undef; + my $fd = undef; + + if (!open($fd, "$configfile")) { + $$error_ref = "Error: can't open xCAT config file $configfile: $!"; + return 1; + } + + while (my $line = <$fd>) { + $line =~ s/^\s+|#.+|\s+$//g; next if (length($line) == 0); #Table name can not contain "_" @@ -315,11 +673,11 @@ sub getConfig if ($line =~ /(\w+)\s*=\s*([\w\.\-]+)/) { $attr = $1; $value = $2; - if ($name && ($config{table}{$sub_type}{$name}{__KEY__} ne $attr)) { - $config{table}{$sub_type}{$name}{$attr} = $value; + if ($name && ($$config_ref{table}{$sub_type}{$name}{__KEY__} ne $attr)) { + $$config_ref{table}{$sub_type}{$name}{$attr} = $value; } else { $name = $value; - $config{table}{$sub_type}{$name}{__KEY__} = $attr; + $$config_ref{table}{$sub_type}{$name}{__KEY__} = $attr; } } } elsif ($type eq "Object") { @@ -330,644 +688,498 @@ sub getConfig if ($attr eq "Name") { $name = $value; } elsif (!defined($name)) { - print "Please give name for Object\n"; - close FILE; + $$error = "Please give name for Object section"; + close($fd); return 1; } else { - $config{object}{$sub_type}{$name}{$attr} = $value; + $$config_ref{object}{$sub_type}{$name}{$attr} = $value; } } } elsif ($type eq "Script") { ##SCRIPT_BLOCK## if ($sub_type eq "Prev") { - $config{script_prev}->[$c] = $line; + $$config_ref{script_prev}->[$c] = $line; $c = $c + 1; } elsif ($sub_type eq "Post") { - $config{script_post}->[$c] = $line; + $$config_ref{script_post}->[$c] = $line; $c = $c + 1; } } elsif ($type eq "Varible") { ##NODE_BLOCK## if ($line =~ /(\w+)\s*=\s*([\w\.\-\+\/:]+)/) { - $config{var}{$1} = $2; + $$config_ref{var}{$1} = $2; } } } -} - if (exists $config{object}) { - foreach my $type (keys %{ $config{object} }) { - foreach my $name (keys %{ $config{object}{$type} }) { - log_this("OBJECT:$name,TYPE:$type"); - foreach my $attr (keys %{ $config{object}{$type}{$name} }) { - log_this(" $attr = $config{object}{$type}{$name}{$attr};"); + if (exists $$config_ref{object}) { + foreach my $type (keys %{ $$config_ref{object} }) { + foreach my $name (keys %{ $$config_ref{object}{$type} }) { + log_this($running_log_fd, "OBJECT:$name,TYPE:$type"); + foreach my $attr (keys %{ $$config_ref{object}{$type}{$name} }) { + log_this($running_log_fd, " $attr = $$config_ref{object}{$type}{$name}{$attr};"); } } } } - if (exists $config{table}) { - foreach my $type (keys %{ $config{table} }) { - log_this("TABLE:$type"); - foreach my $name (keys %{ $config{table}{$type} }) { - log_this(" $config{table}{$type}{$name}{__KEY__} = $name"); - foreach my $attr (keys %{ $config{table}{$type}{$name} }) { + if (exists $$config_ref{table}) { + foreach my $type (keys %{ $$config_ref{table} }) { + log_this($running_log_fd, "TABLE:$type"); + foreach my $name (keys %{ $$config_ref{table}{$type} }) { + log_this($running_log_fd, " $$config_ref{table}{$type}{$name}{__KEY__} = $name"); + foreach my $attr (keys %{ $$config_ref{table}{$type}{$name} }) { if ($attr ne '__KEY__') { - log_this(" $attr = $config{table}{$type}{$name}{$attr}"); + log_this($running_log_fd, " $attr = $$config_ref{table}{$type}{$name}{$attr}"); } } - log_this("\n"); } } } - if (exists $config{script_prev}) { - log_this("Script_Prev:"); - foreach $cmd (@{ $config{script_prev} }) { - log_this(" $cmd"); + if (exists $$config_ref{script_prev}) { + log_this($running_log_fd, "Script_Prev:"); + foreach $cmd (@{ $$config_ref{script_prev} }) { + log_this($running_log_fd, " $cmd"); } } - if (exists $config{script_post}) { - log_this("Script_Post:"); - foreach $cmd (@{ $config{script_post} }) { - log_this(" $cmd"); + if (exists $$config_ref{script_post}) { + log_this($running_log_fd, "Script_Post:"); + foreach $cmd (@{ $$config_ref{script_post} }) { + log_this($running_log_fd, " $cmd"); } } - if (exists $config{var}) { - log_this("Varible:"); - foreach my $varname (keys %{ $config{var} }) { - log_this(" $varname = $config{var}{$varname}"); + if (exists $$config_ref{var}) { + log_this($running_log_fd, "Varible:"); + foreach my $varname (keys %{ $$config_ref{var} }) { + log_this($running_log_fd, " $varname = $$config_ref{var}{$varname}"); } } - close FILE; + close($fd); return 0; } -sub init -{ - if ($restore) { - log_this("******************************"); - log_this("Backup current xCAT database"); - log_this("******************************"); - &runcmd("mkdir -p /tmp/xCATdbbackup"); - &runcmd("dumpxCATdb -p /tmp/xCATdbbackup"); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to backup xCAT database"); - &runcmd("rm -rf /tmp/xCATdbbackup"); - $restore = 0; +#-------------------------------------------------------- +# Fuction name: load_case +# Description: load test case +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $case_ref (input attribe) +# The reference of a array of hash to save the contect of case +# The array @cases is a global attribute. +# The struture of @cases are: +# $cases[index]->{name} +# $cases[index]->{os} +# $cases[index]->{arch} +# $cases[index]->{hcp} +# $cases[index]->{type} +# $cases[index]->{stop} +# $cases[index]->{description} +# $cases[index]->{attribute} +# $cases[index]->{cmd}->[index][index] +# $cases[index]->{check}->[index][index] +# $cases[index]->{cmdcheck}->[index][index] +# $case_name_index_map_ref (input attribute) +# The reference of a hash to save the mapping of test name ane its index in @cases +# Due to there maybe is more than one implementation for one case +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# $run_case_flag (input attribute) +# The flag of whether run these case nex. +# 0 means no, just load case basic information, used by "searching informaiotn funtion of xcattest" +# 1 means yes, load case basic information and parse the attribure at the sametime. used by "run case funtion of xcattest" +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub load_case { + my $cases_to_be_run_ref = shift; + my $case_ref = shift; + my $case_name_index_map_ref = shift; + my $error_ref = shift; + my $run_case_flag = shift; + + #if @{$cases_to_be_run_ref} is empty, that means not indicate test case scope by command line option -b,-t,-c + #load all cases shipped by xcat test package + my $load_all_case_flag = 0; + my $case_num = @{$cases_to_be_run_ref}; + $load_all_case_flag = 1 if ($case_num == 0); + + my @files = (); + get_files_recursive("$casedir", \@files); + + my $line; + my $i = 0; + my $j = -1; + my $z = 0; + my $m = 0; + my $newcmdstart = 0; + my $skip = 0; + my $fd = undef; + + my %invalidcases; + foreach my $file (@files) { + if (!open($fd, "<$file")) { + $$error_ref = "Can't open $file: $!"; return 1; } - } - my $cmd = undef; - foreach $cmd (@{ $config{script_prev} }) { - log_this("$cmd"); - &runcmd($cmd); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to run $cmd"); - return 1; - } - } - if (exists $config{object}) { - foreach my $type (keys %{ $config{object} }) { - foreach my $name (keys %{ $config{object}{$type} }) { - $cmd = "chdef -t $type -o $name"; - foreach my $attr (keys %{ $config{object}{$type}{$name} }) { - $cmd = $cmd . " $attr=$config{object}{$type}{$name}{$attr}"; - } - log_this($cmd); - runcmd($cmd); - if ($::RUNCMD_RC != 0) { - log_this("Fail to run $cmd"); - return 1; - } - } - } - } - if (exists $config{table}) { - foreach my $type (keys %{ $config{table} }) { - foreach my $name (keys %{ $config{table}{$type} }) { - $cmd = "chtab $config{table}{$type}{$name}{__KEY__}=$name"; - foreach my $attr (keys %{ $config{table}{$type}{$name} }) { - if ($attr ne '__KEY__') { - $cmd = $cmd . " $type.$attr=$config{table}{$type}{$name}{$attr}"; + while ($line = <$fd>) { + $line =~ s/^\s+|#[^!].+|\s+$//g; + + #skip blank and comment lines + next if (length($line) == 0 || ($line =~ /^\s*#/)); + + if ($line =~ /^start\s*:\s*(.*)/) { + my $name = $1; + if ($load_all_case_flag) { + if (is_valid_case_name($name)) { + $skip = 0; + $j = -1; + $case_ref->[$i] = {}; + $case_ref->[$i]->{name} = $name; + $case_ref->[$i]->{filename} = $file; + $$case_name_index_map_ref{"$name"} = $i; + $newcmdstart = 0; + } else { + $skip = 1; + push @{ $invalidcases{"invalidcasename"} }, $name; + } + } else { + if (!(grep { /^$name$/ } @{$cases_to_be_run_ref})) { + $skip = 1; + next; + } else { + if (is_valid_case_name($name)) { + $skip = 0; + $j = -1; + $case_ref->[$i] = {}; + $case_ref->[$i]->{name} = $name; + $case_ref->[$i]->{filename} = $file; + $$case_name_index_map_ref{"$name"} = $i; + $newcmdstart = 0; + } else { + $skip = 1; + push @{ $invalidcases{"invalidcasename"} }, $name; + } } } - log_this($cmd); - &runcmd($cmd); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to run $cmd"); - return 1; + } elsif ($line =~ /^os\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{os} = $1; + + if ($run_case_flag) { + + #To judge whether need to skip the current case + my @validoslist = split(",", $case_ref->[$i]->{os}); + my @newvalidoslist = (); + foreach my $validos (@validoslist) { + if ($validos =~ /linux/i) { + push(@newvalidoslist, ("rhel", "sles", "ubnutu")); + } else { + push(@newvalidoslist, $validos); + } + } + + my $currentos = get_current_os(); + my $valid = 0; + foreach my $os (@newvalidoslist) { + if ($currentos =~ /$os/i) { + $valid = 1; + last; + } + } + unless ($valid) { + $skip = 1; + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } + $newcmdstart = 0; + } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{arch} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{hcp} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { + next if $skip; + $case_ref->[$i]->{type} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^stop\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{stop} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^description\s*:\s*(.+)/) { + next if $skip; + $case_ref->[$i]->{description} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^attribute\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{attribute} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^cmd\s*:\s*([\#\/\$\w].+)/) { + next if $skip; + $newcmdstart = 0; + $j = $j + 1; + $z = 0; + $m = 0; + if ($run_case_flag) { + $case_ref->[$i]->{cmd}->[$j][$m] = getvar($1, \%config); + if ($case_ref->[$i]->{cmd}->[$j][$m] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{cmd}->[$j][$m]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{cmd}->[$j][$m] = $1; + } + $newcmdstart = 1; + } elsif ($line =~ /^check\s*:\s*(\w.+)/) { + next if $skip; + if ($run_case_flag) { + $case_ref->[$i]->{check}->[$j][$z] = getvar($1, \%config); + if ($case_ref->[$i]->{check}->[$j][$z] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{check}->[$j][$z]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{check}->[$j][$z] = $1; + } + $z = $z + 1; + $newcmdstart = 0; + } elsif ($line =~ /^cmdcheck\s*:\s*(\w.+)/) { + next if $skip; + if ($run_case_flag) { + $case_ref->[$i]->{cmdcheck}->[$j][$z] = getvar($1, \%config); + if ($case_ref->[$i]->{cmdcheck}->[$j][$z] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{cmdcheck}->[$j][$z]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{cmdcheck}->[$j][$z] = $1; + } + $z = $z + 1; + $newcmdstart = 0; + } elsif ($line =~ /^end/) { + next if $skip; + $i = $i + 1; + $newcmdstart = 0; + } elsif ($newcmdstart) { + ++$m; + $case_ref->[$i]->{cmd}->[$j][$m] = $line; + } + } + close($fd); + } + + my @wrong_cases = (); + my $caseerror = 0; + if ($invalidcases{"invalidcasename"}) { + + #log_this($running_log_fd, "Case name invalid:", @{ $invalidcases{"invalidcasename"} }); + $$error_ref = "Case name invalid: " . join(",", @{ $invalidcases{"invalidcasename"} }); + push @wrong_cases, @{ $invalidcases{"invalidcasename"} }; + $caseerror = 1; + } + + if ($run_case_flag) { + if ($invalidcases{"missattr"}) { + + #log_this($running_log_fd, "Miss attribute:", @{$invalidcases{"missattr"}}); + $$error_ref = "Miss attribute: " . join(",", @{ $invalidcases{"missattr"} }); + foreach my $line (@{ $invalidcases{"missattr"} }) { + my $name = split(" ", $line); + if (!(grep /$name/, @wrong_cases)) { + push @wrong_cases, $name; } } + $caseerror = 1; } - } - if (!exists $config{var}{OS}) { - my @output = runcmd("uname"); - $config{var}{OS} = $output[0]; - log_this("Detecting: OS = $config{var}{OS}"); - } else { - $config{var}{OS} = lc($config{var}{OS}); - } + if ($invalidcases{"noruncases"}) { + log_this($running_log_fd, "Not to run:", @{ $invalidcases{"noruncases"} }); + push @wrong_cases, @{ $invalidcases{"noruncases"} }; + } - if (!exists $config{var}{ARCH}) { - if (!exists $config{var}{CN}) { - $config{var}{ARCH} = "Unknown"; - log_this("Error: No compute node defined, can't get ARCH of compute node"); - } else { - $config{var}{ARCH} = getnodeattr($config{var}{CN}, "arch"); - if ($config{var}{ARCH} =~ /ppc/) { - $config{var}{ARCH} = 'ppc'; - } elsif ($config{var}{ARCH} =~ /86/) { - $config{var}{ARCH} = 'x86'; + unless ($caseerror) { + my @new_cases_to_be_run = (); + foreach my $c (@{$cases_to_be_run_ref}) { + if (!(grep { /^$c$/ } @wrong_cases)) { + push @new_cases_to_be_run, $c; + } } - log_this("Detecting: ARCH = $config{var}{ARCH}"); + log_this($running_log_fd, "To run:", @new_cases_to_be_run); + @{$cases_to_be_run_ref} = @new_cases_to_be_run; } } - if (!exists $config{var}{HCP}) { - if (!exists $config{var}{CN}) { - $config{var}{HCP} = "Unknown"; - log_this("Error: No compute node defined, can't get HCP TYPE of compute node"); - } else { - $config{var}{HCP} = getnodeattr($config{var}{CN}, "mgt"); - log_this("Detecting: HCP = $config{var}{HCP}"); - } + return $caseerror; +} +#-------------------------------------------------------- +# Fuction name: bakup_current_env +# Description: back up the xcat db +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub bakup_current_env { + my $error_ref = shift; + &runcmd("mkdir -p /tmp/xCATdbbackup"); + &runcmd("dumpxCATdb -p /tmp/xCATdbbackup"); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to backup xCAT database"; + &runcmd("rm -rf /tmp/xCATdbbackup"); + return 1; } return 0; } -sub uninit -{ - my $cmd = undef; - - # if(exists $config{object}){ - # foreach my $type (keys %{$config{object}}){ - # foreach my $name (keys %{$config{object}{$type}}){ - # $cmd = "rmdef -t $type -o $name"; - # log_this($cmd); - # runcmd($cmd); - # if($::RUNCMD_RC != 0){ - # log_this("Fail to run $cmd"); - # return 1; - # } - # } - # } - # } - # if(exists $config{table}){ - # foreach my $type (keys %{$config{table}}){ - # foreach my $name (keys %{$config{table}{$type}}){ - # $cmd = "chtab -d $config{table}{$type}{$name}{__KEY__}=$name $type"; - # log_this($cmd); - # runcmd($cmd); - # if($::RUNCMD_RC != 0){ - # log_this("Fail to run $cmd"); - # return 1; - # } - # } - # } - # } - foreach $cmd (@{ $config{script_post} }) { - log_this($cmd); - runcmd($cmd); - if ($::RUNCMD_RC != 0) { - log_this("Error: Fail to run $cmd"); - return 1; - } - } - +#-------------------------------------------------------- +# Fuction name: restore_current_env +# Description: restore the xcat db +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub restore_current_env { + my $error_ref = shift; &runcmd("restorexCATdb -p /tmp/xCATdbbackup"); &runcmd("rm -rf /tmp/xCATdbbackup"); return 0; } -sub Get_Files_Recursive -{ - my $dir = $_[0]; - foreach $dir (@_) - { - opendir(my $d, $dir); - for (; ;) - { - my $direntry = readdir($d); - last unless defined $direntry; - next if $direntry =~ m/^\.\w*/; - next if $direntry eq '..'; - if (-d $dir . "/" . $direntry) - { - Get_Files_Recursive($dir . "/" . $direntry); - } - else - { my $dirpath = $dir . '/' . $direntry . "\n"; - #print $dirpath; +#-------------------------------------------------------- +# Fuction name: run_case +# Description: +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $case_ref (input attribe) +# The reference of a array of hash to save the contect of case +# The array @cases is a global attribute. +# Please refer load_case function's comment to get the struture of @cases +# $case_name_index_map_ref (input attribute) +# The reference of a hash to save the mapping of test name ane its index in @cases +# Due to there maybe is more than one implementation for one case +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub run_case { + my $cases_to_be_run_ref = shift; + my $cases_ref = shift; + my $case_name_index_map_ref = shift; + my $error_ref = shift; - #print $dir."\n"; - push(@filespath, glob("$dirpath")); - - } - } - closedir($d); - } -} - -sub loadcase -{ - my @files = (); - - #if($cmdlist){ - # my @cmds = split /,/,$cmdlist; - # for my $cmd (@cmds){ - # push (@files, glob("$casedir/$cmd/*")); - # } - #} else { - # @files = glob("$casedir/*/*"); - #} - Get_Files_Recursive("$casedir"); - for (my $countfile = 0 ; $countfile < @filespath ; $countfile++) - { - #TODO:if commands are not right, no action or message now - if ($cmdlist) { - my @cmds = split /,/, $cmdlist; - for (my $countcmd = 0 ; $countcmd < @cmds ; $countcmd++) { - if ($filespath[$countfile] =~ m/\/$cmds[$countcmd]\/case/) { - push(@files, glob("$filespath[$countfile]")); - } - } - } else { - push(@files, glob("$filespath[$countfile]")); - } - } - - - my $file; - my $line; - my $i = 0; - my $j = -1; - my $z = 0; - my $skip = 0; - - my @caserange = (); - my @rightcase = (); - my @notrightcase = (); - my @wrongnamecase= (); - my @samecase = (); - my @errorcase = (); - if ($bundlelist) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles) { - if (!open(FILE, "<$bundledir/$bundle")) { - log_this("can't open $bundledir/$bundle"); - return 1; - } - while ($line = ) { - chomp($line); - next if (length($line) == 0); - push(@caserange, $line); - } - close(FILE); - my @refs=sort_caserange(@caserange); - @caserange=@{$refs[0]}; - @samecase=@{$refs[1]}; - @errorcase=@{$refs[2]}; - } - } - - #TODO:if cases are not existed, no action or message. - if ($caselist) { - @caserange = split /,/, $caselist; - } - - foreach $file (@files) { - if (!open(FILE, "<$file")) { - log_this("can't open $file"); - return 1; - } - while ($line = ) { - $line = &trim($line); - next if (length($line) == 0); - - #skip comment lines - next if ($line =~ /^\s*#/); - - #TODO: description and attribute line is treated as a comment line for now - next if ($line =~ /^description\s*:/); - next if ($line =~ /^attribute\s*:/); - - if ($line =~ /^start\s*:\s*(.*)/) { - my $name =$1; - if ($name =~ /[^a-zA-Z0-9_-]/) { - $skip = 1; - push(@wrongnamecase, $name); - next; - }else { - $skip = 0; - if ($caserange[0] && !(grep { /^$name$/ } @caserange)) { - $skip = 1; - next; - } - $j = -1; - $cases[$i] = {}; - $cases[$i]->{name} = $name; - $cases[$i]->{filename} = $file; - if (!$needshow) { - $cases[$i]->{cmd} = []; - $cases[$i]->{check} = []; - $cases[$i]->{cmdcheck} = []; - push(@rightcase, $name); - } else { - $skip = 1; - $i = $i + 1; - } - } - } elsif ($line =~ /^os\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $string1 = $1; - if ($string1 =~ /^rhels\s*/ && -f "/etc/redhat-release") { - $cases[$i]->{os} = "rhels"; - } elsif ($string1 =~ /^sles\s*/ && -f "/etc/SuSE-release") { - $cases[$i]->{os} = "sles"; - } elsif ($string1 =~ /^ubuntu\s*/ && -f "/etc/lsb-release") { - $cases[$i]->{os} = "ubuntu"; - } - else { - $cases[$i]->{os} = $string1; - - } - - chomp($cases[$i]->{os}); - chomp($config{var}{OS}); - if ($cases[$i]->{os} !~ /$config{var}{OS}/) { - if ((($config{var}{OS} =~ /^Linux\s*/i) && ($cases[$i]->{os} =~ /^aix\s*/i)) || (($config{var}{OS} =~ /^aix\s*/i) && ($cases[$i]->{os} !~ /^aix\s*/i)) || (($config{var}{OS} =~ /^rhels\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i)) || (($config{var}{OS} =~ /^sles\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i)) || (($config{var}{OS} =~ /^ubuntu\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i))) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } - - } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{arch} = $1; - if ($cases[$i]->{arch} !~ /$config{var}{ARCH}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{hcp} = $1; - if ($cases[$i]->{hcp} !~ /$config{var}{HCP}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { - next if $skip; - $cases[$i]->{type} = $1; - if ($cases[$i]->{type} !~ /$config{var}{TYPE}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^stop\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{stop} = $1; - } elsif ($line =~ /^cmd\s*:\s*([\/\$\w].+)/) { - next if $skip; - $j = $j + 1; - $z = 0; - $cases[$i]->{cmd}->[$j] = &getvar($1); - if ($cases[$i]->{cmd}->[$j] eq '') { - close(FILE); - return 1; - } - } elsif ($line =~ /^check\s*:\s*(\w.+)/) { - next if $skip; - $cases[$i]->{check}->[$j][$z] = &getvar($1); - if ($cases[$i]->{check}->[$j][$z] eq '') { - close(FILE); - return 1; - } - $z = $z + 1; - } elsif ($line =~ /^cmdcheck\s*:\s*(\w.+)/) { - next if $skip; - $cases[$i]->{cmdcheck}->[$j][$z] = &getvar($1); - if ($cases[$i]->{cmdcheck}->[$j][$z] eq '') { - close(FILE); - return 1; - } - $z = $z + 1; - } elsif ($line =~ /^end/) { - next if $skip; - $i = $i + 1; - } - } - - close(FILE); - } - - if ($needshow) { - if (@cases) { - foreach my $case (@cases) { - log_this("$case->{name}"); - } - }else { - log_this("Error: Please check the case name or command name"); - } - log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); - return 0; - } - - if (@rightcase) { - log_this("To run:", @rightcase); - }else { - log_this("Error: No case to run, please check the case name or command name"); - } - log_this("Not to run:", @notrightcase) if (@notrightcase); - log_this("Duplicated case:", @samecase) if (@samecase); - log_this("INCLUDEBAD case:", @errorcase) if (@errorcase); - log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); - return 0; -} -sub getnodeattr -{ - my ($node, $attr) = @_; - my @output = runcmd("lsdef -t node -o $node -i $attr"); - my $t; - if ($::RUNCMD_RC) { - - # return "Unknown"; - foreach $t (1 .. 40) { - log_this("Error: could not get node attr $attr "); - @output = runcmd("lsdef -t node -o $node -i $attr"); - last if ($::RUNCMD_RC == 0); - } - - } - if ($::RUNCMD_RC == 0) { - foreach my $output1 (@output) { - if ($output1 =~ /$attr=(\w.+)/) { - log_this("$attr is $1"); - return $1; - } - } - } - return "Unknown"; -} - -sub gettablevalue -{ - my ($keyname, $key, $colname, $table) = @_; - my @output = runcmd("gettab $keyname=$key $table\.$colname"); - return $output[0]; -} - -#to remove space and comment -sub trim -{ - my $str = shift @_; - if ($str) { - - # $str =~ s/\#/__wellnumber__/g; - $str =~ s/^\s+|#.+|\s+$//g; - - # $str =~ s/__wellnumber__/#/g; - } - return $str; -} - -sub getvar -{ - my $str = shift @_; - while ($str =~ /\$\$(\w+)/) { - my $varname = $1; - if (exists($config{var}{$varname})) { - $str =~ s/\$\$$varname/$config{var}{$varname}/g; - } else { - log_this("Error: can't get varible $varname"); - return ''; - } - } - return $str; -} - -sub getfunc -{ - my $str = shift @_; - my $func = undef; - my @para = (); - my $parameter = undef; - my $value = undef; - while ($str =~ /__(\w+)\(([\s\,\w\$]*)\)__/) { - $func = $1; - $parameter = $2; - log_this("parameter is $parameter,fun is $func"); - @para = split /\s*,\s*/, trim($parameter); - if ($func eq "GETNODEATTR") { - $value = getnodeattr(@para); - log_this("value is $value"); - if ($value eq "Unknown") { - $value = ''; - } - } elsif ($func eq "INC") { - $value = $para[0] + 1; - } elsif ($func eq "GETTABLEVALUE") { - $value = gettablevalue(@para); - } - $str =~ s/__$func\($parameter\)__/$value/g; - } - return $str; -} - -sub runcase -{ - my @output = (); - my $rc = 0; - my $j = 0; - my $z = 0; - my $lvalue = undef; - my $rvalue = undef; - my $op = undef; - my $failed = 0; my $total = 0; my $failnum = 0; - foreach my $case (@cases) { - my @record = (); - $failed = 0; - $j = 0; - $total = $total + 1; - my $now1 = timelocal(localtime()); - my $time1 = scalar(localtime()); - log_this("------START:$$case{name}::Time:$time1------"); - push @record, "------START:$$case{name}::Time:$time1------"; - push @record, "FILENAME:$$case{filename}"; - foreach my $cmd (@{ $$case{cmd} }) { - $cmd = getfunc($cmd); + my $failed_log_fd = undef; + if (!open($failed_log_fd, ">$failed_log_name")) { + $error_ref = "Failed to generate failed log file for $program_name: $!"; + return 1; + } - #by - my $runstart = timelocal(localtime()); + foreach my $case (@{$cases_to_be_run_ref}) { + my @caselog = (); + + my $failflag = 0; + my $j = 0; + ++$total; + + my $case_start_time = timelocal(localtime()); + my $case_start_time_str = scalar(localtime()); + + log_this($running_log_fd, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); + push @caselog, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; + push @caselog, "FILENAME:$cases_ref->[$case_name_index_map_ref->{$case}]->{filename}\n"; + + foreach my $cmd (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmd} }) { + + my $runstart = timelocal(localtime()); my $runstartstr = scalar(localtime()); - log_this("\nRUN:$cmd [$runstartstr]"); - push(@record, "\nRUN:$cmd [$runstartstr]"); - @output = &runcmd($cmd); - $rc = $::RUNCMD_RC; + my $cmdlen = @{$cmd}; + my @output = (); + my $rc = 0; + if ($cmdlen == 1) { + + #to run singal line command + + $cmd = getfunc($cmd->[0]); + @output = &runcmd($cmd); + $rc = $::RUNCMD_RC; + log_this($running_log_fd, "RUN:$cmd [$runstartstr]"); + push(@caselog, "RUN:$cmd [$runstartstr]"); + } else { + + #to run multiple lines command + + @output = runscript($cmd); + $rc = $::RUNCMD_RC; + log_this($running_log_fd, "RUN: [$runstartstr]", @{$cmd}); + push(@caselog, ("RUN: [$runstartstr]", @{$cmd})); + } - #by my $runstop = timelocal(localtime()); my $diffduration = $runstop - $runstart; - log_this("\n[$cmd] Running Time:$diffduration sec"); - push(@record, ("\n[$cmd] Running Time:$diffduration sec")); + log_this($running_log_fd, ("ElapsedTime:$diffduration sec", "RETURN rc = $rc", "OUTPUT:", @output)); + push(@caselog, ("ElapsedTime:$diffduration sec", "RETURN rc = $rc", "OUTPUT:", @output)); - log_this("RETURN: rc = $rc", "OUTPUT:", @output); - push(@record, ("RETURN rc = $rc", "OUTPUT:", @output)); + foreach my $check (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{check}->[$j] }) { + last if ($failflag); - - foreach my $check (@{ $$case{check}->[$j] }) { - if ($failed) { - last; - } if ($check =~ /rc\s*([=!]+)\s*(\d+)/) { - $lvalue = $rc; - $op = $1; - $rvalue = $2; + my $lvalue = $rc; + my $op = $1; + my $rvalue = $2; if ((($op eq '!=') && ($lvalue == $rvalue)) || (($op eq '==') && ($lvalue != $rvalue))) { - $failed = 1; + $failflag = 1; } - if ($failed) { - log_this("CHECK:rc $op $rvalue\t[Failed]"); - push(@record, "CHECK:rc $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:rc $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:rc $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:rc $op $rvalue\t[Pass]"); - push(@record, "CHECK:rc $op $rvalue\t[Pass]"); + log_this($running_log_fd, "CHECK:rc $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:rc $op $rvalue\t[Pass]"); } } elsif ($check =~ /output\s*([=!~]+)\s*(\S.*)/ && $check !~ /output\s*([=!~])\1/) { - $lvalue = join("\n", @output); - $op = $1; - $rvalue = $2; + my $lvalue = join("\n", @output); + my $op = $1; + my $rvalue = $2; + $rvalue = getfunc($rvalue); if ((($op eq '=~') && ($lvalue !~ /$rvalue/)) || (($op eq '!~') && ($lvalue =~ /$rvalue/)) || (($op eq '==') && ($lvalue ne $rvalue)) || (($op eq '!=') && ($lvalue eq $rvalue))) { - $failed = 1; + $failflag = 1; } - if ($failed) { - log_this("CHECK:output $op $rvalue\t[Failed]"); - push(@record, "CHECK:output $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:output $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:output $op $rvalue\t[Pass]"); - push(@record, "CHECK:output $op $rvalue\t[Pass]"); + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:output $op $rvalue\t[Pass]"); } } elsif ($check =~ /output\s*~~\s*(\S.*)/) { - $op = "~~"; - $failed = 1; - $rvalue = $1; + my $op = "~~"; + + #my $failflag = 1; + my $rvalue = $1; + $rvalue = getfunc($rvalue); my $num; if ($rvalue =~ /(\d+)/) { @@ -982,7 +1194,7 @@ sub runcase my $min = $num * 0.9; $line =~ /.*:.*: (\d+) /; if ($1 < $max && $1 > $min) { - $failed = 0; + $failflag = 0; last; } } else { @@ -990,54 +1202,166 @@ sub runcase } } } - if ($failed) { - log_this("CHECK:output $op $rvalue $num\t[Failed]"); - push(@record, "CHECK:output $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:output $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:output $op $rvalue $num\t[Pass]"); - push(@record, "CHECK:output $op $rvalue\t[Pass]"); - } - } - } - foreach my $cmdcheck (@{ $$case{cmdcheck}->[$j] }) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:output $op $rvalue\t[Pass]"); + } } } + foreach my $cmdcheck (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmdcheck}->[$j] }) { if ($cmdcheck) { &runcmd($cmdcheck); $rc = $::RUNCMD_RC; if ($rc == 1) { - log_this("CMDCHECK:output $cmdcheck\t[Failed]"); - push(@record, "CHECK:output $cmdcheck\t[Failed]"); + log_this($running_log_fd, "CHECK:output $cmdcheck\t[Failed]"); + push(@caselog, "CHECK:output $cmdcheck\t[Failed]"); } elsif ($rc == 0) { - log_this("CMDCHECK:output $cmdcheck\t[Pass]"); - push(@record, "CHECK:output $cmdcheck\t[Pass]"); + log_this($running_log_fd, "CHECK:output $cmdcheck\t[Pass]"); + push(@caselog, "CHECK:output $cmdcheck\t[Pass]"); } } } $j = $j + 1; + log_this($running_log_fd, " "); + push(@caselog, " "); } - my $now2 = timelocal(localtime()); - my $time2 = scalar(localtime()); - my $diff = $now2 - $now1; - if ($failed) { - log_this("------END::$$case{name}::Failed::Time:$time2 ::Duration::$diff sec------"); - push(@record, "------END::$$case{name}::Failed::Time:$time2 ::Duration::$diff sec------"); + my $case_end_time = timelocal(localtime()); + my $case_end_time_str = scalar(localtime()); + my $diff = $case_end_time - $case_start_time; + + if ($failflag) { + log_this($running_log_fd, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Failed::Time:$case_end_time_str ::Duration::$diff sec------"); + push(@caselog, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Failed::Time:$case_end_time_str ::Duration::$diff sec------"); } else { - log_this("------END::$$case{name}::Passed::Time:$time2 ::Duration::$diff sec------"); - push(@record, "------END::$$case{name}::Passed::Time:$time2 ::Duration::$diff sec------"); + log_this($running_log_fd, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Passed::Time:$case_end_time_str ::Duration::$diff sec------"); + push(@caselog, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Passed::Time:$case_end_time_str ::Duration::$diff sec------"); } - if ($failed) { - $failnum = $failnum + 1; - log_error(@record); - if (defined($$case{stop}) && ($$case{stop} =~ /^yes$/)) { + + if ($failflag) { + ++$failnum; + print $failed_log_fd (join("\n", @caselog), "\n"); + if (defined($cases_ref->[ $case_name_index_map_ref->{$case} ]->{stop}) && ($cases_ref->[ $case_name_index_map_ref->{$case} ]->{stop} =~ /^yes$/)) { $stop_to_keep_env = 1; last; } } } - log_this("\n\n"); - log_this("------Total: $total , Failed: $failnum------"); + + log_this($running_log_fd, "------Total: $total , Failed: $failnum------\n"); + close($failed_log_fd); + return 0; } +#-------------------------------------------------------- +# Fuction name: setup_env_by_configure_file +# Description: set up environment by the settings in config file +# Atrributes: +# $config_ref (input attribute) +# The reference of global hash %config. +# The structure of %config please refer to the comment of function load_config_file +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub setup_env_by_configure_file { + my $config_ref = shift; + my $error_ref = shift; + + my $cmd = undef; + foreach $cmd (@{ $$config_ref{script_prev} }) { + log_this($running_log_fd, "$cmd"); + &runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + + if (exists $$config_ref{object}) { + foreach my $type (keys %{ $$config_ref{object} }) { + foreach my $name (keys %{ $$config_ref{object}{$type} }) { + $cmd = "chdef -t $type -o $name"; + foreach my $attr (keys %{ $$config_ref{object}{$type}{$name} }) { + $cmd = $cmd . " $attr=$$config_ref{object}{$type}{$name}{$attr}"; + } + log_this($running_log_fd, "$cmd"); + runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + } + } + + if (exists $$config_ref{table}) { + foreach my $type (keys %{ $$config_ref{table} }) { + foreach my $name (keys %{ $$config_ref{table}{$type} }) { + $cmd = "chtab $$config_ref{table}{$type}{$name}{__KEY__}=$name"; + foreach my $attr (keys %{ $$config_ref{table}{$type}{$name} }) { + if ($attr ne '__KEY__') { + $cmd = $cmd . " $type.$attr=$$config_ref{table}{$type}{$name}{$attr}"; + } + } + log_this($running_log_fd, "$cmd"); + &runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + } + } + + if (!exists $$config_ref{var}{OS}) { + my @output = runcmd("uname"); + $$config_ref{var}{OS} = $output[0]; + log_this($running_log_fd, "Detecting: OS = $$config_ref{var}{OS}"); + } else { + $$config_ref{var}{OS} = lc($$config_ref{var}{OS}); + } + + if (!exists $$config_ref{var}{ARCH}) { + if (!exists $$config_ref{var}{CN}) { + $$config_ref{var}{ARCH} = "Unknown"; + log_this($running_log_fd, "Warning: No compute node defined, can't get ARCH of compute node"); + } else { + $$config_ref{var}{ARCH} = getnodeattr($$config_ref{var}{CN}, "arch"); + if ($$config_ref{var}{ARCH} =~ /le|el/) { + $$config_ref{var}{ARCH} = 'ppc64le'; + } elsif ($$config_ref{var}{ARCH} =~ /ppc/) { + $$config_ref{var}{ARCH} = 'ppc'; + } elsif ($$config_ref{var}{ARCH} =~ /86/) { + $$config_ref{var}{ARCH} = 'x86'; + } + log_this($running_log_fd, "Detecting: ARCH = $$config_ref{var}{ARCH}"); + } + } + + if (!exists $$config_ref{var}{HCP}) { + if (!exists $$config_ref{var}{CN}) { + $$config_ref{var}{HCP} = "Unknown"; + log_this($running_log_fd, "Warning: No compute node defined, can't get HCP TYPE of compute node"); + } else { + $$config_ref{var}{HCP} = getnodeattr($$config_ref{var}{CN}, "mgt"); + log_this($running_log_fd, "Detecting: HCP = $$config_ref{var}{HCP}"); + } + + } + + return 0; +} + +#-------------------------------------------------------- +# Fuction name: runcmd +# Description: run a command after 'cmd' label in one case +# Atrributes: +# Retrun code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- sub runcmd { my ($cmd) = @_; @@ -1056,91 +1380,269 @@ sub runcmd } -sub usage -{ - log_this("Usage:Run xcat test cases:"); - log_this(" xcattest [-?|-h]"); - log_this(" xcattest [-f configure file] [-b case bundle files]"); - log_this(" xcattest [-f configure file] [-t cases list]"); - log_this(" xcattest [-f configure file] [-c cmds list]"); - log_this("Show xcat test cases, bundle files, commands lists:"); - log_this(" xcattest [-b case bundle files] [-l]"); - log_this(" xcattest [-t cases list] [-l]"); - log_this(" xcattest [-c cmds list] [-l]"); - log_this("Show all bundle files, all commands:"); - log_this(" xcattest [-s command|bundle]"); - log_this(""); - return; + +#-------------------------------------------------------- +# Fuction name: runscript +# Description: run a script after 'cmd' label in one case +# Atrributes: +# $script_ref (input attribute) +# the reference of array where save every line of script +# Retrun code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- +sub runscript { + my $script_ref = shift; + my $time = time(); + my $tmpdir = "/tmp/xCATautotest$time/"; + my $tmpfile = "$tmpdir/script"; + my $rf; + mkpath("$tmpdir"); + open($rf, ">$tmpfile"); + foreach my $line (@$script_ref) { + $line = getfunc($line); + print $rf "$line\n"; + } + close($rf); + chmod 0755, "$tmpfile"; + my @output = runcmd("$tmpfile"); + + unlink("$tmpfile"); + rmdir("$tmpdir"); + return @output; } -sub listbundlefiles -{ - my @bundlefiles = (); - - #get all .bundle files from /opt/xcat/share/xcat/tools/autotest/bundle/ - opendir(DIR, $bundledir); - my @files = readdir(DIR); - foreach my $file (@files){ - next if (-d $file); - if ($file =~ /\.bundle$/){ - push(@bundlefiles, $file); - } - } - closedir(DIR); - - #read all .bundle files, get descriptions for each file. - my $skip =0; - my $line; - foreach my $bundlefile (@bundlefiles) { - if (!open(FILE, "<$bundledir/$bundlefile")) { - log_this("Error: Can't open bundle file: $bundlefile"); - log_this("Use 'xcattest -s bundle' to list out available bundles"); - return 1; - } - $skip = 0; - while ($line = ) { - $line = &trim($line); - next if (length($line) == 0); - - #description line is treated as a comment line for now - if ($line =~ /^description\s*:\s*(.*)/){ - if (length($1) != 0) { - $bundlefilesinfo{$bundlefile} = $1; - $skip=1; - last; - } +#-------------------------------------------------------- +# Fuction name: getnodeattr +# Description: get the value of node attribute form current environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getnodeattr { + my $node = shift; + my $attr = shift; + my $maxtry = 40; + foreach my $try (0 .. $maxtry) { + my @output = runcmd("lsdef -t node -o $node -i $attr"); + if ($::RUNCMD_RC == 0) { + foreach my $line (@output) { + if ($line =~ /$attr=(\w.+)/) { + return $1; + } } - } - close(FILE); - if (!$skip){ - $bundlefilesinfo{$bundlefile} = "No description, add with \"description: details\" in bundle file"; - } - } - &listformatbundleinfo(%bundlefilesinfo); - + } + } + return "Unknown"; +} + +#-------------------------------------------------------- +# Fuction name: get_files_recursive +# Description: Search all file in one directory recursively +# Atrributes: +# $dir (input attribute) +# The target scan directory +# $files_path_ref (output attribute) +# the reference of array where save all vaild files under $dir +# Retrun code: +#-------------------------------------------------------- +sub get_files_recursive +{ + my $dir = shift; + my $files_path_ref = shift; + + my $fd = undef; + opendir($fd, $dir); + for (; ;) + { + my $direntry = readdir($fd); + last unless (defined($direntry)); + next if ($direntry =~ m/^\.\w*/); + next if ($direntry eq '..'); + my $target = "$dir/$direntry"; + if (-d $target) { + get_files_recursive($target, $files_path_ref); + } else { + push(@{$files_path_ref}, glob("$target\n")); + } + } + closedir($fd); +} + + +#-------------------------------------------------------- +# Fuction name: is_valid_case_name +# Description: to check if a case name is valid +# Atrributes: $casename (input atrribute): the target case name +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub is_valid_case_name { + my $casename = shift; + if ($casename =~ /[^a-zA-Z0-9_-]/) { + return 0; + } else { + return 1; + } +} + +#------------------------------------------------------- +# Fuction name: get_current_os +# Description: +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub get_current_os { + if (-f "/etc/redhat-release") { + return "rhels"; + } elsif (-f "/etc/SuSE-release") { + return "sles"; + } elsif (-f "/etc/lsb-release") { + return "ubuntu"; + } else { + return "aix"; + } +} + + +#-------------------------------------------------------- +# Fuction name: generate_performance_report +# Description: +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub generate_performance_report { + my $runninglog = shift; + my $performancelog = shift; + my $error_ref = shift; + + my $performance_log_fd = undef; + + if (!open($performance_log_fd, ">$performancelog")) { + $$error_ref = "Failed to create performance log $performancelog: $!"; + return 1; + } + + print $performance_log_fd "Testcase Duration\n"; + print $performance_log_fd "------------------------------------------------------------------------------\n"; + + my @output = runcmd("cat $runninglog"); + my $cmdlineflag = 0; + my $line; + foreach my $line (@output) { + if ($line =~ /^------START:/) { + $line =~ s/------//g; + print $performance_log_fd "$line\n"; + } elsif ($line =~ /^RUN:/) { + $cmdlineflag = 1; + print $performance_log_fd "$line;\n"; + } elsif ($line =~ /^ElapsedTime:/) { + $cmdlineflag = 0; + print $performance_log_fd "$line\n"; + } elsif ($cmdlineflag) { + print $performance_log_fd "$line\n"; + } elsif ($line =~ /^------END:/) { + $line =~ s/------//g; + print $performance_log_fd "$line\n\n"; + } + } + close($performance_log_fd); return 0; } -sub listformatbundleinfo +#-------------------------------------------------------- +# Fuction name: getvar +# Description: replace specific attribute in case definition by the value set in config file +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getvar { - my $maxlen = 0; - foreach my $filename (keys %bundlefilesinfo) { - $maxlen = length($filename) if (length($filename) > $maxlen); + my $str = shift; + my $config_ref = shift; + + while ($str =~ /\$\$(\w+)/) { + my $varname = $1; + if (exists($$config_ref{var}{$varname})) { + $str =~ s/\$\$$varname/$$config_ref{var}{$varname}/g; + } else { + return "miss attribute $varname"; + } } - $maxlen += 4; + return $str; +} + +#-------------------------------------------------------- +# Fuction name: getfunc +# Description: replace specific funciton in case definition +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getfunc +{ + my $str = shift; + + while ($str =~ /__(\w+)\(([\s\,\w\$]*)\)__/) { + my $func = $1; + my $parameter = $2; + my $value = undef; + my @para = (); + + #log_this("parameter is $parameter,fun is $func"); + chomp($parameter); + @para = split /\s*,\s*/, $parameter; + if ($func eq "GETNODEATTR") { + $value = getnodeattr($para[0], $para[1]); + if ($value eq "Unknown") { + $value = ''; + } + } elsif ($func eq "INC") { + $value = $para[0] + 1; + } elsif ($func eq "GETTABLEVALUE") { + $value = gettablevalue(@para); + } + $str =~ s/__$func\($parameter\)__/$value/g; + } + return $str; +} + +#-------------------------------------------------------- +# Fuction name: gettablevalue +# Description: get specific table value from current environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub gettablevalue +{ + my ($keyname, $key, $colname, $table) = @_; + my @output = runcmd("gettab $keyname=$key $table\.$colname"); + return $output[0]; +} + +#-------------------------------------------------------- +# Fuction name: print_table +# Description: print a hash table in good format +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub print_table { + my $msg_ref = shift; my $desiredwidth = 120; my $screenwidth = (`tput cols` + 0); my $finallen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth); - print "bundle files and descriptions:\n"; - - foreach my $filename (sort { $a cmp $b } keys %bundlefilesinfo ) { - my @desc = split(" ", $bundlefilesinfo{$filename}); + my $maxkeylen = 0; + foreach my $key (keys %{$msg_ref}) { + my $keylen = length($key); + $maxkeylen = $keylen if ($keylen > $maxkeylen); + } + $maxkeylen += 4; + + foreach my $key (sort { $a cmp $b } keys %{$msg_ref}) { + my @desc = split(" ", $msg_ref->{$key}); my $str = ""; my @formatdesc = (); foreach my $word (@desc) { - if (length($str) + length($word) > $finallen - $maxlen) { + if (length($str) + length($word) > $finallen - $maxkeylen) { $str =~ s/([^\s]+)\s$/$1/g; push @formatdesc, $str; $str = ""; @@ -1150,162 +1652,16 @@ sub listformatbundleinfo $str =~ s/([^\s]+)\s$/$1/g; push @formatdesc, $str; - print "$filename"; + print color("green"), "$key", color("reset"); - my $space = " " x ($maxlen - length($filename)); + my $space = " " x ($maxkeylen - length($key)); print "$space$formatdesc[0]\n"; delete $formatdesc[0]; - $space = " " x $maxlen; + $space = " " x $maxkeylen; foreach my $line (@formatdesc) { print "$space$line\n" if (length($line)); } } -} - -sub listcommands -{ - my @files = (); - - Get_Files_Recursive("$casedir"); - for (my $countfile = 0 ; $countfile < @ filespath ; $countfile++) - { - if ($filespath[$countfile] =~ /testcase\/(.*)\/case/) { - log_this("$1"); - } - } -} - -sub getreport -{ - open(INDOC, ">$_[1]") || die("open STDOUT failed"); - print INDOC "Testcase Duration\n"; - print INDOC "------------------------------------------------------------------------------\n"; - close(INDOC); - open(STDOUT, ">>$_[1]") || die("open STDOUT failed"); - open FD, "<$_[0]" or die "$?"; - while () { - if (/Time/) { - s/------//g; - $_ .= "\n" if /END/; - print STDOUT $_; - } - } - - close(FD); - close(STDOUT); -} - - -sub reordercases -{ - my @caserange = (); - my $line; - if ($bundlelist) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles) { - if (!open(FILE, "<$bundledir/$bundle")){ - log_this("Error: Can't open bundle file: $bundle"); - return 1; - } - while ($line = ) { - chomp($line); - next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); - push(@caserange, $line); - } - close(FILE); - my @refs=sort_caserange(@caserange); - @caserange=@{$refs[0]}; - } - } - if ($caselist) { - @caserange = split /,/, $caselist; - } - - my @tmpcases = (); - foreach my $case (@caserange) { - my $i = 0; - my $hit = 0; - foreach my $runcase (@cases) { - if ($runcase->{name} eq $case) { - $hit = 1; - last; - } - $i++; - next; - } - push(@tmpcases, $cases[$i]) if ($hit); - } - @cases = @tmpcases; -} - -sub checkoptions -{ - #-b,-c,-t,-s should be defined at least one - if (!defined($bundlelist) && !defined($caselist) && !defined($cmdlist) && !defined($showbundlesorcommands)) { - log_this("Error: please define options correctly, see below usage information:"); - return 1; - }elsif ((defined($bundlelist) || defined($caselist) || defined($cmdlist)) && (! $needshow) && !defined($configinfo)) { - #config file must be defined if the using -c,-b,-t to run test cases - log_this("Error: To run test cases, please define the config file with -f option"); - log_this(" To show test cases, please use the -l option"); - return 1; - }elsif (defined($showbundlesorcommands) && (defined($bundlelist) || defined($caselist) || defined($cmdlist))) { - #-s can't be used together with -c,-b,-t - log_this("Error: -b,-c or -t can't be used together with -s"); - return 1; - }elsif (defined($showbundlesorcommands) && $needshow) { - log_this("Error: -s, -l can't be used together"); - return 1; - } - - #check the -s option, the value should be bundle or command - if (defined($showbundlesorcommands)) { - if (($showbundlesorcommands ne "bundle") && ($showbundlesorcommands ne "command")) { - log_this("Error: please use \"bundle\" or \"command\" as the \-s value"); - return 1; - }elsif ($showbundlesorcommands eq "bundle") { - $showbundlefiles = 1; - }else { - } - $showcommandslist= 1; - } - - #get and check config file and System label - #this System label means only the [System] variable will be loaded - if (defined($configinfo)) { - if ($configinfo =~ /(.*):(.*)/) { - $configfile = $1; - $initallabel = $2; - if ($initallabel ne $loadsysteminfo) { - log_this("Error: $initallabel is not supported!"); - return 1; - } - }else { - $configfile = $configinfo; - } - if (!(-e $configfile)) { - log_this("Error: Can't open config file: $configfile"); - return 1; - } - } - - #check bundle files - if (defined($bundlelist)) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles){ - if ("$bundledir/$bundle" !~ /\.bundle$/) { - log_this("Error: please input the .bundle file"); - log_this("Use 'xcattest -s bundle' to list all bundle files"); - return 1; - } - if (!(-e "$bundledir/$bundle")) { - log_this("Error: Can't open bundle file: $bundle"); - log_this("Use 'xcattest -s bundle' to list all bundle files"); - return 1; - } - } - } - return 0; } From 28b68fd82344186e4b604a15af3db31e68d46c0a Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Thu, 18 May 2017 16:23:53 +0800 Subject: [PATCH 031/201] Remove redundant space, it will result in case failed to be loaded (#3095) --- xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle index c430a505f..74a0d4803 100644 --- a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle @@ -38,7 +38,7 @@ rspconfig_ip_invalid rspconfig_netmask rspconfig_netmask_invalid rspconfig_gateway -rspconfig_gateway_invalid +rspconfig_gateway_invalid rspconfig_node_invalid rspconfig_ip_null reg_linux_diskfull_installation_flat From 213e7e05de91dbb40570e888f0fe795c6b299079 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 18 May 2017 17:16:58 +0800 Subject: [PATCH 032/201] create framework for executing and saving performance testcase data (#2500) - refine the xcatperftest tool to make it be easily integrated into xcattest - add testcase/performance/.. to trigger the performance testcase - fix manpage missing issue for xcatperftest --- xCAT-test/autotest/perfcmds.lst | 2 +- xCAT-test/autotest/testcase/performance/case0 | 18 +++ xCAT-test/bin/xcatperftest | 111 ++++++++++++++++-- xCAT-test/debian/rules | 2 + xCAT-test/xCAT-test.spec | 2 + 5 files changed, 122 insertions(+), 13 deletions(-) create mode 100644 xCAT-test/autotest/testcase/performance/case0 diff --git a/xCAT-test/autotest/perfcmds.lst b/xCAT-test/autotest/perfcmds.lst index e1cf7eb3c..d41d203c5 100644 --- a/xCAT-test/autotest/perfcmds.lst +++ b/xCAT-test/autotest/perfcmds.lst @@ -6,7 +6,7 @@ makedhcp #NODES# makeknownhosts #NODES# nodech #NODES# groups,=group1 nodels #NODES# noderes -nodeset #NODES# osimage=rhels7.3-GA-ppc64le-install-compute +nodeset #NODES# osimage=#OSIMAGE# chdef -t node -o #NODES# postscripts="fake" profile="install" netboot="grub2" rmdef -t node #PERFGRP# mkdef -z < #STANZ# diff --git a/xCAT-test/autotest/testcase/performance/case0 b/xCAT-test/autotest/testcase/performance/case0 new file mode 100644 index 000000000..6ed131c19 --- /dev/null +++ b/xCAT-test/autotest/testcase/performance/case0 @@ -0,0 +1,18 @@ +start:perftest_5000 +description:Default performance testing on 5000 fake nodes +os:Linux +cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils +cmd:copycds $$ISO +check:rc==0 +cmd:xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +check:rc==0 +end + +start:perftest_5000_without_conf +description:Default performance testing on 5000 fake nodes without extra configuraiton on MN +os:Linux +cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils +check:rc==0 +cmd:xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +check:rc==0 +end diff --git a/xCAT-test/bin/xcatperftest b/xCAT-test/bin/xcatperftest index e68e6b8f4..8795fb3a8 100755 --- a/xCAT-test/bin/xcatperftest +++ b/xCAT-test/bin/xcatperftest @@ -26,6 +26,17 @@ isNumber() expr $1 + 0 &>/dev/null } +# Used for prerequiste checking +preChecking() +{ + local val="" + for cmd in brctl ifconfig; do + which $cmd > /dev/null 2>&1 + [ $? -ne 0 ] && val="$cmd,$val" + done + echo $val | sed s/,$// +} + # Give a simple usage if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "[PERF_DRYRUN=y] [PERF_NOCREATE=y] $0 [command-list-file]" @@ -45,6 +56,12 @@ if [ -z $XCATROOT ]; then fi fi +pass=$(preChecking) +if [ ! -z "$pass" ]; then + echo "Error: Missing required tools: $pass" + [ -z $PERF_DRYRUN ] && exit -1 +fi + # Mandatory, to specify the number of total fake nodes which will be created for testing FAKE_NODE_TOTAL=$1 @@ -73,6 +90,18 @@ if [ -z $FAKE_NETWORK_BMC ]; then FAKE_NETWORK_BMC='192.169' fi +# Optional, The network mask for the fake network object. +# By default, it is '255.255.0.0' but it could be changed when you set environment variable `FAKE_NETWORK_MASK` +if [ -z $FAKE_NETWORK_MASK ]; then + FAKE_NETWORK_MASK='255.255.0.0' +fi + +# Optional, The bridge device name for the temporary interface which is required on MN as nodeset/makedhcp will check if the MN and CN in same subnet. +# By default, it is 'perfvirbr0' but it could be changed when you set environment variable `FAKE_NETWORK_INTF` +if [ -z $FAKE_NETWORK_INTF ]; then + FAKE_NETWORK_INTF='perfvirbr0' +fi + # Optional, The node template name used for generating fake nodes. # By default, it is '-template' but it could be changed when you set environment variable `FAKE_NODE_GROUP` if [ -z $PERF_NODETEMPL ]; then @@ -81,11 +110,14 @@ fi # IP address assinged to node will be in [1-250] NODE_PER_ROW=250 +MYSUFFIX=`date +"%Y%m%d%H%M%S"` -PERFORMANCE_DIR=/tmp/xcat-performance -PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/node.tmpl -PERFORMANCE_REPORT=$PERFORMANCE_DIR/report-$FAKE_NODE_TOTAL.$$ -PERFORMANCE_STANZ=$PERFORMANCE_DIR/stanz-$FAKE_NODE_TOTAL.$$ +if [ -z $PERFORMANCE_DIR ]; then + PERFORMANCE_DIR=$XCATROOT/share/xcat/tools/autotest/result +fi +PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/perf-node.tmpl +PERFORMANCE_REPORT=$PERFORMANCE_DIR/perfreport-$FAKE_NODE_TOTAL.log.$MYSUFFIX +PERFORMANCE_STANZ=$PERFORMANCE_DIR/perfstanz-$FAKE_NODE_TOTAL.$MYSUFFIX # If the command list file is not specified, the tool will only create the stanz file for fake nodes. # If it is specified but not exists, the tool will exit with error. @@ -135,6 +167,45 @@ fakeNode() # bmc=$FAKE_NETWORK_BMC.$2.$3 bmcpassword=fake bmcusername=fake groups=all,performance > /dev/null 2>&1 } +# Create a fake xCAT network definition +fakeNetwork() +{ + lsdef -t network -o net-$FAKE_NODE_PREFIX > /dev/null 2>&1 + if [ 0 != $? ]; then + mkdef -t network net-$FAKE_NODE_PREFIX net=$FAKE_NETWORK_PRO.0.0 mask=$FAKE_NETWORK_MASK > /dev/null + else + chdef -t network -o net-$FAKE_NODE_PREFIX net=$FAKE_NETWORK_PRO.0.0 mask=$FAKE_NETWORK_MASK > /dev/null + fi +} + +# Create a fake xCAT network definition +fakeInterface() +{ + result=`ifconfig $1 2>/dev/null` + if [ -z "$2" ]; then + [ -z "$result" ] && brctl addbr $1 + ifconfig $1 $FAKE_NETWORK_PRO.251.254 netmask $FAKE_NETWORK_MASK || echo "$1 is not configured successfully" + elif [ ! -z "$result" ]; then + ifconfig $1 down + brctl delbr $1 || echo "$1 is not removed successfully, you may need to clean up manually." + fi +} + +getOSimage() +{ + # The OS image name used in nodeset to replace the MACRO Variable `#OSIMAGE#`. + # By default, it could be detectd automatically according to the arch + if [ -z $PERF_OSIMAGE ]; then + + # covert it to an array + osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|awk '/compute/ {print $1}')) + index=`expr $RANDOM % ${#osimage_array[@]} 2>/dev/null` + echo ${osimage_array[$index]} + else + echo $PERF_OSIMAGE + fi +} + # Create batch fake nodes stanz file for testing bootstrap() { @@ -164,6 +235,7 @@ runTest() { cmd=$1 + [ -z $osimage ] || cmd="${cmd/\#OSIMAGE\#/$osimage}" if [[ $cmd =~ '#STANZ#' ]]; then #mkdef -z execCmd "${cmd/\#STANZ\#/$PERFORMANCE_STANZ}" "$FAKE_NODE_TOTAL" @@ -179,7 +251,7 @@ runTest() do isNumber $num || continue if [[ $num -le $FAKE_NODE_TOTAL ]]; then - cmd=$1 + #cmd=$1 execCmd "${cmd/\#NODES\#/$FAKE_NODE_PREFIX[1-$num]}" "$num" fi done @@ -195,10 +267,11 @@ runTest() # Output performance result for each command. printResult() { - cmd=`echo "$1" | awk '{print $1}'` + #TODO, more clear short desc for this command + desc=`echo "$1" | awk '{print $1}'` result=$([[ $4 = 0 ]] && echo "SUCESS" || echo "FAIL") # TOTAL, CMD, NODERANGE, TIME, SUCESS, FULL COMMAND - echo "$FAKE_NODE_TOTAL", "$cmd", "$2", "$3", $result, \"$1\" >> $PERFORMANCE_REPORT + echo "$FAKE_NODE_TOTAL; $desc; $2; $3; $result; \"$1\"" | tee -a $PERFORMANCE_REPORT } # Executing each command and print the result to report file @@ -222,19 +295,21 @@ execCmd() ################################################# # Main Loop of the performance baseline testing # ################################################# -lsxcatd -a +version=`lsxcatd -a 2>/dev/null | grep Version` if [ 0 != $? ]; then - echo "ERROR: xCAT daemon is not running" - #exit 99 + echo "ERROR: xCAT daemon is not running. Start 'xcatd' and rerun this tool." + exit 99 fi -mkdir -p /tmp/xcat-performance +mkdir -p $PERFORMANCE_DIR lsdef -t node --template $PERF_NODETEMPL > $PERFORMANCE_NODE_TMPL 2>/dev/null if [ 0 != $? ]; then - echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun the script." + echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun this tool." exit 99 fi +#Get available OS image, it will be used for nodeset if possible +osimage=$(getOSimage) rack=$(expr $FAKE_NODE_TOTAL / $NODE_PER_ROW) @@ -257,13 +332,24 @@ if [ -z $RUN_CMD_LIST ]; then fi echo "Continue the performance testing for commands in $RUN_CMD_LIST " +if [ -z "$osimage" ]; then + echo "WARN: Cannot determine the OS image, the commands which defined with #OSIMAGE# will be failed." +fi + +echo $version | tee $PERFORMANCE_REPORT echo "==================================================" # Initial Populate the fake nodes into DB if [ -z $PERF_NOCREATE ]; then + #create fake network for makedns, makedhcp etc... + fakeNetwork execCmd "mkdef -z -f < $PERFORMANCE_STANZ" "$FAKE_NODE_TOTAL" fi +# fake interface is required for topology with service nodes as it will determine if then Mn/Sn are +# in the same subnet with CNs +fakeInterface $FAKE_NETWORK_INTF + series=`grep '^#SERIES#' $RUN_CMD_LIST | awk '{print $2}'` if [ ! -z $series ]; then series=${series//,/ } @@ -287,6 +373,7 @@ IFS_BAK= rm -f $PERFORMANCE_NODE_TMPL rm -f $PERFORMANCE_STANZ +fakeInterface $FAKE_NETWORK_INTF del if [ -z $PERF_DRYRUN ]; then echo diff --git a/xCAT-test/debian/rules b/xCAT-test/debian/rules index ad419b385..d7863c5c1 100755 --- a/xCAT-test/debian/rules +++ b/xCAT-test/debian/rules @@ -15,6 +15,8 @@ build: mkdir -p share/doc/man1 pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1 pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html + pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1 + pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html pwd clean: diff --git a/xCAT-test/xCAT-test.spec b/xCAT-test/xCAT-test.spec index 0625e5de9..e5f3d0fb5 100644 --- a/xCAT-test/xCAT-test.spec +++ b/xCAT-test/xCAT-test.spec @@ -28,7 +28,9 @@ Provides automated test tool and buckets to help test xCAT commands automaticall mkdir -p share/man/man1 mkdir -p share/doc/man1 pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1 +pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1 pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html +pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html %install # The install phase puts all of the files in the paths they should be in when the rpm is From d7c78132ee115468bb5a040b2672c4ea134d6cb6 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 18 May 2017 09:54:27 -0400 Subject: [PATCH 033/201] Supports range of ports for tagging vlan command --- xCAT-server/share/xcat/scripts/configMellanox | 54 ++++++++++++------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 8538eb5b9..ab2e798cc 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -341,9 +341,22 @@ sub run_rspconfig { } sub config_vlan { + my @ports; + my $port_input; # checking for port number, switches is checked earlier if ($::PORT) { - $port = $::PORT; + $port_input = $::PORT; + foreach my $num_str (split /,/, $port_input) { + if ($num_str =~ /-/) { + my ($min, $max) = split (/-/,$num_str); + while ($min < $max) { + push (@ports,$min); + $min++; + } + } else { + push (@ports,$num_str); + } + } } else { xCAT::MsgUtils->message("E","Error - When configuring VLAN, a port must be provided."); &usage; @@ -381,28 +394,29 @@ sub config_vlan { next; } + print "Tagging VLAN=$vlan for $switch port $port_input\n"; + + #create vlan + my $vlan_cmd = `xdsh $switch --devicetype $devicetype "enable;configure terminal;vlan $vlan;exit;exit" `; + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; - my $cmd; + foreach my $port (@ports) { + my $cmd; + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "interface ethernet 1/$port\;"; + $cmd = $cmd . "switchport mode $mode\;"; + if ($mode =~ /access/) { + $cmd = $cmd . "switchport access vlan $vlan\;"; + } else { + $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + } + $cmd = $cmd . "exit\;exit\;exit\;"; + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; - print "Tagging VLAN=$vlan for $switch port $port\n"; - - # Build up the commands for easier readability - $cmd = $cmd . "enable\;"; - $cmd = $cmd . "configure terminal\;"; - $cmd = $cmd . "vlan $vlan\;"; - $cmd = $cmd . "exit\;"; - $cmd = $cmd . "interface ethernet 1/$port\;"; - $cmd = $cmd . "switchport mode $mode\;"; - if ($mode =~ /access/) { - $cmd = $cmd . "switchport access vlan $vlan\;"; - } else { - $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + `$final_cmd` } - $cmd = $cmd . "exit\;exit\;exit\;"; - my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; - - `$final_cmd` - } } From 56fe5f42393dc6f76e87763a4bb0d17c8341d4e1 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 18 May 2017 11:27:59 -0400 Subject: [PATCH 034/201] change to < to <= --- xCAT-server/share/xcat/scripts/configMellanox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index ab2e798cc..8095d3bc6 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -349,7 +349,7 @@ sub config_vlan { foreach my $num_str (split /,/, $port_input) { if ($num_str =~ /-/) { my ($min, $max) = split (/-/,$num_str); - while ($min < $max) { + while ($min <= $max) { push (@ports,$min); $min++; } From 7d109e915218ae7a5137b7410cdbfbf4b786b097 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 19 May 2017 11:29:07 +0800 Subject: [PATCH 035/201] Link 2.13.4 document --- README.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2cb961dfd..d8457bd7c 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211| +|docs_latest| |docs_2134||docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| Open Source License ------------------- @@ -22,6 +22,11 @@ Developers Developers and prospective contributors are encouraged to read the `Developers Guide `_ In particular the `GitHub `_ related subsection. +.. |docs_2134| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.4 + :alt: 2.13.4 documentation status + :scale: 100% + :target: http://xcat-docs.readthedocs.io/en/2.13.4/ + .. |docs_2133| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.3 :alt: 2.13.3 documentation status :scale: 100% From 408d3a4fca85931fc2f413b4e5a522aecc7489b4 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 19 May 2017 11:29:35 +0800 Subject: [PATCH 036/201] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d8457bd7c..1d9a9e0ca 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2134||docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| +|docs_latest| |docs_2134| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| Open Source License ------------------- From f2a09bc62b166ae37f39dea590ffc6a555d80f65 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 19 May 2017 11:32:24 +0800 Subject: [PATCH 037/201] Bump to 2.13.5 after 2.13.4 release --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 965a689ec..8bbab5627 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.13.4 +2.13.5 From b57f085b8182c209e45851fe6c4d47f9d97479f4 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 19 May 2017 04:12:13 -0400 Subject: [PATCH 038/201] Run all cases specified by command line, do not skip invalid case --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 6c7f0b5d8..3ffd7cfd4 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1016,7 +1016,7 @@ sub load_case { } } log_this($running_log_fd, "To run:", @new_cases_to_be_run); - @{$cases_to_be_run_ref} = @new_cases_to_be_run; + #@{$cases_to_be_run_ref} = @new_cases_to_be_run; } } return $caseerror; From 4fd1aeae80f1429f2dd6fa4d37fb5e68fd893e79 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 May 2017 13:05:18 -0400 Subject: [PATCH 039/201] Handle openbmc transition states --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 519a4a13c..f3adf401b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -848,11 +848,23 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + # State is off, but check if it is transitioning + if ($response_info->{'data'}->{RequestedHostTransition} =~ /On$/) { + xCAT::SvrUtils::sendmsg("powering-on", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("off", $callback, $node); + } } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { xCAT::SvrUtils::sendmsg("quiesced", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + # State is on, but check if it is transitioning + if ($response_info->{'data'}->{RequestedHostTransition} =~ /Off$/) { + xCAT::SvrUtils::sendmsg("powering-off", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("on", $callback, $node); + } } } From f2df60815620144099194bd63717d2998251cc66 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 May 2017 14:30:14 -0400 Subject: [PATCH 040/201] Sync up .rst files --- docs/source/guides/admin-guides/references/man5/networks.5.rst | 2 +- docs/source/guides/admin-guides/references/man7/network.7.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/networks.5.rst b/docs/source/guides/admin-guides/references/man5/networks.5.rst index b9ab58208..c71afb5f2 100644 --- a/docs/source/guides/admin-guides/references/man5/networks.5.rst +++ b/docs/source/guides/admin-guides/references/man5/networks.5.rst @@ -138,7 +138,7 @@ networks Attributes: \ **mtu**\ - The default MTU for the network + The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks. diff --git a/docs/source/guides/admin-guides/references/man7/network.7.rst b/docs/source/guides/admin-guides/references/man7/network.7.rst index 644e12908..593a52fb0 100644 --- a/docs/source/guides/admin-guides/references/man7/network.7.rst +++ b/docs/source/guides/admin-guides/references/man7/network.7.rst @@ -89,7 +89,7 @@ network Attributes: \ **mtu**\ (networks.mtu) - The default MTU for the network + The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks. From 327f570f7c946747cf1c5113a04e074b1a2bc20f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 May 2017 16:20:21 -0400 Subject: [PATCH 041/201] Changes due to review --- xCAT-server/lib/xcat/plugins/openbmc.pm | 30 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f3adf401b..b5a31fe49 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -29,6 +29,14 @@ use xCAT::SvrUtils; use xCAT::GlobalDef; use xCAT_monitoring::monitorctrl; +# String constants for rpower states +$::POWER_STATE_OFF="off"; +$::POWER_STATE_ON="on"; +$::POWER_STATE_POWERING_OFF="powering-off"; +$::POWER_STATE_POWERING_ON="powering-on"; +$::POWER_STATE_QUIESCED="quiesced"; +$::POWER_STATE_RESET="reset"; + sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { @@ -825,21 +833,21 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); $new_status{$::STATUS_POWERING_ON} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_OFF_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); $new_status{$::STATUS_POWERING_OFF} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("reset", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_RESET", $callback, $node); $new_status{$::STATUS_POWERING_ON} = [$node]; } } @@ -850,22 +858,26 @@ sub rpower_response { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { # State is off, but check if it is transitioning if ($response_info->{'data'}->{RequestedHostTransition} =~ /On$/) { - xCAT::SvrUtils::sendmsg("powering-on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_ON", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); } } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { - xCAT::SvrUtils::sendmsg("quiesced", $callback, $node); - } else { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_QUIESCED", $callback, $node); + } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Running$/) { # State is on, but check if it is transitioning if ($response_info->{'data'}->{RequestedHostTransition} =~ /Off$/) { - xCAT::SvrUtils::sendmsg("powering-off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_OFF", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); } } + else { + my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; + xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); + } } if ($next_status{ $node_info{$node}{cur_status} }) { From a290657965dc6e01c05bf374357c507cbebcc1e5 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 22 May 2017 04:06:14 -0400 Subject: [PATCH 042/201] Fix bug: failed to handle multiple cases with the same case name --- xCAT-test/xcattest | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 3ffd7cfd4..600cb5d93 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -819,6 +819,7 @@ sub load_case { my $fd = undef; my %invalidcases; + my %case_name_index_map_bak; foreach my $file (@files) { if (!open($fd, "<$file")) { $$error_ref = "Can't open $file: $!"; @@ -839,6 +840,9 @@ sub load_case { $case_ref->[$i] = {}; $case_ref->[$i]->{name} = $name; $case_ref->[$i]->{filename} = $file; + if(exists($$case_name_index_map_ref{"$name"})){ + $case_name_index_map_bak{"$name"}=$$case_name_index_map_ref{"$name"}; + } $$case_name_index_map_ref{"$name"} = $i; $newcmdstart = 0; } else { @@ -856,6 +860,9 @@ sub load_case { $case_ref->[$i] = {}; $case_ref->[$i]->{name} = $name; $case_ref->[$i]->{filename} = $file; + if(exists($$case_name_index_map_ref{"$name"})){ + $case_name_index_map_bak{"$name"}=$$case_name_index_map_ref{"$name"}; + } $$case_name_index_map_ref{"$name"} = $i; $newcmdstart = 0; } else { @@ -890,7 +897,12 @@ sub load_case { } } unless ($valid) { - $skip = 1; + #$skip = 1; + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; } } @@ -1099,8 +1111,8 @@ sub run_case { my $case_start_time = timelocal(localtime()); my $case_start_time_str = scalar(localtime()); - log_this($running_log_fd, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); - push @caselog, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; + log_this($running_log_fd, "------START::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); + push @caselog, "------START::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; push @caselog, "FILENAME:$cases_ref->[$case_name_index_map_ref->{$case}]->{filename}\n"; foreach my $cmd (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmd} }) { From ea2d22887ba8b421571b7e720aa9a5d60a070d84 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 22 May 2017 15:27:11 -0400 Subject: [PATCH 043/201] Modify pdu error message and check pdu version for different OID --- xCAT-server/lib/xcat/plugins/pdu.pm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 17e66f50c..e92a7dc0d 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -287,11 +287,11 @@ sub powerpduoutlet { my ($pdu, $outlet) = split /:/, $pdu_outlet; my $session = connectTopdu($pdu,$callback); if (!$session) { - $callback->({ errorcode => [1],error => "Couldn't connect to $pdu"}); + $callback->({ errorcode => [1],error => "$node: Couldn't connect to $pdu"}); next; } if ($outlet > $pdunodes->{$pdu}->{outlet} ) { - $callback->({ errorcode => [1],error => "outlet number $outlet is invalid for $pdu"}); + $callback->({ error => "$node: $pdu outlet number $outlet is invalid"}); next; } my $cmd; @@ -314,7 +314,7 @@ sub powerpduoutlet { } if ($session->{ErrorStr}) { - $callback->({ errorcode => [1],error => "$session->{ErrorStr} for $pdu outlet $outlet"}); + $callback->({ errorcode => [1],error => "$node: $pdu outlet $outlet has error = $session->{ErrorStr}"}); } else { $output = "$pdu outlet $outlet is $statstr"; xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes); @@ -341,7 +341,8 @@ sub outletpower { my $type = "INTEGER"; if ($session->{newmib}) { $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; - } + } + my $varbind = new SNMP::Varbind([ $oid, $outlet, $value, $type ]); return $session->set($varbind); @@ -425,6 +426,7 @@ sub connectTopdu { my $community = "public"; my $session; my $msg = "connectTopdu"; + my $versionoid = ".1.3.6.1.4.1.2.6.223.7.3.0"; $session = new SNMP::Session( DestHost => $pdu, @@ -435,14 +437,17 @@ sub connectTopdu { unless ($session) { return; } - $session->{newmib} = 0; - my $pduversion = $session->get(".1.3.6.1.4.1.2.6.223.7.3.0"); - if ($pduversion =~ /(\d+)\.(\d+)_(\d+)/) { - if ($1 >= 1 and $2 >= 3 and $3 >= 3) { - $session->{newmib} = 1; - } + + my $varbind = new SNMP::Varbind([ $versionoid, '' ]); + my $pduversion = $session->get($varbind); + if ($session->{ErrorStr}) { + return; } + $session->{newmib} = 0; + if ($pduversion =~ /sLEN/) { + $session->{newmib} = 1; + } return $session; @@ -450,6 +455,4 @@ sub connectTopdu { - - 1; From 7f22c23bf03d3cf3276f5b7f7e9aabeb3b1062a3 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 22 May 2017 15:47:58 -0400 Subject: [PATCH 044/201] Open rpower and rinv commands --- xCAT-server/lib/xcat/plugins/openbmc.pm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 519a4a13c..b3cec10b4 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -32,10 +32,9 @@ use xCAT_monitoring::monitorctrl; sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { - xCAT::SvrUtils::sendmsg("Warning: Currently running development code, use at your own risk. Unset XCAT_OPENBMC_DEVEL to disable.", $callback); return; } else { - return ([ 1, "This openbmc related function is unsupported and disabled. To bypass, run the following: \n\texport XCAT_OPENBMC_DEVEL=YES" ]); + return ([ 1, "This openbmc related function is not yet supported. Please contact xCAT development team." ]); } } @@ -382,24 +381,16 @@ sub parse_args { my $subcommand = $ARGV[0]; if ($command eq "rpower") { - # - # disable function until fully tested - # - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "rinv") { - # - # disable function until fully tested - # - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "getopenbmccons") { - #command for openbmc rcons + # command for openbmc rcons } elsif ($command eq "rsetboot") { # # disable function until fully tested @@ -754,7 +745,7 @@ sub deal_with_response { if ($response->status_line ne $::RESPONSE_OK) { my $error; if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) { - $error = "Service Unavailable"; + $error = $::RESPONSE_SERVICE_UNAVAILABLE; } else { my $response_info = decode_json $response->content; if ($response->status_line eq $::RESPONSE_SERVER_ERROR) { From 7e2458d7de7fed435b8ec70f6f3264b473bc4f47 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 May 2017 16:39:16 -0400 Subject: [PATCH 045/201] Spelling fixes for docs/sources/advanced rst files --- .../compute_node/changing_hostname_ip.rst | 2 +- .../domain_name_resolution.rst | 2 +- .../advanced/gpu/nvidia/osimage/index.rst | 2 +- .../hamn/high_available_management_node.rst | 4 +- ...mgmt_node_with_drbd_pacemaker_corosync.rst | 20 +-- .../setup_ha_mgmt_node_with_shared_data.rst | 10 +- .../appendix/appendix_b_diagnostics.rst | 2 +- .../databases/postgres_configure.rst | 2 +- .../hierarchy/define_service_node.rst | 2 +- .../advanced/kit/custom/build/createkit.rst | 2 +- .../advanced/kit/custom/introduction.rst | 4 +- .../advanced/kit/custom/using/addkitcomp.rst | 4 +- docs/source/advanced/kit/hpc/quickstart.rst | 4 +- .../building_stateless_images.rst | 2 +- .../networks/infiniband/firmware_updates.rst | 2 +- .../infiniband/mlnxofed_ib_install_v2.rst | 2 +- .../mlnxofed_ib_install_v2_diskful.rst | 4 +- .../mlnxofed_ib_install_v2_diskless.rst | 4 +- .../mlnxofed_ib_install_v2_preparation.rst | 2 +- .../mlnxofed_ib_verified_scenario_matrix.rst | 2 +- .../infiniband/switch_configuration.rst | 2 +- .../onie_switches/os_cumulus/install.rst | 4 +- .../switch_based_switch_discovery.rst | 2 +- docs/source/advanced/networks/vlan/vlan.rst | 4 +- docs/source/advanced/probe/osdeploy.rst | 2 +- docs/source/advanced/raid/hardware_raid.rst | 2 +- .../restapi_resource/restapi_reference.rst | 144 +++++++++--------- docs/source/advanced/sysclone/sysclone.rst | 2 +- docs/source/advanced/zones/overview.rst | 2 +- 29 files changed, 121 insertions(+), 121 deletions(-) diff --git a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst index 544f577cd..10b7a69c1 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst @@ -25,7 +25,7 @@ Remove Old Provision Environment Change Definition ----------------- -#. Change netwoks table definitions :: +#. Change networks table definitions :: lsdef -t network -l diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index 984bf79fe..7311f53ae 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -480,6 +480,6 @@ Sample table contents: :: Limited support for user application networks --------------------------------------------- -In some cases you may have additional user application networks in your site that are not specifically used for cluster management.If desired you can create xCAT network definitions for these networks.This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes.When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. +In some cases you may have additional user application networks in your site that are not specifically used for cluster management. If desired you can create xCAT network definitions for these networks. This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes. When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. For example, when you run ``makedhcp -n`` it will list all domains defined in the xCAT **"site"** definition and xCAT **"network"** definitions in the **"option domain-search"** entry of the shared-network stanza in the dhcp configuration file. This will cause dhcp to put these domains in the compute nodes' **/etc/resolv.conf** file every time it gets a dhcp lease. diff --git a/docs/source/advanced/gpu/nvidia/osimage/index.rst b/docs/source/advanced/gpu/nvidia/osimage/index.rst index 04d4af107..70a2aff30 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/index.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/index.rst @@ -1,7 +1,7 @@ Create osimage definitions ========================== -Generate ``osimage`` definitions to provison the compute nodes with the NVIDIA CUDA toolkit installed. +Generate ``osimage`` definitions to provision the compute nodes with the NVIDIA CUDA toolkit installed. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/hamn/high_available_management_node.rst b/docs/source/advanced/hamn/high_available_management_node.rst index da94390ae..ebd78cf57 100644 --- a/docs/source/advanced/hamn/high_available_management_node.rst +++ b/docs/source/advanced/hamn/high_available_management_node.rst @@ -13,7 +13,7 @@ The data synchronization is important for any high availability configuration. W * The configuration files for the services that are required by xCAT, like named, DHCP, apache, nfs, ssh, etc. * The operating systems images repository and users customization data repository, the ``/install`` directory contains these repositories in most cases. -There are a lot of ways for data synchronization, but considering the specific xCAT HAMN requirements, only several of the data synchronziation options are practical for xCAT HAMN. +There are a lot of ways for data synchronization, but considering the specific xCAT HAMN requirements, only several of the data synchronization options are practical for xCAT HAMN. **1\. Move physical disks between the two management nodes**: if we could physically move the hard disks from the failed management node to the backup management node, and bring up the backup management node, then both the operating system and xCAT data will be identical between the new management node and the failed management node. RAID1 or disk mirroring could be used to avoid the disk be a single point of failure. @@ -40,7 +40,7 @@ The configuration for the high availability applications is usually complex, it **3\. Maintenance effort** -The automatic failover brings in several high availability applications, after the initial configuration is done, additional maintenance effort will be needed. For example, taking care of the high availability applications during cluster update, the updates for the high availability applications themselves, trouble shooting any problems with the high availability applications. A simple question may be able to help you to decide: could you get technical support if some of the high availability applications run into problems? All software has bugs. +The automatic failover brings in several high availability applications, after the initial configuration is done, additional maintenance effort will be needed. For example, taking care of the high availability applications during cluster update, the updates for the high availability applications themselves, troubleshooting any problems with the high availability applications. A simple question may be able to help you to decide: could you get technical support if some of the high availability applications run into problems? All software has bugs. Configuration Options ===================== diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst index 766580dad..91f9c6cd9 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst @@ -31,7 +31,7 @@ Configuration Requirements #. Since the management node needs to provide IP services through broadcast such as DHCP to the compute nodes, the primary management node and standby management node should be in the same subnet to ensure the network services will work correctly after failover. -#. Network connections between the two management nodes: there are several networks defined in the general cluster configuration strucutre, like cluster network, management network and service network; the two management nodes should be in all of these networks(if exist at all). Besides that, it is recommended, though not strictly required, to use a direct, back-to-back, Gigabit Ethernet or higher bandwidth connection for the DRBD, Pacemaker and Corosync communication between the two management nodes. If the connection is run over switches, use of redundant components and the bonding driver (in active-backup mode) is recommended. +#. Network connections between the two management nodes: there are several networks defined in the general cluster configuration structure, like cluster network, management network and service network; the two management nodes should be in all of these networks(if exist at all). Besides that, it is recommended, though not strictly required, to use a direct, back-to-back, Gigabit Ethernet or higher bandwidth connection for the DRBD, Pacemaker and Corosync communication between the two management nodes. If the connection is run over switches, use of redundant components and the bonding driver (in active-backup mode) is recommended. ``Note``: A crossover Ethernet cable is required to setup the direct, back-to-back, Ethernet connection between the two management nodes, but with most of the current hardware, a normal Ethernet cable can also work, the Ethernet adapters will internally handle the crossover bit. Hard disk for DRBD: DRBD device can be setup on a partition of the disk that the operating system runs on, but it is recommended to use a separate standalone disk or RAID/Multipath disk for DRBD configuration. @@ -63,7 +63,7 @@ You have several options to get the RPM packages for ``DRBD``, ``drbdlinks``, `` #. Compile from source code: if none of the options work for some specific applications, you will have to compile RPMs from the source code. You can compile these packages on one of the management node or on a separate build machine with the same arch and operating system with the management nodes. Here are the instructions for compiling the RPM packages from source code: -Before compiling the RPM packages, you need to install some compling tools like gcc, make, glibc, rpm-build. :: +Before compiling the RPM packages, you need to install some compiling tools like gcc, make, glibc, rpm-build. :: yum groupinstall "Development tools" yum install libxslt libxslt-devel @@ -402,13 +402,13 @@ Configure DRBD [>....................] sync'ed: 0.5% (101932/102400)M finish: 2:29:06 speed: 11,644 (11,444) K/sec - If a direct, back-to-back Gigabyte Ethernet connection is setup between the two management nodes and you are unhappy with the syncronization speed, it is possible to speed up the initial synchronization through some tunable parameters in DRBD. This setting is not permanent, and will not be retained after boot. For details, see http://www.drbd.org/users-guide-emb/s-configure-sync-rate.html. :: + If a direct, back-to-back Gigabyte Ethernet connection is setup between the two management nodes and you are unhappy with the synchronization speed, it is possible to speed up the initial synchronization through some tunable parameters in DRBD. This setting is not permanent, and will not be retained after boot. For details, see http://www.drbd.org/users-guide-emb/s-configure-sync-rate.html. :: drbdadm disk-options --resync-rate=110M xCAT #. Create file system on DRBD device and mount the file system - Even while the DRBD sync is taking place, you can go ahead and create a filesystem on the DRBD device, but it is recommended to wait for the inital full synchronization is finished before creating the file system. + Even while the DRBD sync is taking place, you can go ahead and create a filesystem on the DRBD device, but it is recommended to wait for the initial full synchronization is finished before creating the file system. After the initial full synchronization is finished, you can take the DRBD device as a normal disk partition to create file system and mount it to some directory. The DRDB device name is set in the ``/etc/drbd.d/xcat.res`` created in the previous step. In this doc, the DRBD device name is ``/dev/drbd1``. :: @@ -964,7 +964,7 @@ At this point, the HA MN Setup is complete, and customer workloads and system ad Failover ======== -There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintainance activities; the unplanned failover covers the unexpected hardware or software failures. +There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintenance activities; the unplanned failover covers the unexpected hardware or software failures. In a planned failover, you can do necessary cleanup work on the previous primary management node before failover to the previous standby management node. In a unplanned failover, the previous management node probably is not functioning at all, you can simply shutdown the system. @@ -1009,7 +1009,7 @@ To avoid this, run the following command to set the autostart for the corosync s Backup working Pacemaker configuration (Optional) ================================================= -It is a good practice to backup the working ``pacemaker`` configuration, the backup could be in both plain text format or XML format, the plain text is more easily editable and can be modified and used chunk by chunk, the xml can be used to do a full replacement restore. It will be very useful to make such a backup everytime before you make a change. +It is a good practice to backup the working ``pacemaker`` configuration, the backup could be in both plain text format or XML format, the plain text is more easily editable and can be modified and used chunk by chunk, the xml can be used to do a full replacement restore. It will be very useful to make such a backup every time before you make a change. To backup in the plain text format, run the following command: :: @@ -1182,7 +1182,7 @@ Trouble shooting and debug tips Disable HA MN ============= -For whatever reason, the user might want to disable HA MN, here is the procedur of disabling HA MN: +For whatever reason, the user might want to disable HA MN, here is the procedure of disabling HA MN: * Shut down standby management node @@ -1245,7 +1245,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster push cib xcat_cfg -We then need to make sure that the ``/xCATdrbd/etc/drbdlinks.xCAT.conf`` file has the systemimager portion uncommented, and re-do the initialisation of drbdlinks as they have been done earlier in the documentation +We then need to make sure that the ``/xCATdrbd/etc/drbdlinks.xCAT.conf`` file has the systemimager portion uncommented, and re-do the initialization of drbdlinks as they have been done earlier in the documentation Appendix A ========== @@ -1428,7 +1428,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster cib-push xcat_cfg -Once the changes have been commited, we can view the config, by running the command below: :: +Once the changes have been committed, we can view the config, by running the command below: :: pcs config @@ -1640,7 +1640,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster cib-push xcat_cfg -Once the changes have been commited, we can view the config, by running the command below: :: +Once the changes have been committed, we can view the config, by running the command below: :: pcs config diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst index 6a3e1b98a..3eff968e6 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst @@ -18,9 +18,9 @@ The nfs service on the primary management node or the primary management node it What is Shared Data ==================== -The term ``Shared Data`` means that the two management nodes use a single copy of xCAT data, no matter which management node is the primary MN, the cluster management capability is running on top of the single data copy. The acess to the data could be done through various ways like shared storage, NAS, NFS, samba etc. Based on the protocol being used, the data might be accessable only on one management node at a time or be accessable on both management nodes in parellel. If the data could only be accessed from one management node, the failover process need to take care of the data access transition; if the data could be accessed on both management nodes, the failover does not need to consider the data access transition, it usually means the failover process could be faster. +The term ``Shared Data`` means that the two management nodes use a single copy of xCAT data, no matter which management node is the primary MN, the cluster management capability is running on top of the single data copy. The access to the data could be done through various ways like shared storage, NAS, NFS, samba etc. Based on the protocol being used, the data might be accessible only on one management node at a time or be accessible on both management nodes in parallel. If the data could only be accessed from one management node, the failover process need to take care of the data access transition; if the data could be accessed on both management nodes, the failover does not need to consider the data access transition, it usually means the failover process could be faster. -``Warning``: Running database through network file system has a lot of potential problems and is not practical, however, most of the database system provides database replication feature that can be used to synronize the database between the two management nodes +``Warning``: Running database through network file system has a lot of potential problems and is not practical, however, most of the database system provides database replication feature that can be used to synchronize the database between the two management nodes Configuration Requirements ========================== @@ -248,7 +248,7 @@ Besides the files mentioned above, there may be some additional customization fi ``Note``: If the IBM HPC software stack is configured in your environment, execute additional steps required to copy additional data or configuration files for HAMN setup. -The dhcpsd.cnf should be syncronized between the primary management node and standby management node only when the DHCP configuration on the two management nodes are exactly the same. +The dhcpsd.cnf should be synchronized between the primary management node and standby management node only when the DHCP configuration on the two management nodes are exactly the same. Cluster Maintenance Considerations ================================== @@ -268,7 +268,7 @@ At this point, the HA MN Setup is complete, and customer workloads and system ad Failover ======== -There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintainance activities; the unplanned failover covers the unexpected hardware or software failures. +There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintenance activities; the unplanned failover covers the unexpected hardware or software failures. In a planned failover, you can do necessary cleanup work on the previous primary management node before failover to the previous standby management node. In a unplanned failover, the previous management node probably is not functioning at all, you can simply shutdown the system. @@ -367,7 +367,7 @@ On the new primary management node: **DNS**: run ``makedns``. Verify dns services working for node resolution. Make sure the line ``nameserver=`` is in ``/etc/resolv.conf``. - **DHCP**: if the dhcpd.leases is not syncronized between the primary management node and standby management node, run ``makedhcp -a`` to setup the DHCP leases. Verify dhcp is operational. + **DHCP**: if the dhcpd.leases is not synchronized between the primary management node and standby management node, run ``makedhcp -a`` to setup the DHCP leases. Verify dhcp is operational. **conserver**: run makeconservercf. This will recreate the ``/etc/conserver.cf`` config files for all the nodes. diff --git a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst index d30fc59db..768395548 100644 --- a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst +++ b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst @@ -15,4 +15,4 @@ Appendix B: Diagnostics * **Errors running hierarchical commands such as xdsh** -- xCAT has a number of commands that run hierarchically. That is, the commands are sent from xcatd on the management node to the correct service node xcatd, which in turn processes the command and sends the results back to xcatd on the management node. If a hierarchical command such as xcatd fails with something like "Error: Permission denied for request", check ``/var/log/messages`` on the management node for errors. One error might be "Request matched no policy rule". This may mean you will need to add policy table entries for your xCAT management node and service node. -* **/install is not mounted on service node from managemen mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` +* **/install is not mounted on service node from management mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` diff --git a/docs/source/advanced/hierarchy/databases/postgres_configure.rst b/docs/source/advanced/hierarchy/databases/postgres_configure.rst index 52db88e00..039b6c001 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_configure.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_configure.rst @@ -33,4 +33,4 @@ Restart PostgreSQL after editing the file: :: For more information about changing the ``pg_hab.conf`` file and ``postgresql.conf`` files, see the following documentation: -`Setup the PostgreSQL Configuraion Files `_ +`Setup the PostgreSQL Configuration Files `_ diff --git a/docs/source/advanced/hierarchy/define_service_node.rst b/docs/source/advanced/hierarchy/define_service_node.rst index dba32462c..6c5b5b3ef 100644 --- a/docs/source/advanced/hierarchy/define_service_node.rst +++ b/docs/source/advanced/hierarchy/define_service_node.rst @@ -179,7 +179,7 @@ compute node is rebooted or the compute node is explicitly moved to another SN using the `snmove `_ command. To use Service Node pools, you need to architect your network such that all of -the compute nodes and service nodes in a partcular pool are on the same flat +the compute nodes and service nodes in a particular pool are on the same flat network. If you don't want the management node to respond to manage some of the compute nodes, it shouldn't be on that same flat network. The site, dhcpinterfaces attribute should be set such that the SNs' DHCP daemon diff --git a/docs/source/advanced/kit/custom/build/createkit.rst b/docs/source/advanced/kit/custom/build/createkit.rst index 4061fbef4..fbb0e6118 100644 --- a/docs/source/advanced/kit/custom/build/createkit.rst +++ b/docs/source/advanced/kit/custom/build/createkit.rst @@ -112,7 +112,7 @@ minor version can be support following format: :: **kitpackage** --- This stanza defines Kit Package (ie. RPM). There can be zero or more kitpackage stanzas. For multiple package supports, need to #. Define one kitpackage section per supported OS. or - #. Define one kitpacakge stanza which contains multiple kitrepoid lines. For the RPM packages, users need to responsible for createing an RPM spec file that can run on multiple OSes. + #. Define one kitpacakge stanza which contains multiple kitrepoid lines. For the RPM packages, users need to responsible for creating an RPM spec file that can run on multiple OSes. :: diff --git a/docs/source/advanced/kit/custom/introduction.rst b/docs/source/advanced/kit/custom/introduction.rst index 4c847687e..febb1dbde 100644 --- a/docs/source/advanced/kit/custom/introduction.rst +++ b/docs/source/advanced/kit/custom/introduction.rst @@ -49,7 +49,7 @@ Kit Framework With time, the implementation of the xCAT Software Kit support may change. -In order to process a kit successfully, the kit must be conpatiable with the level of xCAT code that was used to build the kit. The xCAT kit commands and software kits contain the framework version and compatiable supported versions. +In order to process a kit successfully, the kit must be compatible with the level of xCAT code that was used to build the kit. The xCAT kit commands and software kits contain the framework version and compatible supported versions. To view the framework version, use the ``-v | --version`` option on :doc:`addkit ` :: @@ -59,7 +59,7 @@ To view the framework version, use the ``-v | --version`` option on :doc:`addkit compatible_frameworks = 0,1,2 -If the commands in the xCAT installation is not compatiable with the Software Kit obtained, update xCAT to a more recent release. +If the commands in the xCAT installation is not compatible with the Software Kit obtained, update xCAT to a more recent release. .. [#] PCM is IBM Platform Cluster Manager diff --git a/docs/source/advanced/kit/custom/using/addkitcomp.rst b/docs/source/advanced/kit/custom/using/addkitcomp.rst index f716770b8..0c396cf4b 100644 --- a/docs/source/advanced/kit/custom/using/addkitcomp.rst +++ b/docs/source/advanced/kit/custom/using/addkitcomp.rst @@ -14,7 +14,7 @@ To check if a kitcomponent is valid for an existing OS image definition run the chkkitcomp -i -If the kit component is compatible then add the kitcomponent to the OS image defintion using the addkitcomp command. :: +If the kit component is compatible then add the kitcomponent to the OS image definition using the addkitcomp command. :: addkitcomp -a -i @@ -34,7 +34,7 @@ The contents of the kit component may be listed by using the lskitcomponent comm Adding Multiple Versions of the Same Kit Component to an OS Image Definition ````````````````````````````````````````````````````````````````````````````` -xCAT allows to have multiple versions/releases of a product software kit available in the cluster. Typically, different OS image definitions corresponding to the different versions/releases of a product software stack. However, in some instances, may need mulitple versions/releases of the same product available within a single OS image. This is only feasible if the software product supports the install of multiple versions or releases of its product within an OS image. +xCAT allows to have multiple versions/releases of a product software kit available in the cluster. Typically, different OS image definitions corresponding to the different versions/releases of a product software stack. However, in some instances, may need multiple versions/releases of the same product available within a single OS image. This is only feasible if the software product supports the install of multiple versions or releases of its product within an OS image. Currently, it is not possible to install multiple versions of a product into an OS image using xCAT commands. xCAT uses yum on RedHat and zypper on SLES to install product rpms. These package managers do not provide an interface to install different versions of the same package, and will always force an upgrade of the package. We are investigating different ways to accomplish this function for future xCAT releases. diff --git a/docs/source/advanced/kit/hpc/quickstart.rst b/docs/source/advanced/kit/hpc/quickstart.rst index d76814907..74b8d83e4 100644 --- a/docs/source/advanced/kit/hpc/quickstart.rst +++ b/docs/source/advanced/kit/hpc/quickstart.rst @@ -77,7 +77,7 @@ The following software kits will be used to install the IBM HPC software stack o The ESSL software kit has an *external dependency* to the ``libxlf`` which is provided in the XLF software kit. Since it's already added in the above step, there is no action needed here. - If CUDA toolkit is being used, ESSL has a runtime dependency on the CUDA rpms. The adminstrator needs to create the repository for the CUDA 7.5 toolkit or a runtime error will occur when provisioning the node. See the :doc:`/advanced/gpu/nvidia/repo/index` section for more details about setting up the CUDA repository on the xCAT management node. :: + If CUDA toolkit is being used, ESSL has a runtime dependency on the CUDA rpms. The administrator needs to create the repository for the CUDA 7.5 toolkit or a runtime error will occur when provisioning the node. See the :doc:`/advanced/gpu/nvidia/repo/index` section for more details about setting up the CUDA repository on the xCAT management node. :: # # Assuming that the cuda repo has been configured at: @@ -101,7 +101,7 @@ The following software kits will be used to install the IBM HPC software stack o addkitcomp -a -i rhels7.2-ppc64le-install-compute \ essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le - If the system doesn't have GPU and the CUDA toolkit is not needed, the adminstrator should not add the following kit components that requires the CUDA packages: ``essl-loginnode-5.4.0-0-rhels-7.2-ppc64le``, ``essl-computenode-3264rte-5.4.0-0-rhels-7.2-ppc64le`` and ``essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le``. Check the ESSL installation guide: http://www.ibm.com/support/knowledgecenter/SSFHY8_5.4.0/com.ibm.cluster.essl.v5r4.essl300.doc/am5il_xcatinstall.htm + If the system doesn't have GPU and the CUDA toolkit is not needed, the administrator should not add the following kit components that requires the CUDA packages: ``essl-loginnode-5.4.0-0-rhels-7.2-ppc64le``, ``essl-computenode-3264rte-5.4.0-0-rhels-7.2-ppc64le`` and ``essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le``. Check the ESSL installation guide: http://www.ibm.com/support/knowledgecenter/SSFHY8_5.4.0/com.ibm.cluster.essl.v5r4.essl300.doc/am5il_xcatinstall.htm #. Add the **Parallel ESSL** kitcomponents to osimage. diff --git a/docs/source/advanced/mixed_cluster/building_stateless_images.rst b/docs/source/advanced/mixed_cluster/building_stateless_images.rst index 7d1145095..4c9f9a344 100644 --- a/docs/source/advanced/mixed_cluster/building_stateless_images.rst +++ b/docs/source/advanced/mixed_cluster/building_stateless_images.rst @@ -1,7 +1,7 @@ Building Stateless/Diskless Images ================================== -A **stateless**, or **diskless**, provisioned nodes is one where the operating system image is deployed and loaded into memory. The Operating System (OS) does not store its files directly onto persistent storage (i.e hard disk drive, shared drive, usb, etc) and so subsequent rebooting of the machine results in loss of any state changes that happened while the machine was running. +A **stateless**, or **diskless**, provisioned nodes is one where the operating system image is deployed and loaded into memory. The Operating System (OS) does not store its files directly onto persistent storage (i.e. hard disk drive, shared drive, usb, etc) and so subsequent rebooting of the machine results in loss of any state changes that happened while the machine was running. To deploy stateless compute nodes, you must first create a stateless image. The "netboot" osimages created from ``copycds`` in the **osimage** table are sample osimage definitions that can be used for deploying stateless nodes. diff --git a/docs/source/advanced/networks/infiniband/firmware_updates.rst b/docs/source/advanced/networks/infiniband/firmware_updates.rst index a963c3356..e3d5f6c59 100644 --- a/docs/source/advanced/networks/infiniband/firmware_updates.rst +++ b/docs/source/advanced/networks/infiniband/firmware_updates.rst @@ -21,7 +21,7 @@ Burn new firmware on each ibaX: :: mstflint -d 0002:01:00.0 -i b -Note: if this is a PureFlex MezzanineP adapater then you must select the correct image for each ibaX device. Note the difference in the firmware image at end of filename: _0.bin (iba0/iba2) & _1.bin (iba1/iba3) +Note: if this is a PureFlex MezzanineP adapter then you must select the correct image for each ibaX device. Note the difference in the firmware image at end of filename: _0.bin (iba0/iba2) & _1.bin (iba1/iba3) Verify download successful: :: diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst index 5658f2d1b..8a3a5a75c 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst @@ -1,7 +1,7 @@ Mellanox OFED Installation Script ================================= -Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provids a sample postscript: ``mlnxofed_ib_install.v2``. +Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install.v2``. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst index 610dd6384..96f263e4a 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst @@ -18,7 +18,7 @@ Diskful Installation chdef -t node -o \ -p postscripts="mlnxofed_ib_install -p /install//" - **[kernel mismatch issue]** The Mellanox OFED ISO is built againt a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: chdef -t node -o \ -p postscripts="mlnxofed_ib_install -p /install// \ @@ -42,4 +42,4 @@ Diskful Installation * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. + * Use the ``ibv_devinfo`` command to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst index 36af543e7..3af2cb177 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst @@ -28,7 +28,7 @@ Diskless Installation *Note: The $1 is a argument that is passed to the the postinstall script at runtime.* - **[kernel mismatch issue]** The Mellanox OFED ISO is built againt a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: /install/postscripts/mlnxofed_ib_install \ -p /install// -m --add-kernel-support -end- \ @@ -62,4 +62,4 @@ Diskless Installation * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. + * Use the ``ibv_devinfo`` command to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst index 929bdf674..48e40f8a2 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst @@ -22,7 +22,7 @@ The ``mlnxofed_ib_install.v2`` is a sample script intended to assist with the in # ensure the script has execute permission chmod +x /install/postscripts/mlnxofed_ib_install -#. Familarize the options available for the xCAT ``mlnxofed_ib_install`` script. +#. Familiarize the options available for the xCAT ``mlnxofed_ib_install`` script. +---------+------------------+----------------------------------------------------------+ | Option | Required | Description | diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst index fd9bfded6..9849d2091 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst @@ -1,7 +1,7 @@ MLNX_OFED Support Matrix ======================== -The following ISO images and attributs have been verified by the xCAT Team. +The following ISO images and attributes have been verified by the xCAT Team. **RedHat Enterprise Linux** diff --git a/docs/source/advanced/networks/infiniband/switch_configuration.rst b/docs/source/advanced/networks/infiniband/switch_configuration.rst index 58e50e0ad..ab6bdf5ae 100644 --- a/docs/source/advanced/networks/infiniband/switch_configuration.rst +++ b/docs/source/advanced/networks/infiniband/switch_configuration.rst @@ -66,7 +66,7 @@ Then run the following: :: Setup syslog on the Switch -------------------------- -Use the following command to consolidate the syslog to the Management Node or Service Nodes, where ip is the addess of the MN or SN as known by the switch. :: +Use the following command to consolidate the syslog to the Management Node or Service Nodes, where ip is the address of the MN or SN as known by the switch. :: rspconfig mswitch logdest= diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst index 8fa31ee71..e0d132dfb 100644 --- a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst @@ -12,7 +12,7 @@ xCAT provides support for detecting and installing the Cumulus Linux OS into ONI The mac address of the switch management port is required for xCAT to configure the DHCP information and send over the OS to install on the switch. - **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch defintion providing the mac address. :: + **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch definition providing the mac address. :: mkdef frame01sw1 --template onieswitch arch=armv71 \ ip=192.168.1.1 mac="aa:bb:cc:dd:ee:ff" @@ -32,7 +32,7 @@ xCAT provides support for detecting and installing the Cumulus Linux OS into ONI ip=192.168.4.1 switch=coresw1 switchport=4 ... - #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined swtiches above. :: + #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined switches above. :: switchdiscover --range diff --git a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst index d2b9df8b7..356132d7f 100644 --- a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst +++ b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst @@ -155,7 +155,7 @@ These two config files are located in the **/opt/xcat/share/xcat/scripts** direc Switch Status ~~~~~~~~~~~~~ -During the switch-based switch discovery process, there are four states displayed. User may only see **switch_configed** status on node definition if discovery process succefully finished. +During the switch-based switch discovery process, there are four states displayed. User may only see **switch_configed** status on node definition if discovery process successfully finished. **Matched** --- Discovered switch is matched to predefine switch, **otherinterfaces** attribute is updated to dhcp IP address, and mac address, **switch type** and **usercomment** also updated with vendor information for the predefined switch. diff --git a/docs/source/advanced/networks/vlan/vlan.rst b/docs/source/advanced/networks/vlan/vlan.rst index 0e3e3840c..813f2fc60 100644 --- a/docs/source/advanced/networks/vlan/vlan.rst +++ b/docs/source/advanced/networks/vlan/vlan.rst @@ -206,7 +206,7 @@ There is no need to specify -i flag for removing nodes from a vlan. Remove a VLAN ------------- -The **rmvlan** command removes the given vlan ID from the cluster. It removes the vlan id from all the swithces involved, deconfigures the nodes so that vlan adaptor (tag) will be remved, cleans up /etc/hosts, DNS and database tables for the given vlan. +The **rmvlan** command removes the given vlan ID from the cluster. It removes the vlan id from all the switches involved, deconfigures the nodes so that vlan adaptor (tag) will be removed, cleans up /etc/hosts, DNS and database tables for the given vlan. For example: :: @@ -215,7 +215,7 @@ For example: :: VLAN Security ------------- -To make the vlan more secure, the root guard and the bpdu guard are enabled for each ports within the vlan by **mkvlan** and **chvlan** commands. This way it guards the topology changes on the switch by the hackers who hack the STP. However, when the vlan is removed by the **rmvlan** and the **chvlan (-d)** commands, the root guard and the bpdu guard are not disabled because the code cannot tell if the guards were enabled by the admin or not. If you want to remove the gurads after the vlan is removed, you need to use the switch command line interface to do so. Refer to the documents for the switch command line interfaces for details. +To make the vlan more secure, the root guard and the bpdu guard are enabled for each ports within the vlan by **mkvlan** and **chvlan** commands. This way it guards the topology changes on the switch by the hackers who hack the STP. However, when the vlan is removed by the **rmvlan** and the **chvlan (-d)** commands, the root guard and the bpdu guard are not disabled because the code cannot tell if the guards were enabled by the admin or not. If you want to remove the guards after the vlan is removed, you need to use the switch command line interface to do so. Refer to the documents for the switch command line interfaces for details. Limitation ---------- diff --git a/docs/source/advanced/probe/osdeploy.rst b/docs/source/advanced/probe/osdeploy.rst index 546d33198..c9a36f2f1 100644 --- a/docs/source/advanced/probe/osdeploy.rst +++ b/docs/source/advanced/probe/osdeploy.rst @@ -76,7 +76,7 @@ When all the nodes complete provisioning, the probe will exit and display output All nodes provisioned successfully [ OK ] -If there is something wrong when provisioning, this probe will exit when timeout is reachedd or ``Ctrl+C`` is pressed by user. The maximum time can be set by using ``-t`` as below(default 30 minutes) :: +If there is something wrong when provisioning, this probe will exit when timeout is reached or ``Ctrl+C`` is pressed by user. The maximum time can be set by using ``-t`` as below(default 30 minutes) :: xcatprobe osdeploy -n cn1 -t 30 diff --git a/docs/source/advanced/raid/hardware_raid.rst b/docs/source/advanced/raid/hardware_raid.rst index d6e0f3c8e..915f2b241 100644 --- a/docs/source/advanced/raid/hardware_raid.rst +++ b/docs/source/advanced/raid/hardware_raid.rst @@ -18,7 +18,7 @@ Following sections show how to use ``diskdiscover`` and ``configraid``, we assum Discovering disk devices ------------------------ -Command ``diskdiscover`` scans disk devices, it can get the overview of disks and RAID arrays information from compute node; The outputs contain useful information for ``configraid`` to configure RAID arrays, user can get ``pci_id``, ``pci_slot_name``, ``disk names``, ``RAID arrays`` and other informations from the outputs. It should be ran in xcat genesis system. It can be executed without input parameter or with pci_id, pci_id includes PCI vendor and device ID. For example, power8 SAS adapter pci_id is ``1014:034a``, ``1014`` is vendor info, ``034a`` is PCI-E IPR SAS Adapter, more info about pci_id refer to ``http://pci-ids.ucw.cz/read/PC/1014/``. +Command ``diskdiscover`` scans disk devices, it can get the overview of disks and RAID arrays information from compute node; The outputs contain useful information for ``configraid`` to configure RAID arrays, user can get ``pci_id``, ``pci_slot_name``, ``disk names``, ``RAID arrays`` and other information from the outputs. It should be ran in xcat genesis system. It can be executed without input parameter or with pci_id, pci_id includes PCI vendor and device ID. For example, power8 SAS adapter pci_id is ``1014:034a``, ``1014`` is vendor info, ``034a`` is PCI-E IPR SAS Adapter, more info about pci_id refer to ``http://pci-ids.ucw.cz/read/PC/1014/``. Here are steps to use ``diskdiscover``: diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index 1953a18ba..e00105af5 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -15,7 +15,7 @@ POST - Create a token. **Example:** -Aquire a token for user 'root'. :: +Acquire a token for user 'root'. :: #curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}' @@ -62,8 +62,8 @@ Get all the node names from xCAT database. :: [URI:/nodes/{noderange}] - The node resource -------------------------------------------- -GET - Get all the attibutes for the node {noderange}. -````````````````````````````````````````````````````` +GET - Get all the attributes for the node {noderange}. +`````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes. @@ -75,7 +75,7 @@ Refer to the man page: :doc:`lsdef ` @@ -101,7 +101,7 @@ Refer to the man page: :doc:`chdef ` @@ -597,7 +597,7 @@ Get all the vitails attributes for the node1. :: [URI:/nodes/{noderange}/vitals/{temp|voltage|wattage|fanspeed|power|leds...}] - The specific vital attributes for the node {noderange} -------------------------------------------------------------------------------------------------------------------------------------- -GET - Get the specific vitals attibutes. +GET - Get the specific vitals attributes. ```````````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -628,7 +628,7 @@ Get the 'fanspeed' vitals attribute. :: [URI:/nodes/{noderange}/inventory] - The inventory attributes for the node {noderange} -------------------------------------------------------------------------------------- -GET - Get all the inventory attibutes. +GET - Get all the inventory attributes. `````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -659,7 +659,7 @@ Get all the inventory attributes for node1. :: [URI:/nodes/{noderange}/inventory/{pci|model...}] - The specific inventory attributes for the node {noderange} -------------------------------------------------------------------------------------------------------------- -GET - Get the specific inventory attibutes. +GET - Get the specific inventory attributes. ``````````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -714,7 +714,7 @@ Refer to the man page: :doc:`reventlog ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -947,7 +947,7 @@ Refer to the man page: :doc:`chvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example1:** @@ -982,7 +982,7 @@ Refer to the man page: :doc:`mkvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -1003,7 +1003,7 @@ Refer to the man page: :doc:`rmvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -1112,7 +1112,7 @@ Refer to the man page: :doc:`copycds ` @@ -1173,7 +1173,7 @@ Refer to the man page: :doc:`chdef ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example1:** @@ -1284,7 +1284,7 @@ Refer to the man page: :doc:`rmimage ` @@ -1385,7 +1385,7 @@ Refer to the man page: :doc:`chdef ` @@ -1648,7 +1648,7 @@ Refer to the man page: :doc:`lsdef ` @@ -1668,7 +1668,7 @@ Refer to the man page: :doc:`chdef Date: Mon, 22 May 2017 22:04:31 -0400 Subject: [PATCH 046/201] Move stop label from redhat_migration test case --- xCAT-test/autotest/testcase/migration/redhat_migration | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 0cd7f859c..245a087e8 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -101,8 +101,7 @@ end start:redhat_migration2 os:Linux description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file -stop:yes - +#stop:yes cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 From aeb2f4e5fabed5bdcb33ff8277877036865566c7 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 22 May 2017 22:27:16 -0400 Subject: [PATCH 047/201] Modify a typo for xcattest --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 600cb5d93..97b17825c 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -882,7 +882,7 @@ sub load_case { my @newvalidoslist = (); foreach my $validos (@validoslist) { if ($validos =~ /linux/i) { - push(@newvalidoslist, ("rhel", "sles", "ubnutu")); + push(@newvalidoslist, ("rhel", "sles", "ubuntu")); } else { push(@newvalidoslist, $validos); } From e2f2d67ba882d3fc505832fe3fb80f1599ffabf5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 22 May 2017 22:41:14 -0400 Subject: [PATCH 048/201] Check the failed nodes array before printing out the (#3110) error messages --- xCAT-server/lib/xcat/plugins/rinstall.pm | 32 +++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 6b5d70f7b..7857aaa21 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -364,9 +364,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'nodeset' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } @nodes = @successnodes; } @@ -430,9 +432,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rnetboot' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rnetboot' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } } else { @@ -493,9 +497,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rsetboot' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rsetboot' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } @nodes = @successnodes; } } @@ -549,9 +555,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rpower' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rpower' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } } } From bd60341cb68cff6464855cf66b5595cf30e00185 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 22 May 2017 22:45:18 -0400 Subject: [PATCH 049/201] Support ZTP process for Cumulus Switch (#3085) * Support ZTP process for Cumulus Switch * change name of onieztp to cumulusztp and add server ip --- xCAT-server/lib/xcat/plugins/dhcp.pm | 5 ++++ xCAT/postscripts/cumulusztp | 34 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 xCAT/postscripts/cumulusztp diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index e2ff8556a..301796b0a 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2271,6 +2271,7 @@ sub addnet6 push @netent, " option domain-search $domainstring;\n"; } } + my $nameservers = $netcfgs{$net}->{nameservers}; if ($nameservers and $nameservers =~ /:/) { @@ -2574,6 +2575,7 @@ sub addnet push @netent, " option interface-mtu $mtu;\n"; } + # add domain-search if not sles10 or rh5 my $osv = xCAT::Utils->osver(); unless (($osv =~ /^sle[sc]10/) || ($osv =~ /^rh.*5$/)) { @@ -2591,6 +2593,8 @@ sub addnet push @netent, " option domain-search $domainstring;\n"; } } + #for cumulus ZTP process + push @netent, " option cumulus-provision-url \"http://$tftp/install/postscripts/cumulusztp\";\n"; my $ddnserver = $nameservers; $ddnserver =~ s/,.*//; @@ -2928,6 +2932,7 @@ sub newconfig } push @dhcpconf, "option gpxe.no-pxedhcp 1;\n"; push @dhcpconf, "option www-server code 114 = string;\n"; + push @dhcpconf, "option cumulus-provision-url code 239 = text;\n"; push @dhcpconf, "\n"; push @dhcpconf, "omapi-port 7911;\n"; #Enable omapi... push @dhcpconf, "key xcat_key {\n"; diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp new file mode 100755 index 000000000..311cdfdf1 --- /dev/null +++ b/xCAT/postscripts/cumulusztp @@ -0,0 +1,34 @@ +#!/bin/bash +function error() { + echo -e "\e[0;33mERROR: The Zero Touch Provisioning script failed while running the command $BASH_COMMAND at line $BASH_LINENO.\e[0m" >&2 + exit 1 +} + +# Log all output from this script +exec >/var/log/autoprovision 2>&1 + +trap error ERR + +#Add Debian Repositories +echo "deb http://http.us.debian.org/debian jessie main" >> /etc/apt/sources.list +echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list + +#get ip address for server node +server_ip=`grep cumulus-provision-url /var/lib/dhcp/dhclient.eth0.leases | tail -1 | awk -F/ '{print $3}'` + +#push root ssh keys, config passwordless +echo "CumulusLinux!" | sudo -S mkdir -p /root/.ssh +echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /root/.ssh/authorized_keys http://$server_ip/install/postscripts/_ssh/authorized_keys + +#enable and config snmpd +echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /home/cumulus/enablesnmp http://$server_ip/install/postscripts/enablesnmp +sudo chmod +x /home/cumulus/enablesnmp +sudo /home/cumulus/enablesnmp + +#config base interface +echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /home/cumulus/configinterface http://$server_ip/install/postscripts/configinterface +sudo chmod +x /home/cumulus/configinterface +sudo /home/cumulus/configinterface + +# CUMULUS-AUTOPROVISIONING +exit 0 From 4515d197d903405678cf26e8d4d7e1b12c13b810 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 23 May 2017 02:34:15 -0400 Subject: [PATCH 050/201] Use LWP to send https request in bmcdiscover instead of curl command --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 25 +++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 4f6bce095..d0e58e533 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -29,6 +29,9 @@ use Data::Dumper; use File::Basename; use File::Path; use Cwd; +use LWP; +use HTTP::Cookies; +use HTTP::Response; use JSON; my $nmap_path; @@ -1040,14 +1043,20 @@ sub bmcdiscovery_openbmc{ my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); my $node_data = $ip; - my $cjar_file = "/tmp/cjar_$ip"; + my $brower = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, ); + my $cookie_jar = HTTP::Cookies->new(); + my $header = HTTP::Headers->new('Content-Type' => 'application/json'); + my $url = "https://$ip/login"; my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; - - my $output = `curl -c $cjar_file -k -X POST -H \"Content-Type: application/json\" -d '$data' https://$ip/login`; + $brower->cookie_jar($cookie_jar); + my $request = HTTP::Request->new( 'POST', $url, $header, $data ); + my $response = $brower->request($request); - if ($output =~ /\"status\": \"ok\"/) { - my $req_output = `curl -b $cjar_file -k https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard`; - my $response = decode_json $req_output; + if ($response->is_success) { + my $req_url = "https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard"; + my $get_req = HTTP::Request->new('GET', $req_url, $header); + my $req_output = $brower->request($get_req); + my $response = decode_json $req_output->content; my $mtm; my $serial; @@ -1080,10 +1089,8 @@ sub bmcdiscovery_openbmc{ $node =~ s/(.*)/\L$1/g; $node =~ s/[\s:\._]/-/g; } - - unlink $cjar_file; } else { - if ($output =~ /\"description\": \"Invalid username or password\"/) { + if ($response->content =~ /\"description\": \"Invalid username or password\"/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); } return; From 75cb09d112575c9cb5f56bcb49541d72665052c6 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 23 May 2017 03:41:30 -0400 Subject: [PATCH 051/201] modified depending on comments --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index d0e58e533..28e0d951d 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1049,13 +1049,14 @@ sub bmcdiscovery_openbmc{ my $url = "https://$ip/login"; my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; $brower->cookie_jar($cookie_jar); - my $request = HTTP::Request->new( 'POST', $url, $header, $data ); - my $response = $brower->request($request); + my $login_request = HTTP::Request->new( 'POST', $url, $header, $data ); + my $login_response = $brower->request($login_request); - if ($response->is_success) { + if ($login_response->is_success) { my $req_url = "https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard"; - my $get_req = HTTP::Request->new('GET', $req_url, $header); - my $req_output = $brower->request($get_req); + my $req = HTTP::Request->new('GET', $req_url, $header); + my $req_output = $brower->request($req); + return if ($req_output->is_error); my $response = decode_json $req_output->content; my $mtm; my $serial; @@ -1090,7 +1091,7 @@ sub bmcdiscovery_openbmc{ $node =~ s/[\s:\._]/-/g; } } else { - if ($response->content =~ /\"description\": \"Invalid username or password\"/) { + if ($login_response->status_line =~ /401 Unauthorized/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); } return; From 258cc7f13b11495dc9ef3fbfe1cf385d63de6764 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 23 May 2017 07:52:13 -0400 Subject: [PATCH 052/201] modify migration test for environment's servicenode need to clear --- .../testcase/migration/redhat_migration | 18 ++++++++++++++++-- .../testcase/migration/sles_migration | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 245a087e8..c2d43ff7b 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -2,7 +2,10 @@ start:redhat_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -96,13 +99,20 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end start:redhat_migration2 os:Linux description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file #stop:yes -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -196,5 +206,9 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a03bfc0d3..f20f56edb 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -1,8 +1,10 @@ start:sles_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file - -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -99,13 +101,20 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end start:sles_migration2 os:Linux description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -202,5 +211,9 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end From 21c955467a6d818277b88c743fcfd3d59325c690 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 24 May 2017 03:47:52 -0400 Subject: [PATCH 053/201] Fix automation bug: xcattest failed to load case depending on arch label --- xCAT-test/xcattest | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 97b17825c..7566e65d1 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -910,10 +910,59 @@ sub load_case { } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { next if $skip; $case_ref->[$i]->{arch} = $1; + + if ($run_case_flag) { + #To judge whether need to skip the current case + my $case_arch = $case_ref->[$i]->{arch}; + if($case_arch =~ /ppc/i && $case_arch !~ /le|el/i){ + $case_arch="ppc"; + }elsif($case_arch =~ /ppc/i && $case_arch =~ /le|el/i){ + $case_arch="ppc64le"; + }elsif($case_arch =~ /x86/i){ + $case_arch="x86"; + } + + my $env_arch = $config{var}{ARCH}; + if($env_arch =~ /ppc/i && $env_arch !~ /le|el/i){ + $env_arch="ppc"; + }elsif($env_arch =~ /ppc/i && $env_arch =~ /le|el/i){ + $env_arch="ppc64le"; + }elsif($env_arch =~ /x86/i){ + $env_arch="x86"; + } + + my $valid = 0; + if ($case_arch eq $env_arch) { + $valid = 1; + } + unless ($valid) { + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } $newcmdstart = 0; } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { next if $skip; $case_ref->[$i]->{hcp} = $1; + if ($run_case_flag) { + #To judge whether need to skip the current case + my $valid = 0; + if ($case_ref->[$i]->{hcp} =~ /$config{var}{HCP}/i) { + $valid = 1; + } + unless ($valid) { + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } $newcmdstart = 0; } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { next if $skip; From 79f4ae63fa000c5919f1a78eb148385928233975 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 24 May 2017 02:35:33 -0400 Subject: [PATCH 054/201] Close ssl verify for bmcdiscover on Ubuntu --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 9 ++++++++- xCAT-server/lib/xcat/plugins/openbmc.pm | 9 ++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 28e0d951d..36f086c74 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -982,6 +982,10 @@ sub bmcdiscovery_ipmi { } } + if ($mtm eq '' or $serial eq '') { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); + return; + } $node_data .= ",$mtm"; $node_data .= ",$serial"; @@ -1043,7 +1047,7 @@ sub bmcdiscovery_openbmc{ my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); my $node_data = $ip; - my $brower = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, ); + my $brower = LWP::UserAgent->new( ssl_opts => { SSL_verify_mode => 0x00, verify_hostname => 0 }, ); my $cookie_jar = HTTP::Cookies->new(); my $header = HTTP::Headers->new('Content-Type' => 'application/json'); my $url = "https://$ip/login"; @@ -1065,6 +1069,7 @@ sub bmcdiscovery_openbmc{ $mtm = $response->{data}->{Model}; $serial = $response->{data}->{SerialNumber}; } else { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); return; } @@ -1093,6 +1098,8 @@ sub bmcdiscovery_openbmc{ } else { if ($login_response->status_line =~ /401 Unauthorized/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); + } else { + xCAT::MsgUtils->message("W", { data => ["$login_response->status_line for $ip"] }, $::CALLBACK); } return; } diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7eb476757..9143f0b9d 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -360,7 +360,7 @@ sub process_request { } } - $callback->({ errorcode => $check }) if ($check); + $callback->({ errorcode => [$check] }) if ($check); return; } @@ -864,10 +864,9 @@ sub rpower_response { else { xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); } - } - else { - my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; - xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); + } else { + my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; + xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); } } From 1b1a5cc428bd0c8b5150efc3b29fe2373c81cf5c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 24 May 2017 07:33:02 -0400 Subject: [PATCH 055/201] modify and add testcase for rvitals for issue:3062 --- xCAT-test/autotest/testcase/rvitals/cases0 | 71 +++++++++++++++++++--- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 055317a88..a9ccc3a69 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -1,40 +1,97 @@ +start:rvitals_h +cmd:rvitals -h +check:rc==0 +check:output=~Usage: +check:output=~rvitals +end + +start:rvitals_v +cmd:rvitals -v +check:rc==0 +check:output=~Version +end + start:rvitals_temp cmd:rvitals $$CN temp check:rc==0 -check:output=~System Temperature +check:output=~System Temperature|Ambient Temp|temperature end + +start:rvitals_disktemp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN disktemp +check:rc==0 +check:output=~Ambient Temp +end + +start:rvitals_cputemp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN cputemp +check:rc==0 +check:output=~Ambient Temp +end + start:rvitals_voltage hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN voltage check:rc==0 -check:output=~Frame Voltages +check:output=~Frame Voltages|CPU VDD Volt|SysBrd end + start:rvitals_power cmd:rvitals $$CN power check:rc==0 -check:output=~Current Power Status:\s*(on|off) +check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) end + start:rvitals_state cmd:rvitals $$CN state check:rc==0 check:output=~System State: end + start:rvitals_lcds hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN lcds check:rc==0 check:output=~Current LCD end + start:rvitals_all cmd:rvitals $$CN all check:rc==0 -check:output=~System Temperature -check:output=~Frame Voltages -check:output=~Current Power Status:\s*(on|off) -check:output=~System State: +check:output=~System Temperature|Ambient Temp +check:output=~Frame Voltages|CPU VDD Volt|SysBrd +check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) +check:output=~ System State:|System Event:|NMI State +end + +start:rvitals_leds +cmd:rvitals $$CN leds +check:rc==0 +check:output=~LED +end + +start:rvitals_fanspeed +cmd:rvitals $$CN fanspeed +check:rc==0 +check:output=~Fan|Fan\s*\d:\s*\w+\s*RPM +end +start:rvitals_wattage +cmd:rvitals $$CN wattage +check:rc==0 +check:output=~12V Sense|AC Avg Power +check:output=~Mem Cache Power|MEM Avg Power end start:rvitals_noderange_err cmd:rvitals testnode check:rc!=0 check:output=~Error end +start:rvitals_errorcommand +cmd: rvitals $$CN errorcommand +check:rc!=0 +check:output=~Unrecognized rvitals arguments +end From d22b6c57a78b8ff184ca199dee8cfc89a3c98958 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 24 May 2017 07:39:19 -0400 Subject: [PATCH 056/201] delete cases1 and cases0 could cover cases1 --- xCAT-test/autotest/testcase/rvitals/cases1 | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 xCAT-test/autotest/testcase/rvitals/cases1 diff --git a/xCAT-test/autotest/testcase/rvitals/cases1 b/xCAT-test/autotest/testcase/rvitals/cases1 deleted file mode 100644 index 8a43aedb6..000000000 --- a/xCAT-test/autotest/testcase/rvitals/cases1 +++ /dev/null @@ -1,61 +0,0 @@ -start:rvitals_temp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN temp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_disktemp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN disktemp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_cputemp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN cputemp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_fanspeed -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN fanspeed -check:rc==0 -check:output=~Fan\s*\d:\s*\w+\s*RPM -end - -start:rvitals_voltage -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN voltage -check:rc==0 -check:output=~CPU VDD Volt -end - -start:rvitals_all -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN all -check:rc==0 -check:output=~Power Status -check:output=~Power Overload -check:output=~Power Interlock -check:output=~Power Fault -check:output=~Power Control Fault -check:output=~Power Restore Policy -check:output=~Ambient Temp -end - -start:rvitals_noderange_err -arch:ppc64le -hcp:ipmi -cmd:rvitals testnode -check:rc!=0 -check:output=~Error -end From 0588d4e060c11bb75d5a55c0e6db030088da6a6b Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 15:31:31 -0400 Subject: [PATCH 057/201] Add the units to the output that is being returned from the rvitals command to make the output more similar to existing OpenPower BMC based servers --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7eb476757..0a513e2d9 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -71,6 +71,18 @@ sub handled_commands { }; } +my $prefix = "xyz.openbmc_project"; + +my %sensor_units = ( + "$prefix.Sensor.Value.Unit.DegreesC" => "C", + "$prefix.Sensor.Value.Unit.RPMS" => "RPMS", + "$prefix.Sensor.Value.Unit.Volts" => "Volts", + "$prefix.Sensor.Value.Unit.Meters" => "Meters", + "$prefix.Sensor.Value.Unit.Amperes" => "Amps", + "$prefix.Sensor.Value.Unit.Watts" => "Watts", + "$prefix.Sensor.Value.Unit.Joules" => "Joules" +); + my $http_protocol="https"; my $openbmc_url = "/org/openbmc"; my $openbmc_project_url = "/xyz/openbmc_project"; @@ -1199,7 +1211,7 @@ sub rvitals_response { my $content_info; my $sensor_value; - print "$node DEBUG Processing command: rvitals $grep_string \n"; + print "$node: DEBUG Processing command: rvitals $grep_string \n"; print Dumper(%{$response_info->{data}}) . "\n"; foreach my $key_url (keys %{$response_info->{data}}) { @@ -1208,7 +1220,7 @@ sub rvitals_response { # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy # For now display xxx/yyy as a label my ($junk, $label) = split("/sensors/", $key_url); - $sensor_value = $label . " " . $content{Value}; + $sensor_value = $label . ": " . $content{Value} . " " . $sensor_units{ $content{Unit} }; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From 6e14f1ee08a1322af9d957624032f938d614e936 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 15:46:23 -0400 Subject: [PATCH 058/201] Incorporated the Scale into the calculation of the value returned from openbmc-rest, so the values make more sense to humans --- xCAT-server/lib/xcat/plugins/openbmc.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 0a513e2d9..d67cf7ca1 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1220,7 +1220,14 @@ sub rvitals_response { # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy # For now display xxx/yyy as a label my ($junk, $label) = split("/sensors/", $key_url); - $sensor_value = $label . ": " . $content{Value} . " " . $sensor_units{ $content{Unit} }; + # + # Calculate the value based on the scale + # + my $calc_value = $content{Value}; + if ( $content{Scale} != 0 ) { + $calc_value = ($content{Value} * (10 ** $content{Scale})); + } + $sensor_value = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From 74769080c8158b7e11f27fd96b1d624ffb3e9738 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 22:49:14 -0400 Subject: [PATCH 059/201] Based on the OpenBMC Sensor API, complete the development code for the supported options based on the possible values that are currently allowed to be returned. As more data is added, the code should be able to handle the printing of the data automatically --- .../references/man1/rvitals.1.rst | 17 ++++++++- perl-xCAT/xCAT/Usage.pm | 4 +- xCAT-client/pods/man1/rvitals.1.pod | 12 +++++- xCAT-server/lib/xcat/plugins/openbmc.pm | 37 ++++++++++++++++--- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index e6929cdfc..ca8af6688 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -56,20 +56,27 @@ BMC specific: \ **rvitals**\ \ *noderange*\ {\ **temp | voltage | wattage | fanspeed | power | leds | all**\ } -OpenPOWER server specific: +OpenPOWER (IPMI) specific: ========================== \ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | all**\ ] +OpenPOWER (OpenBMC) specific: +============================= + + +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | length | all**\ ] + + ******************* \ **Description**\ ******************* -\ **rvitals**\ retrieves hardware vital information from the on-board Service +\ **rvitals**\ Retrieves hardware vital information from the on-board Service Processor for a single or range of nodes and groups. @@ -133,6 +140,12 @@ Processor for a single or range of nodes and groups. +\ **length**\ + + Retrieves length related attributes. + + + \ **power**\ Retrieves power status. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 30ba4b701..200f59037 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -81,8 +81,10 @@ my %usage = ( rvitals noderange {temp|wattage|fanspeed|leds|summary|all} BMC specific: rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} - OpenPOWER server specific: + OpenPOWER (IPMI) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] + OpenPOWER (OpenBMC) specific: + rvitals noderange [temp|voltage|wattage|fanspeed|power|length|all] MIC specific: rvitals noderange {thermal|all}", "reventlog" => diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index 32ff2fb81..52bacd35e 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -26,13 +26,17 @@ B I {B|B|B|B|B|B I {B|B|B|B|B|B|B} -=head2 OpenPOWER server specific: +=head2 OpenPOWER (IPMI) specific: B I [B|B|B|B|B|B|B] +=head2 OpenPOWER (OpenBMC) specific: + +B I [B|B|B|B|B|B|B] + =head1 B -B retrieves hardware vital information from the on-board Service +B Retrieves hardware vital information from the on-board Service Processor for a single or range of nodes and groups. =head1 B @@ -75,6 +79,10 @@ Retrieves rack environmentals. Retrieves LEDs status. +=item B + +Retrieves length related attributes. + =item B Retrieves power status. diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d67cf7ca1..6e8273947 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -458,7 +458,7 @@ sub parse_args { } elsif ($command eq "rvitals") { $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^leds$|^all$/) { + unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^length$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } else { @@ -1216,17 +1216,42 @@ sub rvitals_response { foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; - print Dumper(%content) . "\n"; - # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy - # For now display xxx/yyy as a label - my ($junk, $label) = split("/sensors/", $key_url); + # - # Calculate the value based on the scale + # Skip over attributes that are not asked to be printed + # + if ($grep_string =~ "temp") { + unless ( $content{Unit} =~ "DegreesC") { next; } + } + if ($grep_string =~ "voltage") { + unless ( $content{Unit} =~ "Volts") { next; } + } + if ($grep_string =~ "wattage") { + unless ( $content{Unit} =~ "Watts") { next; } + } + if ($grep_string =~ "fanspeed") { + unless ( $content{Unit} =~ "RPMS") { next; } + } + if ($grep_string =~ "power") { + unless ( $content{Unit} =~ "Amperes" || $content{Unit} =~ "Joules" || $content{Unit} =~ "Watts" ) { next; } + } + if ($grep_string =~ "length") { + unless ( $content{Unit} =~ "Meters" ) { next; } + } + # + # $key_url is in the format: "/xyz/openbmc_project/sensors/xxx/yyy + # For now display xxx/yyy as a label + # + my ($junk, $label) = split("/sensors/", $key_url); + + # + # Calculate the adjusted value based on the scale attribute # my $calc_value = $content{Value}; if ( $content{Scale} != 0 ) { $calc_value = ($content{Value} * (10 ** $content{Scale})); } + $sensor_value = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From 2102c7d086f8390e2076de2d9731bc5ca4946fca Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 23:02:24 -0400 Subject: [PATCH 060/201] Expose the rvitals command as part of openbmc support --- xCAT-server/lib/xcat/plugins/openbmc.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d67cf7ca1..9848dc5eb 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -456,7 +456,6 @@ sub parse_args { } } } elsif ($command eq "rvitals") { - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^leds$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); From 7ff64b220f123506cf0628469950c2b2c4c0eddb Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 25 May 2017 01:14:16 -0400 Subject: [PATCH 061/201] Wrong mac address showing for switchdiscover command (#3131) --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 2 +- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 3e306e7fb..41350d242 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -1266,7 +1266,7 @@ sub get_mac_by_arp () } else { ($ip, $mac) = (undef, undef); } - if (@$IP[1] !~ $ip) { + if (@$IP[1] ne $ip) { ($ip, $mac) = (undef, undef); } else { last; diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ebc6cb61b..ca192c222 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -38,6 +38,7 @@ my %global_mac_identity = ( "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", "7c:fe:90" => "Mellanox IB switch", + "cc:37:ab" => "Edgecore Networks Switch", "8c:ea:1b" => "Edgecore Networks Switch" ); @@ -54,6 +55,8 @@ my %global_switch_type = ( mellanox => "Mellanox", MLNX => "Mellanox", MELLAN => "Mellanox", + Cumulus => "onie", + cumulus => "onie", Edgecore => "onie" ); From 886571042bb091cec1602430f6506ca4a25dc081 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 25 May 2017 06:12:46 -0400 Subject: [PATCH 062/201] modify and add testcase for rvitals for issue:3062 --- xCAT-test/autotest/testcase/rvitals/cases0 | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index a9ccc3a69..348c0caa3 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -1,4 +1,6 @@ start:rvitals_h +description:get rvitals's usage +Attribute: $$CN-The operation object of rvitals command cmd:rvitals -h check:rc==0 check:output=~Usage: @@ -6,18 +8,24 @@ check:output=~rvitals end start:rvitals_v +description:get rvitals's version +Attribute: $$CN-The operation object of rvitals command cmd:rvitals -v check:rc==0 check:output=~Version end start:rvitals_temp +description:Retrieves temperatures +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN temp check:rc==0 check:output=~System Temperature|Ambient Temp|temperature end start:rvitals_disktemp +description:Retrieves disk temperatures +Attribute: $$CN-The operation object of rvitals command arch:ppc64le hcp:ipmi cmd:rvitals $$CN disktemp @@ -26,6 +34,8 @@ check:output=~Ambient Temp end start:rvitals_cputemp +description:Retrieves cpu temperatures +Attribute: $$CN-The operation object of rvitals command arch:ppc64le hcp:ipmi cmd:rvitals $$CN cputemp @@ -34,6 +44,8 @@ check:output=~Ambient Temp end start:rvitals_voltage +description:Retrieves power supply and VRM voltage readings +Attribute: $$CN-The operation object of rvitals command hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN voltage check:rc==0 @@ -41,18 +53,24 @@ check:output=~Frame Voltages|CPU VDD Volt|SysBrd end start:rvitals_power +description:Retrieves power status +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN power check:rc==0 check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) end start:rvitals_state +description:Retrieves the system state. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN state check:rc==0 check:output=~System State: end start:rvitals_lcds +description:Retrieves LCDs status +Attribute: $$CN-The operation object of rvitals command hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN lcds check:rc==0 @@ -60,6 +78,8 @@ check:output=~Current LCD end start:rvitals_all +description:Retrieves all status +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN all check:rc==0 check:output=~System Temperature|Ambient Temp @@ -69,28 +89,36 @@ check:output=~ System State:|System Event:|NMI State end start:rvitals_leds +description:Retrieves leds status +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN leds check:rc==0 check:output=~LED end start:rvitals_fanspeed +description:Retrieves fan speeds. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN fanspeed check:rc==0 check:output=~Fan|Fan\s*\d:\s*\w+\s*RPM end start:rvitals_wattage +description:Retrieves wattage readings. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN wattage check:rc==0 check:output=~12V Sense|AC Avg Power check:output=~Mem Cache Power|MEM Avg Power end start:rvitals_noderange_err +description:using not defined node cmd:rvitals testnode check:rc!=0 check:output=~Error end start:rvitals_errorcommand +description:using wrong command cmd: rvitals $$CN errorcommand check:rc!=0 check:output=~Unrecognized rvitals arguments From 89bc7608f1b0ff38e15440b2b95bfa3f76bcab4e Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 25 May 2017 05:30:30 -0400 Subject: [PATCH 063/201] fix issue RHEL update caused boot failure due to selinux #2996 --- xCAT-server/lib/xcat/plugins/anaconda.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 0222362ba..5b61b8326 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -859,7 +859,7 @@ sub mknetboot } # turn off the selinux - if ($osver =~ m/fedora12/ || $osver =~ m/fedora13/) { + if ($osver =~ m/(fedora12|fedora13|rhels7)/) { $kcmdline .= " selinux=0 "; } From ecd05c6de44ea5e30b079322db13a3ce8e4e5820 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 26 May 2017 17:51:28 +0800 Subject: [PATCH 064/201] Using statefule image only now. --- xCAT-test/bin/xcatperftest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/bin/xcatperftest b/xCAT-test/bin/xcatperftest index 8795fb3a8..1ec36c963 100755 --- a/xCAT-test/bin/xcatperftest +++ b/xCAT-test/bin/xcatperftest @@ -198,7 +198,7 @@ getOSimage() if [ -z $PERF_OSIMAGE ]; then # covert it to an array - osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|awk '/compute/ {print $1}')) + osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|grep 'install'|awk '/compute/ {print $1}')) index=`expr $RANDOM % ${#osimage_array[@]} 2>/dev/null` echo ${osimage_array[$index]} else From 5413376a58f3c5e964b463306008792f5971f895 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 11:09:16 -0400 Subject: [PATCH 065/201] Sort the output of rvitals to arrange the types of sensor data together. Removing the node out of the label in order to allow the sort to happen on just the keywords For debug, just print the json instead of splitting to multiple lines --- xCAT-server/lib/xcat/plugins/openbmc.pm | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6e8273947..c827e4528 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1209,10 +1209,10 @@ sub rvitals_response { my $grep_string = $status_info{RVITALS_RESPONSE}{argv}; my $src; my $content_info; - my $sensor_value; + my @sorted_output; print "$node: DEBUG Processing command: rvitals $grep_string \n"; - print Dumper(%{$response_info->{data}}) . "\n"; + print Dumper(%{$response_info->{data}}); foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; @@ -1238,11 +1238,12 @@ sub rvitals_response { if ($grep_string =~ "length") { unless ( $content{Unit} =~ "Meters" ) { next; } } - # - # $key_url is in the format: "/xyz/openbmc_project/sensors/xxx/yyy - # For now display xxx/yyy as a label - # - my ($junk, $label) = split("/sensors/", $key_url); + + my $label = (split(/\//, $key_url))[ -1 ]; + + # replace underscore with space, uppercase the first letter + $label =~ s/_/ /g; + $label =~ s/\b(\w)/\U$1/g; # # Calculate the adjusted value based on the scale attribute @@ -1252,8 +1253,15 @@ sub rvitals_response { $calc_value = ($content{Value} * (10 ** $content{Scale})); } - $sensor_value = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; - xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); + $content_info = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; + push (@sorted_output, $content_info); #Save output in array + } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + # Sort the output, alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); } if ($next_status{ $node_info{$node}{cur_status} }) { From fda07616e5f8e2d081c558043084f2f5d2a33680 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 30 May 2017 13:26:36 -0400 Subject: [PATCH 066/201] Spelling fixes for docs/sources/developers and overview --- docs/source/developers/github/change_code.rst | 2 +- docs/source/developers/github/forks.rst | 2 +- docs/source/developers/github/pull_request.rst | 2 +- docs/source/developers/guides/code/builds.rst | 2 +- docs/source/developers/guides/docs/doc_guidelines.rst | 6 +++--- docs/source/overview/differentiators.rst | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/developers/github/change_code.rst b/docs/source/developers/github/change_code.rst index a9f2b9f20..4eb5b79cd 100644 --- a/docs/source/developers/github/change_code.rst +++ b/docs/source/developers/github/change_code.rst @@ -24,7 +24,7 @@ It may take days before your pull request is properly reviewed and you want to k Creating additional branches will allow you to work on different tasks/enhancements at the same time. You can easily manage your working changes between branches with ``git stash.``. -Commiting code and pushing to remote branch +Committing code and pushing to remote branch ------------------------------------------- Once your code is ready.... diff --git a/docs/source/developers/github/forks.rst b/docs/source/developers/github/forks.rst index fccb84e75..2807e4009 100644 --- a/docs/source/developers/github/forks.rst +++ b/docs/source/developers/github/forks.rst @@ -41,7 +41,7 @@ Configure an ``upstream`` repository $ git remote add upstream git@github.com:xcat2/xcat-core.git - View the configured reposotories: :: + View the configured repositories: :: $ git remote -v origin git@github.com:/xcat-core.git (fetch) diff --git a/docs/source/developers/github/pull_request.rst b/docs/source/developers/github/pull_request.rst index b5273cb26..80593db5e 100644 --- a/docs/source/developers/github/pull_request.rst +++ b/docs/source/developers/github/pull_request.rst @@ -65,7 +65,7 @@ During the reviewing of your pull request, another pull request may be merged wh $ git push origin -f -If all the conflicts are resolved, the pull request should automaically turn green again and is able to be merged automatically. +If all the conflicts are resolved, the pull request should automatically turn green again and is able to be merged automatically. Reviewing Pull Requests as a Maintainer --------------------------------------- diff --git a/docs/source/developers/guides/code/builds.rst b/docs/source/developers/guides/code/builds.rst index 7afb55b1b..28aba3d02 100644 --- a/docs/source/developers/guides/code/builds.rst +++ b/docs/source/developers/guides/code/builds.rst @@ -37,7 +37,7 @@ The following steps will help configure ``pod2rst`` and be able to generate the make make install - * **[as non-root]** Extrat and build the Perl module using PREFIX to specify a directory that you have write permission :: + * **[as non-root]** Extract and build the Perl module using PREFIX to specify a directory that you have write permission :: mkdir ~/perllib perl Makefile.PL PREFIX=~/perllib diff --git a/docs/source/developers/guides/docs/doc_guidelines.rst b/docs/source/developers/guides/docs/doc_guidelines.rst index 0a245fe01..4e13e7b1c 100644 --- a/docs/source/developers/guides/docs/doc_guidelines.rst +++ b/docs/source/developers/guides/docs/doc_guidelines.rst @@ -65,7 +65,7 @@ Enumerated List Include another file -------------------- -To add contents of a document file inside another file, use ``.. include::``. This is usefull when a common information needs to be displayed in multiple files, whithout the use of a hyperlink. +To add contents of a document file inside another file, use ``.. include::``. This is useful when a common information needs to be displayed in multiple files, without the use of a hyperlink. :: .. include:: config_common.rst @@ -76,14 +76,14 @@ To add contents of a document file inside another file, use ``.. include::``. Th Index file ---------- -Index.rst files contain the ``.. toctree::`` tag. Files listed under that tag will have links to them displayed in the left side navigation area. If a documentation file does not wish to be accessbile from the navigation area, do not list it under the ``.. toctree::``. +Index.rst files contain the ``.. toctree::`` tag. Files listed under that tag will have links to them displayed in the left side navigation area. If a documentation file does not wish to be accessible from the navigation area, do not list it under the ``.. toctree::``. ``Note:`` If a file is not listed under the ``.. toctree::`` it might generate a warning during the documentation build ``WARNING: document isn't included in any toctree``. To eliminate such warning, add the file to the ``exclude_patterns`` list in the ``docs/source/conf.py`` file. However, do not add a file to the ``exclude_patterns`` list if it contains a customized link target, such as ``.. _my_link_taget:``. This link target will not be visible to other files and a ``WARNING: undefined label:`` will be displayed during the documentation build. Hyperlinks -> Internal Links -> External Links ---------------------------------------------- -Add links to refer other web page is a very common way in writting document, it's very helpful to reduce the doc duplication and make docs easy to understand. Following are several ways to add a link in the xCAT documentation. +Add links to refer other web page is a very common way in writing document, it's very helpful to reduce the doc duplication and make docs easy to understand. Following are several ways to add a link in the xCAT documentation. * **Add an Internal Link to ``Customized Link Target``** diff --git a/docs/source/overview/differentiators.rst b/docs/source/overview/differentiators.rst index f84bf0a8a..eb015c76b 100644 --- a/docs/source/overview/differentiators.rst +++ b/docs/source/overview/differentiators.rst @@ -18,7 +18,7 @@ Differentiators IBM Power, IBM Power LE, x86_64 -* Support Multiple Virtulization Infrastructures +* Support Multiple Virtualization Infrastructures IBM PowerKVM, KVM, IBM zVM, ESXI, XEN From b8894ed38b7113da759e8bb9494ed4dab2c5e46e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 14:28:15 -0400 Subject: [PATCH 067/201] Following changes based on review comments * Modified to display altitude instead of length * Print an output message if there is no values returned from the BMC --- .../guides/admin-guides/references/man1/rvitals.1.rst | 6 +++--- perl-xCAT/xCAT/FSPvitals.pm | 1 - perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rvitals.1.pod | 6 +++--- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 ++++++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index ca8af6688..c6a84c704 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -67,7 +67,7 @@ OpenPOWER (OpenBMC) specific: ============================= -\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | length | all**\ ] +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | altitude | all**\ ] @@ -140,9 +140,9 @@ Processor for a single or range of nodes and groups. -\ **length**\ +\ **altitude**\ - Retrieves length related attributes. + Retrieves altitude related attributes. diff --git a/perl-xCAT/xCAT/FSPvitals.pm b/perl-xCAT/xCAT/FSPvitals.pm index 3f31bf31c..11915abd7 100644 --- a/perl-xCAT/xCAT/FSPvitals.pm +++ b/perl-xCAT/xCAT/FSPvitals.pm @@ -375,7 +375,6 @@ sub rackenv { push @result, [ $name, $td, $Rc ]; if (!exists($request->{verbose})) { - #if( $td =~ /^Rack altitude in meters/ ) { if ($td =~ /^BPA-B total output in watts/) { last; } diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 200f59037..742f7a9a1 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -84,7 +84,7 @@ my %usage = ( OpenPOWER (IPMI) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] OpenPOWER (OpenBMC) specific: - rvitals noderange [temp|voltage|wattage|fanspeed|power|length|all] + rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: rvitals noderange {thermal|all}", "reventlog" => diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index 52bacd35e..bb7fec138 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -32,7 +32,7 @@ B I [B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B] =head1 B @@ -79,9 +79,9 @@ Retrieves rack environmentals. Retrieves LEDs status. -=item B +=item B -Retrieves length related attributes. +Retrieves altitude related attributes. =item B diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index c827e4528..e896e9046 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -37,6 +37,8 @@ $::POWER_STATE_POWERING_ON="powering-on"; $::POWER_STATE_QUIESCED="quiesced"; $::POWER_STATE_RESET="reset"; +$::NO_ATTRIBUTES_RETURNED="No attributes returned from the BMC."; + sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { @@ -458,7 +460,7 @@ sub parse_args { } elsif ($command eq "rvitals") { $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^length$|^all$/) { + unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^altitude$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } else { @@ -1235,7 +1237,7 @@ sub rvitals_response { if ($grep_string =~ "power") { unless ( $content{Unit} =~ "Amperes" || $content{Unit} =~ "Joules" || $content{Unit} =~ "Watts" ) { next; } } - if ($grep_string =~ "length") { + if ($grep_string =~ "altitude") { unless ( $content{Unit} =~ "Meters" ) { next; } } @@ -1262,6 +1264,8 @@ sub rvitals_response { my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } if ($next_status{ $node_info{$node}{cur_status} }) { From af3a07a367b69bfa081bc861ce8af7701c496a47 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 10:57:48 -0400 Subject: [PATCH 068/201] Change the output of the rinv firm option to handle all possible return values from the API in a generic string. This allows for the code to support any string without additional effort to create custom messages --- xCAT-server/lib/xcat/plugins/openbmc.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 84d9226a6..a65b49f9f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -935,9 +935,17 @@ sub rinv_response { my %content = %{ ${ $response_info->{data} }{$key_url} }; if ($grep_string eq "firm") { + # This handles the data from the /xyz/openbmc_project/Software endpoint. + # + # Handle printing out all posssible Software values in a generic format: + # node: Software: () + # if (defined($content{Version}) and $content{Version}) { - my $firm_ver = "System Firmware Product Version: " . "$content{Version}"; - xCAT::SvrUtils::sendmsg("$firm_ver", $callback, $node); + # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. + my $purpose_value = (split(/\./, $content{Purpose}))[-1]; + my $activation_value = (split(/\./, $content{Activation}))[-1]; + my $software_str = "$purpose_value Software: $content{Version} (Activation=$activation_value)"; + xCAT::SvrUtils::sendmsg("$software_str", $callback, $node); next; } } From 6c6123ab84fe0029f1cbccda7a669df109e544e5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 14:17:16 -0400 Subject: [PATCH 069/201] Fix spacing in sub rinv_response() --- xCAT-server/lib/xcat/plugins/openbmc.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index a65b49f9f..e820ba2f5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -922,10 +922,10 @@ sub rinv_response { my $grep_string; if ($node_info{$node}{cur_status} eq "RINV_FIRM_RESPONSE") { - $grep_string = "firm"; - } else { - $grep_string = $status_info{RINV_RESPONSE}{argv}; - } + $grep_string = "firm"; + } else { + $grep_string = $status_info{RINV_RESPONSE}{argv}; + } my $src; my $content_info; @@ -1000,13 +1000,13 @@ sub rinv_response { push (@sorted_output, $node . ": ". $content_info); #Save output in array } } - } - # If sorted array has any contents, sort it and print it - if (scalar @sorted_output > 0) { - @sorted_output = sort @sorted_output; #Sort all output - my $result = join "\n", @sorted_output; #Join into a single string for easier display - xCAT::SvrUtils::sendmsg("$result", $callback); - } + } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + @sorted_output = sort @sorted_output; #Sort all output + my $result = join "\n", @sorted_output; #Join into a single string for easier display + xCAT::SvrUtils::sendmsg("$result", $callback); + } if ($next_status{ $node_info{$node}{cur_status} }) { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; From 03b7e1fb6b9ab90b1ad5d1bc8a91c545d84ead30 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 15:46:49 -0400 Subject: [PATCH 070/201] Check if the item is present on the server, if not, there's no reason to print out the data. Fixed the sorting to be alpha, then numeric. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 29 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index e820ba2f5..70f8b857e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -942,14 +942,27 @@ sub rinv_response { # if (defined($content{Version}) and $content{Version}) { # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. - my $purpose_value = (split(/\./, $content{Purpose}))[-1]; + my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; - my $software_str = "$purpose_value Software: $content{Version} (Activation=$activation_value)"; - xCAT::SvrUtils::sendmsg("$software_str", $callback, $node); + my $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; + xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); next; } } + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } + + # If the item is not found on the server, do not bother printing it out + if ($content{Present} eq 0) { next; } + + # + # Need to re-visit this code, commenting out for now... + # +=for comment if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); @@ -987,6 +1000,7 @@ sub rinv_response { xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); next; } +=cut if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { @@ -997,15 +1011,16 @@ sub rinv_response { foreach my $key (keys %content) { $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $node . ": ". $content_info); #Save output in array + push (@sorted_output, $content_info); #Save output in array } } } # If sorted array has any contents, sort it and print it if (scalar @sorted_output > 0) { - @sorted_output = sort @sorted_output; #Sort all output - my $result = join "\n", @sorted_output; #Join into a single string for easier display - xCAT::SvrUtils::sendmsg("$result", $callback); + # sort alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); } if ($next_status{ $node_info{$node}{cur_status} }) { From 9a457fe2d70fd7cb66b79306ad663235ef2db9ff Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 21:27:15 -0400 Subject: [PATCH 071/201] For now, let's continue printing out all the values --- xCAT-server/lib/xcat/plugins/openbmc.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 70f8b857e..1cb9af5d3 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -956,9 +956,6 @@ sub rinv_response { next; } - # If the item is not found on the server, do not bother printing it out - if ($content{Present} eq 0) { next; } - # # Need to re-visit this code, commenting out for now... # From 33371667cb3482b64a15260d5926adbb66d7dd5e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:42:23 -0400 Subject: [PATCH 072/201] Remove options that are not supported for rinv --- .../admin-guides/references/man1/rinv.1.rst | 18 +++++++++--------- perl-xCAT/xCAT/Usage.pm | 6 +++--- xCAT-client/pods/man1/rinv.1.pod | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index df454d284..3cc89c839 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -28,18 +28,18 @@ BMC/MPA specific: \ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ } -OpenPOWER (using ipmi) server specific: -======================================= +OpenPOWER (IPMI) server specific: +================================= \ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ] -OpenPOWER (using openbmc) server specific: -========================================== +OpenPOWER (OpenBMC) server specific: +==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | mprom | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: @@ -195,25 +195,25 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **mprom**\ - Retrieves mprom firmware level + Retrieves mprom firmware level. \ **deviceid**\ - Retrieves device identification. Usually device, manufacturing and product ids. + Retrieves device identification. Usually device, manufacturing and product IDs. \ **uuid**\ - Retrieves the universally unique identifier + Retrieves the universally unique identifier. \ **guid**\ - Retrieves the global unique identifier + Retrieves the global unique identifier . diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 742f7a9a1..ff3e3ca69 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -97,10 +97,10 @@ my %usage = ( rinv [-h|--help|-v|--version] BMC specific: rinv [mprom|deviceid|uuid|guid|vpd|dimm|all] - OpenPOWER (using ipmi) server specific: + OpenPOWER (IPMI) server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] - OpenPOWER (using openbmc) server specific: - rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|cpu|dimm|all] + OpenPOWER (OpenBMC) server specific: + rinv [model|serial|firm|cpu|dimm|all] MPA specific: rinv [firm|bios|diag|mprom|sprom|mparom|mac|mtm] PPC specific(with HMC): diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 3a5c92f29..b08b15279 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -10,13 +10,13 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B|B} -=head2 OpenPOWER (using ipmi) server specific: +=head2 OpenPOWER (IPMI) server specific: B I [B|B|B|B|B|B|B|B|B] -=head2 OpenPOWER (using openbmc) server specific: +=head2 OpenPOWER (OpenBMC) server specific: -B I [B|B|B|B|B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B] =head2 PPC (with HMC) specific: @@ -125,19 +125,19 @@ Diagnostics information of firmware. =item B -Retrieves mprom firmware level +Retrieves mprom firmware level. =item B -Retrieves device identification. Usually device, manufacturing and product ids. +Retrieves device identification. Usually device, manufacturing and product IDs. =item B -Retrieves the universally unique identifier +Retrieves the universally unique identifier. =item B -Retrieves the global unique identifier +Retrieves the global unique identifier . =item B From 09ae91a31ae4c4be5b89ca8657b94d5ad867af50 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:43:11 -0400 Subject: [PATCH 073/201] Generically support the options for OpenBMC and not look for specific fields to print --- xCAT-server/lib/xcat/plugins/openbmc.pm | 66 +++++-------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 1cb9af5d3..adb21c58e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -408,7 +408,7 @@ sub parse_args { } } elsif ($command eq "rinv") { $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) { + unless ($subcommand =~ /^model$|^serial$|^firm$|^cpu$|^dimm$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "getopenbmccons") { @@ -956,60 +956,20 @@ sub rinv_response { next; } - # - # Need to re-visit this code, commenting out for now... - # -=for comment - if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { - my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; - xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); - next if ($grep_string eq "model"); - } + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { + $src = "$1 $2"; + } else { + $src = basename $key_url; + } - if (($grep_string eq "vpd" or $grep_string eq "serial") and $key_url =~ /\/motherboard$/) { - my $serialnumber = "BOARD Serial Number: " . "$content{SerialNumber}"; - xCAT::SvrUtils::sendmsg("$serialnumber", $callback, $node); - next if ($grep_string eq "serial"); - } - - if (($grep_string eq "vpd" or $grep_string eq "mprom") and $key_url =~ /\/motherboard$/) { - xCAT::SvrUtils::sendmsg("No mprom information is available", $callback, $node); - next if ($grep_string eq "mprom"); - } - - if (($grep_string eq "vpd" or $grep_string eq "deviceid") and $key_url =~ /\/motherboard$/) { - xCAT::SvrUtils::sendmsg("No deviceid information is available", $callback, $node); - next if ($grep_string eq "deviceid"); - } - - if ($grep_string eq "uuid") { - xCAT::SvrUtils::sendmsg("No uuid information is available", $callback, $node); - last; - } - - if ($grep_string eq "guid") { - xCAT::SvrUtils::sendmsg("No guid information is available", $callback, $node); - last; - } - - if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) { - my $macaddress = "MAC: " . $content{MACAddress}; - xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); - next; - } -=cut - - if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { - if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { - $src = "$1 $2"; - } else { - $src = basename $key_url; - } - - foreach my $key (keys %content) { - $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $content_info); #Save output in array + foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + next; } + $content_info = uc ($src) . " " . $key . " : " . $content{$key}; + push (@sorted_output, $content_info); #Save output in array } } # If sorted array has any contents, sort it and print it From 85bcbea210dd884d1253d19a14c6766b834befb1 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:46:12 -0400 Subject: [PATCH 074/201] If no values are in the return array, print a message --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index adb21c58e..bd1b5e917 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -978,6 +978,8 @@ sub rinv_response { my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } if ($next_status{ $node_info{$node}{cur_status} }) { From 78bc81874855021d7852ad2a7a94fcbbf3ae29c5 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 31 May 2017 01:26:43 -0400 Subject: [PATCH 075/201] Modify 2 bugs for xcattest --- xCAT-test/xcattest | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 7566e65d1..c3afbe490 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1175,11 +1175,11 @@ sub run_case { #to run singal line command - $cmd = getfunc($cmd->[0]); - @output = &runcmd($cmd); + $cmd->[0] = getfunc($cmd->[0]); + @output = &runcmd($cmd->[0]); $rc = $::RUNCMD_RC; - log_this($running_log_fd, "RUN:$cmd [$runstartstr]"); - push(@caselog, "RUN:$cmd [$runstartstr]"); + log_this($running_log_fd, "RUN:$cmd->[0] [$runstartstr]"); + push(@caselog, "RUN:$cmd->[0] [$runstartstr]"); } else { #to run multiple lines command @@ -1275,7 +1275,8 @@ sub run_case { if ($cmdcheck) { &runcmd($cmdcheck); $rc = $::RUNCMD_RC; - if ($rc == 1) { + if ($rc != 0 ) { + $failflag = 1; log_this($running_log_fd, "CHECK:output $cmdcheck\t[Failed]"); push(@caselog, "CHECK:output $cmdcheck\t[Failed]"); } elsif ($rc == 0) { From 5056bea7db0a9d2a6378e3630f9a6bbd91c66e6f Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 31 May 2017 05:13:06 -0400 Subject: [PATCH 076/201] modify typo --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index c3afbe490..2bcbd7956 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1173,7 +1173,7 @@ sub run_case { my $rc = 0; if ($cmdlen == 1) { - #to run singal line command + #to run single line command $cmd->[0] = getfunc($cmd->[0]); @output = &runcmd($cmd->[0]); From 5c4dd3184421a795b2ff8ff5e6893c45db503b4c Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 31 May 2017 04:36:09 -0500 Subject: [PATCH 077/201] fix issue [fvt]2.13.4 nodeset osimage have no right output if command wrong #2971 (#3147) * fix issue#2971: one CLI arguments validation issue is not correct for nodeset/rinstall/winstall --- perl-xCAT/xCAT/Usage.pm | 38 +++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/destiny.pm | 7 +++++ xCAT-server/lib/xcat/plugins/grub2.pm | 9 ++++-- xCAT-server/lib/xcat/plugins/petitboot.pm | 15 +++++---- xCAT-server/lib/xcat/plugins/rinstall.pm | 11 +++++++ xCAT-server/lib/xcat/plugins/xnba.pm | 14 ++++++--- xCAT-server/lib/xcat/plugins/yaboot.pm | 18 ++++++----- 7 files changed, 91 insertions(+), 21 deletions(-) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 742f7a9a1..2093ca5f0 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -622,3 +622,41 @@ sub parseCommand { return ""; } +#------------------------------------------------------------------------------ + +=head3 validateArgs + This function validates the arguments of the specified command + Arguments: + command + arguments(array @) + Returns: + $ref: a reference to array of [$retcode(integer),$info(string)] + $ref->[0]=0 : validation passed + $ret->[0]!=0: validation failed, the error info is returned in $ref->[1] + +=cut + +#------------------------------------------------------------------------------- + +sub validateArgs { + my $command=shift; + if ($command =~ /xCAT::Usage/) { $command = shift; } + + my $count=0; + my @extrargs=@_; + if($command =~ m/^(nodeset|rinstall|winstall)$/ ){ + #suppose that argument like "-p foo" have been processed and + #filtered by GetOpt subroutine + #fortunately the commands in this branch does not have such options + foreach(@extrargs){ + if($_ !~ m/^-[-]?\S+/){ + $count+=1; + } + } + if ($count!=1) { + return [1,"Invalid argument: '".join(" ",@extrargs)."'"]; + } + } + + return [0]; +} diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 03d0b7843..41d63fc7b 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -187,8 +187,15 @@ sub setdestiny { chomp($state); my $target; my $action; + my $rawstate=$state; if ($state =~ /=/) { ($state, $target) = split '=', $state, 2; + + if(!$target){ + $callback->({ error => "invalid argument: \"$rawstate\"", errorcode => [1] }); + return; + } + if ($target =~ /:/) { ($target, $action) = split ':', $target, 2; } diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index e465db55b..5b2bb8ef3 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -12,7 +12,7 @@ use File::Path; use Socket; use Getopt::Long; use xCAT::Table; - +use xCAT::Usage; my $request; my %breaknetbootnodes; our %normalnodes; @@ -426,10 +426,13 @@ sub preprocess_request { return; } - if (@ARGV == 0) { + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { if ($usage{$command}) { my %rsp; - $rsp{data}->[0] = $usage{$command}; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; $callback1->(\%rsp); } return; diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index faa292721..04430340b 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -6,7 +6,7 @@ use Getopt::Long; use xCAT::Table; use Sys::Syslog; use xCAT::Scope; - +use xCAT::Usage; my $globaltftpdir = xCAT::TableUtils->getTftpDir(); my %usage = ( @@ -322,11 +322,14 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; } diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 7857aaa21..4fba96ed0 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -18,6 +18,7 @@ require xCAT::Utils; require xCAT::MsgUtils; use xCAT::NodeRange; use xCAT::Table; +use xCAT::Usage; use Data::Dumper; use Getopt::Long; @@ -96,6 +97,16 @@ sub rinstall { } if (($command =~ /rinstall/) or ($command =~ /winstall/)) { + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + my $rsp={}; + $rsp->{error}->[0] = $ret->[1]; + $rsp->{errorcode}->[0] = $ret->[0]; + xCAT::MsgUtils->message("E", $rsp, $callback); + &usage($command,$callback); + return; + } + my $state = $ARGV[0]; my $reststates; ($state, $reststates) = split(/,/, $state, 2); diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index eba36892d..e13c8dc79 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -11,6 +11,7 @@ use Getopt::Long; use xCAT::Utils; use xCAT::TableUtils; use xCAT::ServiceNodeUtils; +use xCAT::Usage; my $dhcpconf = "/etc/dhcpd.conf"; @@ -367,11 +368,14 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; } diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 8e8ac37c9..1b3c3ab7e 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -12,6 +12,7 @@ use File::Path; use Socket; use Getopt::Long; use xCAT::Table; +use xCAT::Usage; my %breaknetbootnodes; our %normalnodes; @@ -422,15 +423,18 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; - } - + } #Assume shared tftp directory for boring people, but for cool people, help sync up tftpdirectory contents when #if they specify no sharedtftp in site table From 1b9ccde323a82eb384af9a676264123c09bf40df Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 31 May 2017 15:09:14 -0400 Subject: [PATCH 078/201] Spelling fixes for admin guides --- .../guides/admin-guides/basic_concepts/xcat_object/node.rst | 4 ++-- .../common/deployment/acc_initrd_rootimg_gen.rst | 6 +++--- .../deployment/additionalpkg/nonubuntu_os_other_pkg.rst | 2 +- .../common/deployment/additionalpkg/nonubuntu_os_pkg.rst | 2 +- .../common/deployment/cfg_second_adapter.rst | 4 ++-- .../manage_clusters/common/deployment/deploy_os.rst | 2 +- .../manage_clusters/common/deployment/enable_kdump.rst | 2 +- .../manage_clusters/common/deployment/generate_img.rst | 6 +++--- .../common/deployment/prepostscripts/postinstall_script.rst | 2 +- .../manage_clusters/common/deployment/raid_cfg.rst | 6 +++--- .../common/deployment/syncfile/syncfile_overview.rst | 4 ++-- .../common/deployment/syncfile/syncfile_synclist_file.rst | 2 +- .../common/deployment/trim_diskless_rootimg.rst | 4 ++-- .../admin-guides/manage_clusters/common/kvm/manage_vm.rst | 4 ++-- .../admin-guides/manage_clusters/common/updatenode.rst | 2 +- .../manage_clusters/ppc64le/discovery/mtms/index.rst | 4 ++-- .../manage_clusters/ppc64le/statelite/config_statelite.rst | 4 ++-- .../manage_clusters/ppc64le/virtual_machines/FAQ.rst | 2 +- .../ppc64le/virtual_machines/hypervisorKVM.rst | 4 ++-- .../manage_clusters/ppc64le/virtual_machines/kvmMN.rst | 2 +- 20 files changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst b/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst index b8928ff7e..c94c576a2 100644 --- a/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst +++ b/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst @@ -6,7 +6,7 @@ Description The definition of physical units in the cluster, such as lpar, virtual machine, frame, cec, hmc, switch. -Key Attrubutes +Key Attributes -------------- * os: @@ -16,7 +16,7 @@ Key Attrubutes The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64. * groups: - Usually, there are a set of nodes with some attributes in common, xCAT admin can define a node group containing these nodes, so that the management task can be issued against the group instead of individual nodes. A node can be a memeber of different groups, so the value of this attributes is a comma-delimited list of groups. At least one group is required to create a node. The new created group names should not be prefixed with "__" as this token has been preserverd as the internal group name. + Usually, there are a set of nodes with some attributes in common, xCAT admin can define a node group containing these nodes, so that the management task can be issued against the group instead of individual nodes. A node can be a member of different groups, so the value of this attributes is a comma-delimited list of groups. At least one group is required to create a node. The new created group names should not be prefixed with "__" as this token has been preserved as the internal group name. * mgt: The method to do general hardware management of the node. This attribute can be determined by the machine type of the node. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst index 273c6c13c..9cc18ec36 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst @@ -1,14 +1,14 @@ Accelerating the diskless initrd and rootimg generating ======================================================== -Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-comsuming process, it can be accelerated by enabling paralell compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix ` for an example on ``packimage`` performance optimized with ``pigz`` enabled. +Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-consuming process, it can be accelerated by enabling parallel compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix ` for an example on ``packimage`` performance optimized with ``pigz`` enabled. Enabling the ``pigz`` for diskless initrd and rootimg generating ---------------------------------------------------------------- -The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. +The parallel compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. * **[RHEL]** @@ -24,7 +24,7 @@ The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` pac ``pigz`` should be installed in the diskless rootimg. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then customize the diskless osimage to install ``pigz`` as the additional packages, see :doc:`Install Additional Other Packages` for more details. - 2) Enabeling the ``pigz`` in ``packimage`` + 2) Enabling the ``pigz`` in ``packimage`` ``pigz`` should be installed on the management server. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then install the ``pigz`` with ``yum`` or ``rpm``. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst index e6cc403e6..99d57a980 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst @@ -70,7 +70,7 @@ These are described in more details in the following sections. RPM Names ''''''''' -A simple otherpkgs.pkglist file just contains the the name of the rpm file without the version numbers. +A simple otherpkgs.pkglist file just contains the name of the rpm file without the version numbers. For example, if you put the following three rpms under **/install/post/otherpkgs///** directory, :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst index 77651f270..dcf8c350b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst @@ -51,7 +51,7 @@ These are described in more details in the following sections. RPM Names '''''''''' -A simple .pkglist file just contains the the name of the rpm file without the version numbers. +A simple .pkglist file just contains the name of the rpm file without the version numbers. For example :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst index 492361fc5..ca1da9738 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst @@ -1,7 +1,7 @@ Configure Additional Network Interfaces - confignics ==================================================== -The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (mutltiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. +The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. The way the confignics postscript decides what IP address to give the secondary adapter is by checking the nics table, in which the nic configuration information is stored. @@ -78,7 +78,7 @@ By default, confignics does not configure the install nic. if need, using flag " chdef cn1 -p prostscripts="confignics -s" -Option "-s" writes the install nic's information into configuration file for persistance. All install nic's data defined in nics table will be written also. +Option "-s" writes the install nic's information into configuration file for persistence. All install nic's data defined in nics table will be written also. Add network object into the networks table diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst index bd7567600..4a358b41e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst @@ -11,7 +11,7 @@ There are more attributes of nodeset used for some specific purpose or specific * **runcmd**: This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. * **shell**: This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. -Choose such additional attribute of nodeset according to your requirement, if want to get more informantion about nodeset, refer to nodeset's man page. +Choose such additional attribute of nodeset according to your requirement, if want to get more information about nodeset, refer to nodeset's man page. Start the OS Deployment ======================= 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 85973cc1c..a6c0765d2 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 @@ -38,7 +38,7 @@ In above example, pkglist file is /opt/xcat/share/xcat/netboot/rh/compute.rhels7 Setup pkglist ------------- -Before setting up kdump,the approprite rpms should be added to the pkglist file.Here is the rpm packages list which needs to be added to pkglist file for kdump for different OS. +Before setting up kdump, the appropriate rpms should be added to the pkglist file.Here is the rpm packages list which needs to be added to pkglist file for kdump for different OS. * **[RHEL]** :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst index a5dcf5382..e5886603d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst @@ -1,7 +1,7 @@ Generate Diskless Image ======================= -The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are serveral ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: +The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are several ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: tabdump osimage @@ -18,7 +18,7 @@ The ``netboot-compute`` is the default **diskless** osimage created rhels7.1 ppc Before packing the diskless image, you have the opportunity to change any files in the image by changing to the ``rootimgdir`` and making modifications. (e.g. ``/install/netboot/rhels7.1/ppc64le/compute/rootimg``). -However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable.Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. +However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable. Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. Pack Diskless Image @@ -102,7 +102,7 @@ Skip this section if you want to use the image as is. 1, The use can modify the image to fit his/her own need. The following can be modified. -* Modify .pkglist file to add or remove packges that are from the os distro +* Modify .pkglist file to add or remove packages that are from the os distro * Modify .otherpkgs.pkglist to add or remove packages from other sources. Refer to ``Using_Updatenode`` for details diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst index f212c8691..d3066b65c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst @@ -40,7 +40,7 @@ The ``postinstall`` scripts are executed in step b). Do ``postinstall`` scripts execute in chroot mode under ``rootimgdir`` directory? ````````````````````````````````````````````````````````````````````````````````` -No. Unlike postscripts and postbootscripts, the ``postinstall`` scripts are run in non-chroot environment, directly on the management node. In the postinstall scripts, all the paths of the directories and files are based on ``/`` of the managememnt node. To reference inside the ``rootimgdir``, use the ``$IMG_ROOTIMGDIR`` environment variable, exported by ``genimage``. +No. Unlike postscripts and postbootscripts, the ``postinstall`` scripts are run in non-chroot environment, directly on the management node. In the postinstall scripts, all the paths of the directories and files are based on ``/`` of the management node. To reference inside the ``rootimgdir``, use the ``$IMG_ROOTIMGDIR`` environment variable, exported by ``genimage``. What are some of the environment variables available to my customized ``postinstall`` scripts? `````````````````````````````````````````````````````````````````````````````````````````````` diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst index 0acea9a4e..752f38412 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst @@ -185,7 +185,7 @@ Here is the RAID1 partitioning section in service.raid1.sles11.tmpl: :: The samples above created one 24MB PReP partition on each disk, one 2GB mirrored swap partition and one mirrored ``/`` partition uses all the disk space. If you want to use different partitioning scheme in your cluster, modify this RAID1 section in the autoyast template file accordingly. -Since the PReP partition can not be mirrored between the two disks, some additional postinstall commands should be run to make the second disk bootable, here the the commands needed to make the second disk bootable: :: +Since the PReP partition can not be mirrored between the two disks, some additional postinstall commands should be run to make the second disk bootable, here the commands needed to make the second disk bootable: :: # Set the second disk to be bootable for RAID1 setup parted -s /dev/sdb mkfs 1 fat16 @@ -230,7 +230,7 @@ The command mdadm can query the detailed configuration for the RAID partitions: Disk Replacement Procedure -------------------------- -If any one disk fails in the RAID1 arrary, do not panic. Follow the procedure listed below to replace the failed disk and you will be fine. +If any one disk fails in the RAID1 array, do not panic. Follow the procedure listed below to replace the failed disk and you will be fine. Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: :: @@ -250,7 +250,7 @@ Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: : We can see that the first disk is broken because all the RAID partitions on this disk are marked as (F). -Remove the failed disk from RAID arrary +Remove the failed disk from RAID array --------------------------------------- ``mdadm`` is the command that can be used to query and manage the RAID arrays on Linux. To remove the failed disk from RAID array, use the command: :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst index 4862d4ed8..d0d18af6f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst @@ -3,7 +3,7 @@ Overview Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes. -This function is supported for diskful or RAMdisk-based diskless nodes.Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. +This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. @@ -17,7 +17,7 @@ For a new-installing nodes, the Syncing File action will be triggered when perfo The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. -**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes.You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** +**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes. You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst index 6ce471eb3..9af8e913f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst @@ -97,7 +97,7 @@ Note: From xCAT 2.9.2 on AIX and from xCAT 2.12 on Linux, xCAT support a new for file -> (noderange for permitted nodes) file -The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specifed before the file name :: +The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specified before the file name :: /etc/hosts -> (node1,node2) /etc/hosts # The /etc/hosts file is synced to node1 and node2 /etc/hosts -> (node1-node4) /etc/hosts # The /etc/hosts file is synced to node1,node2,node3 and node4 diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst index 198ac04e8..e417ca402 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst @@ -51,7 +51,7 @@ The content above presents some syntax supported in exlist file: +./usr/share/locale/C* - It is useful to include files following an exclude entry to qiuckly remove a larger set of files using a wildcard and then adding back the few necessary files using the + sign. In the above example, all the files and sub-directories matching the pattern ``/usr/share/locale/C*`` will be included in the ``rootimg.gz`` file. + It is useful to include files following an exclude entry to quickly remove a larger set of files using a wildcard and then adding back the few necessary files using the + sign. In the above example, all the files and sub-directories matching the pattern ``/usr/share/locale/C*`` will be included in the ``rootimg.gz`` file. Customize the ``exlist`` file and the osimage definition @@ -77,4 +77,4 @@ If you want to customize the osimage ``sles12.1-ppc64le-netboot-compute`` with y .. [1] The ``exlist`` file entry should not end with a slash ``/``, For example, this entry will never match anything: ``./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/``. -.. [2] Pattern match test applies to the whole file name,starting from one of the start points specified in the ``exlist`` file entry. The regex syntax should comply with the regex syntax of system command ``find -path``, refer to its doc for details. +.. [2] Pattern match test applies to the whole file name, starting from one of the start points specified in the ``exlist`` file entry. The regex syntax should comply with the regex syntax of system command ``find -path``, refer to its doc for details. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index cc7a1fc49..f383e065d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -2,7 +2,7 @@ Manage Virtual Machine (VM) ============================ -Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create,remove and clone VMs. +Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs. Create Virtual Machine ---------------------- @@ -117,7 +117,7 @@ Now a VM "vm1" is created, it can be provisioned like any other nodes in xCAT. T rpower vm1 on -If "vm1" is powered on successfully, the VM status can be obtained by running the following command on management node :: +If "vm1" is powered on successfully, the VM status can be obtained by running the following command on management node :: rpower vm1 status diff --git a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst index 67444a2cd..5a505a57b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst @@ -134,6 +134,6 @@ where is a comma separated postscript like ospkgs,otherpkgs etc. * wget is used in xcatdsklspost/xcataixpost to get all the postscripts from the to the node. You can check /tmp/wget.log file on the node to see if wget was successful or not. You need to make sure the /xcatpost directory has enough space to hold the postscripts. * A file called /xcatpost/mypostscript (Linux) is created on the node which contains the environmental variables and scripts to be run. Make sure this file exists and it contains correct info. You can also run this file on the node manually to debug. * For ospkgs/otherpkgs, if /install is not mounted on the , it will download all the rpms from the to the node using wget. Make sure /tmp and /xcatpost have enough space to hold the rpms and check /tmp/wget.log for errors. - * For ospkgs/otherpkgs, If zypper or yum is installed on the node, it will be used the command to install the rpms. Make sure to run createrepo on the source direcory on the every time a rpm is added or removed. Otherwise, the rpm command will be used, in this case, make sure all the necessary depended rpms are copied in the same source directory. + * For ospkgs/otherpkgs, If zypper or yum is installed on the node, it will be used the command to install the rpms. Make sure to run createrepo on the source directory on the every time a rpm is added or removed. Otherwise, the rpm command will be used, in this case, make sure all the necessary depended rpms are copied in the same source directory. * You can append -x on the first line of ospkgs/otherpkgs to get more debug info. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst index fde5e5254..c4c998c9e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst @@ -3,12 +3,12 @@ MTMS-based Discovery MTMS stands for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial. This is one way to uniquely identify each physical server. -MTMS-based hardware discovery assumes the administator has the model type and serial number information for the physical servers and a plan for mapping the servers to intended hostname/IP addresses. +MTMS-based hardware discovery assumes the administrator has the model type and serial number information for the physical servers and a plan for mapping the servers to intended hostname/IP addresses. **Overview** #. Automatically search and collect MTMS information from the servers - #. Write **discovered-bmc-nodes** to xCAT (recommened to set different BMC IP address) + #. Write **discovered-bmc-nodes** to xCAT (recommended to set different BMC IP address) #. Create **predefined-compute-nodes** to xCAT providing additional properties #. Power on the nodes which triggers xCAT hardware discovery engine diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst index ce44725f0..0e66ab76d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst @@ -20,7 +20,7 @@ The litefile table specifies the directories and files on the statelite nodes th #. The third column in the litefile table specifies options for the directory or file: #. tmpfs - It provides a file or directory for the node to use when booting, its permission will be the same as the original version on the server. In most cases, it is read-write; however, on the next statelite boot, the original version of the file or directory on the server will be used, it means it is non-persistent. This option can be performed on files and directories. - #. rw - Same as Above.Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. + #. rw - Same as above. Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. #. persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted on the local file or directory. Anything written to that file or directory is preserved. It means, if the file/directory does not exist at first, it will be copied to the persistent location. Next time the file/directory in the persistent location will be used. The file/directory will be persistent across reboots. Its permission will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. This option can be performed on files and directories. #. con - The contents of the pathname are concatenated to the contents of the existing file. For this directive the searching in the litetree hierarchy does not stop when the first match is found. All files found in the hierarchy will be concatenated to the file when found. The permission of the file will be "-rw-r--r--", which means it is read-write for the root user, but readonly for the others. It is non-persistent, when the node reboots, all changes to the file will be lost. It can only be performed on files. Do not use it for one directory. #. ro - The file/directory will be overmounted read-only on the local file/directory. It will be located in the directory hierarchy specified in the litetree table. Changes made to this file or directory on the server will be immediately seen in this file/directory on the node. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. This option can be performed on files and directories. @@ -133,5 +133,5 @@ noderes ``noderes.nfsserver`` attribute can be set for the NFSroot server. If this is not set, then the default is the Management Node. -``noderes.nfsdir`` can be set. If this is not set, the the default is ``/install`` +``noderes.nfsdir`` can be set. If this is not set, the default is ``/install`` diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst index 7a00d46e6..214c79607 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst @@ -88,7 +88,7 @@ Fail to ping the installed VM ADDRCONF(NETDEV_UP): eth0 link is not ready. - **Solutoin**: + **Solution**: Usually caused by the incorrect VM NIC model. Try the following steps to specify "virtio": :: rmvm vm1 diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst index e4f0b0b14..63a2df528 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst @@ -16,7 +16,7 @@ Provision Hypervisor #. Customize the hypervisor node definition to create network bridge - xCAT ships a postscript **xHRM** to create a network bridge on kvm host during installation/netbooting. Specify the **xHRM** with appropriate parameters in **postscripts** attibute. For example: + xCAT ships a postscript **xHRM** to create a network bridge on kvm host during installation/netbooting. Specify the **xHRM** with appropriate parameters in **postscripts** attribute. For example: * To create a bridge named 'br0' against the installation network device specified by **installnic**: :: @@ -68,7 +68,7 @@ If the hypervisor is provisioned successfully according to the steps described a br0 8000.000000000000 no eth0 -If the network bridge is not created or configured successfully, run "xHRM" with **updatenode** on managememt node to create it manually::: +If the network bridge is not created or configured successfully, run "xHRM" with **updatenode** on management node to create it manually::: updatenode kvmhost1 -P "xHRM bridgeprereq eth0:br0" diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst index 8b735a1f4..eb33072f8 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst @@ -15,7 +15,7 @@ Please make sure the following packages have been installed on the management no Set Up the kvm storage directory on the management node(optional) ----------------------------------------------------------------- -It is a recommended configuration to create a shared file system for virtual machines hosting. The shared file system, usually on a SAN, NAS or GPFS, is shared among KVM hypevisors, which simplifies VM migration from one hypervisor to another with xCAT. +It is a recommended configuration to create a shared file system for virtual machines hosting. The shared file system, usually on a SAN, NAS or GPFS, is shared among KVM hypervisors, which simplifies VM migration from one hypervisor to another with xCAT. The easiest shared file system is ``/install`` directory on the management node, it can be shared among hypervisors via NFS. Please refer to the following steps : From b1d75f8704414f5c064420ee9940eaaef61e020c Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 31 May 2017 21:48:42 -0400 Subject: [PATCH 079/201] Add testcase to setup/clear openbmc simulator --- .../autotest/testcase/simulator/change_ip.sh | 19 +++++++++++++++++++ .../testcase/simulator/clear_simulator | 4 ++++ .../testcase/simulator/setup_simulator | 8 ++++++++ 3 files changed, 31 insertions(+) create mode 100644 xCAT-test/autotest/testcase/simulator/change_ip.sh create mode 100644 xCAT-test/autotest/testcase/simulator/clear_simulator create mode 100644 xCAT-test/autotest/testcase/simulator/setup_simulator diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh new file mode 100644 index 000000000..15ed0ad7c --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/change_ip.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +flag=$1 +mnhn=$2 +cnhn=$3 + +if [ $flag = "-s" ]; then + cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` + echo $cnip > "/tmp/simulator" + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` + chdef $cnhn bmc=$mnip +elif [ $flag = "-c" ]; then + cnip=`cat /tmp/simulator` + chdef $cnhn bmc=$cnip + process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'` + kill $process + rm -rf "openbmc_simulator" +fi +exit $? diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator new file mode 100644 index 000000000..24a95a41b --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -0,0 +1,4 @@ +start:clear_openbmc_simulator +cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator new file mode 100644 index 000000000..34f66896b --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -0,0 +1,8 @@ +start:setup_openbmc_simulator +cmd:git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/root/openbmc_simulator/simulator & +check:rc==0 +cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -s $$MN $$CN +check:rc==0 +end From 57b10b57bd859b18cf3d0adc16005b31eaf7c15c Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 1 Jun 2017 14:27:45 +0800 Subject: [PATCH 080/201] Add basic integration check to all the migration tests --- xCAT-test/autotest/testcase/migration/redhat_migration | 4 ++++ xCAT-test/autotest/testcase/migration/sles_migration | 4 ++++ xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le | 2 ++ xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm | 2 ++ xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le | 2 ++ xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 2 ++ 6 files changed, 16 insertions(+) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index c2d43ff7b..57e67a268 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -97,6 +97,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi @@ -204,6 +206,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index f20f56edb..36e6002fa 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -99,6 +99,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi @@ -209,6 +211,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index cf77bd24f..e9f12e354 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -118,6 +118,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 636553292..1c72822a7 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -117,6 +117,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 1d3216e8c..a1509715b 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -118,6 +118,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index 34c7123cb..d4af68b22 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -117,6 +117,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end From ffd2bdee8ee019830e6cd68dd0ee2fd20728c912 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 1 Jun 2017 03:19:29 -0400 Subject: [PATCH 081/201] Remove stop label from all provision cases --- xCAT-test/autotest/testcase/installation/SN_setup_case | 2 +- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../installation/reg_linux_diskfull_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- .../installation/reg_linux_diskless_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_statelite_installation_flat | 2 +- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 +- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 330bdeaa2..4d0c6baa0 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -1,6 +1,6 @@ start:SN_setup_case os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__ diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index cbe7a6991..be95f5d86 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,6 +1,6 @@ start:reg_linux_diskfull_installation_flat os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi 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 eca702914..a21b71002 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,6 +1,6 @@ start:reg_linux_diskfull_installation_hierarchy os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" 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 1541fae4b..f2019566a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,6 +1,6 @@ start:reg_linux_diskless_installation_flat os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 8ca853faa..920c1d563 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,6 +1,6 @@ start:reg_linux_diskless_installation_hierarchy os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index fa994e2c6..4b3b6849b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,6 +1,6 @@ start:reg_linux_statelite_installation_flat os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index cfb83253f..076a14c2d 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,6 +1,6 @@ start:reg_linux_statelite_installation_hierarchy_by_nfs os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index a15e412f1..e9851d362 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,6 +1,6 @@ start:reg_linux_statelite_installation_hierarchy_by_ramdisk os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" From c557dea948b2cb9092a0bcd25bfb710702183c3c Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 1 Jun 2017 04:40:13 -0400 Subject: [PATCH 082/201] modified depending on comments --- .../autotest/testcase/simulator/change_ip.sh | 0 .../testcase/simulator/clear_simulator | 3 ++- .../testcase/simulator/install_git.sh | 24 +++++++++++++++++++ .../testcase/simulator/setup_simulator | 5 ++-- 4 files changed, 29 insertions(+), 3 deletions(-) mode change 100644 => 100755 xCAT-test/autotest/testcase/simulator/change_ip.sh create mode 100755 xCAT-test/autotest/testcase/simulator/install_git.sh diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh old mode 100644 new mode 100755 diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 24a95a41b..85b2557bd 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -1,4 +1,5 @@ start:clear_openbmc_simulator -cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN +description:clear evironment +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN check:rc==0 end diff --git a/xCAT-test/autotest/testcase/simulator/install_git.sh b/xCAT-test/autotest/testcase/simulator/install_git.sh new file mode 100755 index 000000000..d00e2475c --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/install_git.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +os=`cat /etc/*release*` + +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git + if [ $? != 0 ]; then + echo "Install git Failed." >> $log_file + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git + if [ $? != 0 ]; then + echo "Install git Failed." >> $log_file + exit 1 + fi +fi + +cd + +git clone git@github.com:xuweibj/openbmc_simulator.git + +exit $? + diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index 34f66896b..29fae143e 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -1,8 +1,9 @@ start:setup_openbmc_simulator -cmd:git clone git@github.com:xuweibj/openbmc_simulator.git +description:install dependent packaages, setup and start openbmc simulator +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/install_git.sh check:rc==0 cmd:/root/openbmc_simulator/simulator & check:rc==0 -cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -s $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -s $$MN $$CN check:rc==0 end From fe6b771addc5a5e5ceed871bf090d57650872111 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 1 Jun 2017 17:22:22 +0800 Subject: [PATCH 083/201] Fix #3087: nodeset improvement - using multi-process to parallelize (#3118) * Fix #3087: nodeset improvement - using multi-process to parallelize - before deliver the request to xcatd, we can split the request to multiple sub-requests which contains different noderange - in that, xcatd could hanle those sub-requests in parallel, just like some issue multiple commands. * refine according to the review comments: - not using POSIX::ceil - Callback is reserved for filter method * refine codes according review comments * make the comments right and more readable. --- perl-xCAT/xCAT/Scope.pm | 165 ++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/destiny.pm | 18 ++- xCAT-server/lib/xcat/plugins/grub2.pm | 12 +- xCAT-server/lib/xcat/plugins/petitboot.pm | 12 +- xCAT-server/lib/xcat/plugins/xnba.pm | 19 +-- 5 files changed, 206 insertions(+), 20 deletions(-) diff --git a/perl-xCAT/xCAT/Scope.pm b/perl-xCAT/xCAT/Scope.pm index 654e6950a..a7aaf2588 100644 --- a/perl-xCAT/xCAT/Scope.pm +++ b/perl-xCAT/xCAT/Scope.pm @@ -1,8 +1,173 @@ package xCAT::Scope; + use xCAT::Utils; use xCAT::Table; use xCAT::ServiceNodeUtils qw(getSNList); + +#----------------------------------------------------------------------------- + +=head3 split_node_array + + Split a node array into multiple subsets in case to handle them in parallel. + + Arguments: + Reference of source array + Maximum subset number + Default element capacity in each subset + Returns: An array of all subsets + Error: + none + Example: + my $subsets = split_node_array(\@nodes, 5, 250); +=cut + +#----------------------------------------------------------------------------- +sub split_node_array { + my $source = shift; + if ($source =~ /xCAT::Scope/) { + $source = shift; + } + my $max_sub = shift; + my $capacity = shift; + + if ($max_sub < 2) {return [$source];} + + my @dest = (); + my $total = $#{$source} + 1; + my $n_sub = int ($total / $capacity); + unless ($n_sub * $capacity == $total) { $n_sub++;} #POSIX::ceil + + if ( $n_sub <= 1 ) { + # Only 1 subset is enough + $dest[0] = $source; + + } elsif ( $n_sub > $max_sub ) { + # Exceed, then to recaculate the capacity of each subset as we only allow max_sub + $capacity = int ($total / $max_sub); + if ( $total % $max_sub > 0 ) { + $capacity += 1; + } + my $start = $end = 0; + for (1..$max_sub) { + $end = $start + $capacity - 1; + if ( $end > $total - 1 ) { + $end = $total - 1 + } + + my @temp = @$source[$start..$end]; + $dest[$_-1]=\@temp; + $start = $end + 1; + } + + } else { + # Only n_sub subsets are required, split the noderange into each subset + my $start = $end = 0; + for (1..$n_sub) { + $end = $start + $capacity - 1; + if ( $end > $total - 1 ) { + $end = $total - 1 + } + #print "subset #$_: $start to $end"; + my @temp = @$source[$start..$end]; + $dest[$_-1]=\@temp; + $start = $end + 1; + } + } + + return \@dest; +} + +#----------------------------------------------------------------------------- + +=head3 get_parallel_scope + + Convert a request object to an array of multiple requests according to the + splitted node range. + + Arguments: + Reference of request + Maximum subset number: Optional, default is 5 + Default element capacity in each subset: Optional, default is 250 + Returns: An array of requests + Error: + none + Example: + my $reqs = xCAT::Scope->get_parallel_scope($request); +=cut + +#----------------------------------------------------------------------------- +sub get_parallel_scope { + my $req = shift; + if ($req =~ /xCAT::Scope/) { + $req = shift; + } + my ($max_sub, $capacity) = @_; + #TODO, make the value configurable + unless ($max_sub) { $max_sub = 5; } + unless ($capacity) { $capacity = 250; } + + my $subsets = split_node_array(\@{$req->{node}}, $max_sub, $capacity); + # Just return the origin one if node range is not big enough. + if ($#{$subsets} < 1) { return [$req]; } + + my @requests = (); + foreach (@$subsets) { + my $reqcopy = {%$req}; + $reqcopy->{node} = $_; + push @requests, $reqcopy; + } + return \@requests; +} + +#----------------------------------------------------------------------------- + +=head3 get_broadcast_scope_with_parallel + + Convert a request object to an array of multiple requests according to the + splitted node range. + + Arguments: + Reference of request + Callback: TODO, Optional, the Callback will be used to filter the nodes + Returns: An array of requests + Error: + none + Example: + my $reqs = xCAT::Scope->get_broadcast_scope($request); +=cut + +#----------------------------------------------------------------------------- +sub get_broadcast_scope_with_parallel { + my $req = shift; + if ($req =~ /xCAT::Scope/) { + $req = shift; + } + #Exit if the packet has been preprocessed in its history + if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } + + #Handle the one for current management/service node + my $reqs = get_parallel_scope($req); + my @requests = @$reqs; + + #Broadcast the request to other management/service nodes + foreach (xCAT::ServiceNodeUtils->getSNList()) { + if (xCAT::NetworkUtils->thishostisnot($_)) { + my $xcatdest = $_; + my $reqcopy = {%$req}; + $reqcopy->{'_xcatdest'} = $_; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + #Apply callback to filter the node range in future. + $reqs = get_parallel_scope($reqcopy); + foreach (@$reqs) { + push @requests, {%$_}; + } + } + } + return \@requests; +} + + sub get_broadcast_scope { my $req = shift; if ($req =~ /xCAT::Scope/) { diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 41d63fc7b..ba55424f8 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -76,15 +76,24 @@ sub process_request { sub relay_response { my $resp = shift; + my $failure = 0; $callback->($resp); if ($resp and ($resp->{errorcode} and $resp->{errorcode}->[0]) or ($resp->{error} and $resp->{error}->[0])) { - $errored = 1; + $failure = 1; } - foreach (@{ $resp->{node} }) { - if ($_->{error} or $_->{errorcode}) { - $errored = 1; + # quick return when detect failure. + unless ( $failure ) { + foreach (@{ $resp->{node} }) { + if ($_->{error} or $_->{errorcode}) { + $failure = 1; + last; + } } } + if ( $failure ) { + $errored = $failure; + } + } sub setdestiny { @@ -408,6 +417,7 @@ sub setdestiny { bootparams => \$bphash}, \&relay_response); if ($errored) { # The error messeage for mkinstall/mknetboot/mkstatelite had been output within relay_response function above, don't need to output more + xCAT::MsgUtils->trace($verbose_on_off, "d", "destiny->process_request: Failed in processing mk$tempstate. Processing will not continue."); return; } diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 5b2bb8ef3..14fa9702a 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -468,10 +468,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } sub process_request { @@ -592,9 +592,10 @@ sub process_request { my $inittime = 0; if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -602,8 +603,11 @@ sub process_request { arg => \@args, bootparams => \%bphash }, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index 04430340b..04f7bcdf7 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -360,10 +360,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } @@ -487,9 +487,10 @@ sub process_request { my $inittime = 0; if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -497,8 +498,11 @@ sub process_request { arg => \@args, bootparams => \%bphash}, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } # Fix the bug 4611: PowerNV stateful CN provision will hang at reboot stage# if ($args[0] eq 'next') { diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index e13c8dc79..dd8fe9d1c 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -117,7 +117,7 @@ sub setstate { #Implement the kcmdline append here for #most generic, least code duplication -###hack start + ###hack start # This is my comment. There are many others like it, but this one is mine. # My comment is my best friend. It is my life. I must master it as I must master my life. # Without me, my comment is useless. Without my comment, I am useless. @@ -167,7 +167,7 @@ sub setstate { #$kern->{kcmdline} .= " ".$kern->{addkcmdline}; $kern->{kcmdline} .= " " . $kcmdlinehack; -###hack end + ###hack end } } @@ -243,7 +243,7 @@ sub setstate { if ($kern->{kernel} =~ /esxi[56]/) { #Make uefi boot provisions my $ucfg; open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); - if ($kern->{kcmdline} =~ / xcat\/netboot/) { + if ($kern->{kcmdline} =~ /xcat\/netboot/) { $kern->{kcmdline} =~ s/xcat\/netboot/\/tftpboot\/xcat\/netboot/; } print $ucfg "#!gpxe\n"; @@ -408,10 +408,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } sub process_request { @@ -545,9 +545,10 @@ sub process_request { my $inittime = 0; if (exists($::XNBA_request->{inittime})) { $inittime = $::XNBA_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -555,10 +556,12 @@ sub process_request { arg => \@args , bootparams => \%bphash}, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } - #Time to actually configure the nodes, first extract database data with the scalable calls my $chaintab = xCAT::Table->new('chain'); my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories From 6c8034cfa90d461adab5fa990622ad8820218270 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 1 Jun 2017 21:49:32 +0800 Subject: [PATCH 084/201] fix typo in if-clause --- xCAT-server/share/xcat/install/scripts/post.rhels7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 index 3b36dfefe..f5c9de34e 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -9,11 +9,11 @@ for i in $(find /etc/sysconfig/network-scripts/ifcfg-*|egrep -v ifcfg-lo ) do nicname=$(echo $i|awk -F 'ifcfg-' '{print $2}') - if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1 + if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1; then if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then msgutil_r "$MASTER_IP" "info" "set NIC $nicname to be activated on system boot" "/var/log/xcat/xcat.log" fi - then sed -i 's/ONBOOT=no/ONBOOT=yes/' $i + sed -i 's/ONBOOT=no/ONBOOT=yes/' $i fi #remove the entry 'HWADDR' from ifcfg-ethx, this is used to skip the From 0dae47b9a5189355b2b46132d664dbc5af85b69d Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 2 Jun 2017 11:25:35 +0800 Subject: [PATCH 085/201] fix issue 3142 delete useless dracut.* files under rootimg/tmp in liteimg (#3154) * fix issue 3142 useless dracut.* files under rootimg/tmp cause liteimg cost much time * polished * polished --- xCAT-server/lib/xcat/plugins/statelite.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index daed8b6e6..e6f2e5e2d 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -355,6 +355,11 @@ sub process_request { xCAT::Utils->runcmd("mkdir $rootimg_dir/.statebackup", 0, 1); } + #delete useless rootimg/tmp/dracut.* files + #fix copy many dracut.* files cost too much time in liteimg + $verbose && $callback->({ info => ["removing \"$rootimg_dir/tmp/dracut.*\""] }); + unlink glob "$rootimg_dir/tmp/dracut.*"; + # recovery the files in litefile.save if necessary foreach my $line (keys %hashSaved) { my @oldentry = split(/\s+/, $line); From d7d3324abf9acd9bcec5ad792d76cc71c8a50f15 Mon Sep 17 00:00:00 2001 From: XuWei Date: Fri, 2 Jun 2017 01:57:58 -0400 Subject: [PATCH 086/201] modified depending on comments --- .../testcase/simulator/install_git.sh | 24 ------------------- .../testcase/simulator/setup_simulator | 17 ++++++++++++- 2 files changed, 16 insertions(+), 25 deletions(-) delete mode 100755 xCAT-test/autotest/testcase/simulator/install_git.sh diff --git a/xCAT-test/autotest/testcase/simulator/install_git.sh b/xCAT-test/autotest/testcase/simulator/install_git.sh deleted file mode 100755 index d00e2475c..000000000 --- a/xCAT-test/autotest/testcase/simulator/install_git.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -os=`cat /etc/*release*` - -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git - if [ $? != 0 ]; then - echo "Install git Failed." >> $log_file - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git - if [ $? != 0 ]; then - echo "Install git Failed." >> $log_file - exit 1 - fi -fi - -cd - -git clone git@github.com:xuweibj/openbmc_simulator.git - -exit $? - diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index 29fae143e..f2549cca3 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -1,6 +1,21 @@ start:setup_openbmc_simulator description:install dependent packaages, setup and start openbmc simulator -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/install_git.sh +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git check:rc==0 cmd:/root/openbmc_simulator/simulator & check:rc==0 From e4d06a4a8bc058fe5734784b5efad13d45a25d7d Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 2 Jun 2017 03:33:16 -0400 Subject: [PATCH 087/201] update according to comments --- xCAT-test/autotest/testcase/makedhcp/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index b56db6f91..417f3f5a8 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -189,6 +189,7 @@ check:rc==0 cmd: cp -f /etc/hosts /etc/hosts.bak cmd:echo "100.100.100.2 testnode" >> /etc/hosts check:rc==0 +cmd:makdhcp -d testnode cmd:makedhcp testnode check:rc==0 cmd:makdhcp -q testnode From 2f62326f04b21d1ea8987be2549e67655b76a574 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 2 Jun 2017 16:45:40 +0800 Subject: [PATCH 088/201] Do operating system deployment in migration test cases --- .../testcase/migration/redhat_migration | 42 +++++++++++-------- .../testcase/migration/sles_migration | 38 ++++++++++------- .../testcase/migration/ubuntu_migration1_p8le | 19 +++++---- .../testcase/migration/ubuntu_migration1_vm | 19 +++++---- .../testcase/migration/ubuntu_migration2_p8le | 19 +++++---- .../testcase/migration/ubuntu_migration2_vm | 19 +++++---- 6 files changed, 97 insertions(+), 59 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 57e67a268..6ce3b9432 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -71,11 +71,13 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -93,14 +95,15 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" -check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" +check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -180,10 +183,12 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 @@ -202,9 +207,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" check:rc==0 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 36e6002fa..d822385e0 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -74,10 +74,12 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -95,9 +97,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" check:rc==0 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 @@ -186,10 +191,12 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -207,9 +214,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" check:rc==0 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index e9f12e354..2a6c8af8f 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -80,10 +80,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -114,10 +116,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 1c72822a7..8c519b898 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -79,10 +79,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -113,10 +115,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index a1509715b..ca3fe6569 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -80,10 +80,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -114,10 +116,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index d4af68b22..adfe3244a 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -79,10 +79,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -113,10 +115,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" From f7a39006dc7876f7fc65466adc5a834086d4b928 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Jun 2017 12:42:16 -0400 Subject: [PATCH 089/201] Support rflash command -c option for OpenBMC --- xCAT-server/lib/xcat/plugins/openbmc.pm | 86 ++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 84d9226a6..7560ac0d5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -393,7 +393,7 @@ sub parse_args { my $noderange = shift; my $check = undef; - if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig/) { + if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig|rflash/) { return ([ 1, "No option specified for $command" ]); } @@ -462,6 +462,27 @@ sub parse_args { unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^altitude$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } + } elsif ($command eq "rflash") { + my $filename_passed = 0; + foreach my $opt (@$extrargs) { + # Only files ending on .tar are allowed + if ($opt =~ /.*\.tar$/i) { + $filename_passed = 1; + next; + } + if ($filename_passed) { + # Filename was passed, check flags allowed with file + if ($opt !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) { + return ([ 1, "Unsupported file command option: $opt" ]); + } + } + else { + # Filename was not passed, check flags allowed without file + if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { + return ([ 1, "Unsupported no file command command option: $opt" ]); + } + } + } } else { return ([ 1, "Command is not supported." ]); } @@ -618,6 +639,69 @@ sub parse_command_status { $status_info{RVITALS_RESPONSE}{argv} = "$subcommand"; } + if ($command eq "rflash") { + my $check_version = 0; + my $list = 0; + my $delete = 0; + my $upload = 0; + unless (GetOptions( + 'c|check' => \$check_version, + 'l|list' => \$list, + 'd|delete' => \$delete, + 'u|upload' => \$upload, + )) { + xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback); + return 1; + } + + my $update_file = $ARGV[0]; + my $filename = undef; + my $file_id = undef; + my $grep_cmd = "/usr/bin/grep -a"; + my $version_tag = '"version=IBM"'; + my $purpose_tag = '"purpose="'; + if (defined $update_file) { + # Filename or file id was specified + if ($update_file =~ /.*\.tar$/) { + # Filename ending on .tar was specified + $filename = $update_file; + if ($check_version) { + # Display firmware version of the specified .tar file + my $firmware_version_in_file = `$grep_cmd $version_tag $filename`; + my $purpose_version_in_file = `$grep_cmd $purpose_tag $filename`; + chomp($firmware_version_in_file); + chomp($purpose_version_in_file); + my ($purpose_string,$purpose_value) = split("=", $purpose_version_in_file); + my ($version_string,$version_value) = split("=", $firmware_version_in_file); + if ($purpose_value =~ /host/) { + $purpose_value = "Host"; + } + xCAT::SvrUtils::sendmsg("TAR $purpose_value Firmware Product Version\: $version_value", $callback); + } + } + else { + #TODO Process file id passed in + } + } + if ($check_version) { + #Display firmware version on BMC + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } + if ($list) { + xCAT::SvrUtils::sendmsg("List option is not yet supported.", $callback); + return 1; + } + if ($delete) { + xCAT::SvrUtils::sendmsg("Delete option is not yet supported.", $callback); + return 1; + } + if ($upload) { + xCAT::SvrUtils::sendmsg("Upload option is not yet supported.", $callback); + return 1; + } + } + print Dumper(\%next_status) . "\n"; return; } From eb9487b0b9de4a42a2e9be4f1d97512d3471e4bb Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 14:24:51 -0400 Subject: [PATCH 090/201] Handle the firmware data using the same sorted output array and add in support for ExtendedVersion --- xCAT-server/lib/xcat/plugins/openbmc.pm | 58 +++++++++++++++---------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index bd1b5e917..276d5f470 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -941,35 +941,47 @@ sub rinv_response { # node: Software: () # if (defined($content{Version}) and $content{Version}) { - # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; - my $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; - xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); + # + # The space below between "SOFTWARE:" and $content{Version} is intentional + # to cause the sorting of this line before any additional info lines + # + $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; + push (@sorted_output, $content_info); + + if ($content{ExtendedVersion} ne "") { + # ExtendedVersion is going to be a comma separated list of additional software + my @versions = split(',', $content{ExtendedVersion}); + foreach my $ver (@versions) { + $content_info = "$purpose_value SOFTWARE: -- additional info: $ver"; + push (@sorted_output, $content_info); + } + } next; } - } - - if (! defined $content{Present}) { - # This should never happen, but if we find this, contact firmware team to fix... - xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); - next; - } - - if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { - $src = "$1 $2"; } else { - $src = basename $key_url; - } - - foreach my $key (keys %content) { - # If not all options is specified, check whether the key string contains - # the keyword option. If so, add it to the return data - if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { - next; + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } + + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { + $src = "$1 $2"; + } else { + $src = basename $key_url; + } + + foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + next; + } + $content_info = uc ($src) . " " . $key . " : " . $content{$key}; + push (@sorted_output, $content_info); #Save output in array } - $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $content_info); #Save output in array } } # If sorted array has any contents, sort it and print it From 9340c2d2e4ae032027931b111b780ee1498eafc0 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 14:52:53 -0400 Subject: [PATCH 091/201] Fixes the test so that rinv options will check both key and key_url --- 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 276d5f470..45a9395e2 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -976,7 +976,7 @@ sub rinv_response { foreach my $key (keys %content) { # If not all options is specified, check whether the key string contains # the keyword option. If so, add it to the return data - if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + if ($grep_string ne "all" and ((lc($key) !~ m/$grep_string/i) and ($key_url !~ m/$grep_string/i)) ) { next; } $content_info = uc ($src) . " " . $key . " : " . $content{$key}; From bf382dcd10320442ad0a3bfe65fe0963ddf8923e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 15:02:02 -0400 Subject: [PATCH 092/201] Sync up the spelling to use: OpenPOWER and OpenBMC --- .../compute_node/replace/openpower.rst | 4 ++-- .../manage_clusters/ppc64le/index.rst | 10 +++++----- .../ppc64le/management/basic/rcons.rst | 4 ++-- .../admin-guides/references/man1/rpower.1.rst | 4 ++-- .../admin-guides/references/man5/openbmc.5.rst | 2 +- .../admin-guides/references/man5/xcatdb.5.rst | 2 +- docs/source/overview/xcat2_release.rst | 4 ++-- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 2 +- perl-xCAT/xCAT/Schema.pm | 2 +- perl-xCAT/xCAT/Usage.pm | 4 ++-- xCAT-client/pods/man1/rpower.1.pod | 4 ++-- xCAT-genesis-scripts/bin/bmcsetup | 18 +++++++++--------- xCAT-server/lib/xcat/plugins/ipmi.pm | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst b/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst index 6e17f9947..018de0672 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst @@ -1,10 +1,10 @@ -OpenPower Nodes +OpenPOWER Nodes =============== When compute nodes are physically replaced in the frame, leverage xCAT to re-discover the compute nodes. The following guide can be used for: - * IBM OpenPower S822LC for HPC + * IBM OpenPOWER S822LC for HPC #. Identify the machine(s) to be replaced: ``frame10cn02``. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst index 5923a32a5..9399c0405 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -1,11 +1,11 @@ -IBM Power LE / OpenPOWER +IBM POWER LE / OpenPOWER ========================= -Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPower servers. +Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPOWER servers. -IBM OpenPower Servers - * based on Power8 Processor Technology is IPMI managed - * based on Power9 Processor Technology is OpenBmc managed [**Alpha**] +IBM OpenPOWER Servers + * based on POWER8 Processor Technology is IPMI managed + * based on POWER9 Processor Technology is OpenBMC managed [**Alpha**] .. toctree:: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 531266228..6fcd77a1d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -7,11 +7,11 @@ Most enterprise servers do not have video adapters installed with the machine an Configure the correct console management by modifying the node definition: - * For OpenPower, **IPMI** managed server: :: + * For OpenPOWER, **IPMI** managed server: :: chdef -t node -o cons=ipmi - * For OpenPower, **OpenBMC** managed servers: :: + * For OpenPOWER, **OpenBMC** managed servers: :: chdef -t node -o cons=openbmc diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index 74dcc3cac..eb9037303 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -32,7 +32,7 @@ BMC (using IPMI): \ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] -OpenPower BMC (using IPMI): +OpenPOWER BMC (using IPMI): =========================== @@ -41,7 +41,7 @@ OpenPower BMC (using IPMI): \ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] -OpenPower OpenBMC: +OpenPOWER OpenBMC: ================== diff --git a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst index 14cbd3c80..11bbee003 100644 --- a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst +++ b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst @@ -27,7 +27,7 @@ DESCRIPTION *********** -Setting for nodes that are controlled by an on-board OpenBmc. +Setting for nodes that are controlled by an on-board OpenBMC. ******************* diff --git a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst index 4100de4bb..e2cb86603 100644 --- a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst +++ b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst @@ -567,7 +567,7 @@ notification(5)|notification.5 openbmc(5)|openbmc.5 - Setting for nodes that are controlled by an on-board OpenBmc. + Setting for nodes that are controlled by an on-board OpenBMC. diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 21a39166b..2062b7c30 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -71,7 +71,7 @@ xCAT 2.12.x | | | | | +---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.12.3 | | |- GitHub Issues resolved | -|| 2016/09/30 | | |- rinv options for OpenPower | +|| 2016/09/30 | | |- rinv options for OpenPOWER | || | | |- switch based switch discovery | | `2.12.3 Release Notes `_ | | |- Add xCAT Troubleshooting Log | | | | |- xCAT Log Classification | | | | |- RAID Configuration | diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index dc351df6a..65cb35804 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1365,7 +1365,7 @@ sub gen_chain_for_profiles { #run bmcsetups. #PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC. - #But OpenPower need to support bmcsetup + #But OpenPOWER need to support bmcsetup my $nodehmtab = xCAT::Table->new('nodehm'); my $comments = ""; my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hwprofile, ['comments']); diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 50241e8e5..a19207611 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -446,7 +446,7 @@ passed as argument rather than by table value', openbmc => { cols => [qw(node bmc consport taggedvlan username password comments disable)], keys => [qw(node)], - table_desc => 'Setting for nodes that are controlled by an on-board OpenBmc.', + table_desc => 'Setting for nodes that are controlled by an on-board OpenBMC.', descriptions => { node => 'The node name or group name.', bmc => 'The hostname of the BMC adapter.', diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 2093ca5f0..f7db5790b 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -29,10 +29,10 @@ my %usage = ( BMC (using IPMI): rpower noderange [on|off|softoff|reset|boot|stat|state|status|wake|suspend [-w timeout] [-o] [-r]] rpower noderange [pduon|pduoff|pdustat] - OpenPower BMC: + OpenPOWER BMC: rpower noderange [on|off|reset|boot|stat|state|status] rpower noderange [pduon|pduoff|pdustat] - OpenPower OpenBMC: + OpenPOWER OpenBMC: rpower noderange [on|off|reset|boot|stat|state|status] KVM Virtualization specific: rpower [boot] [ -c ] diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index 61e7be87c..fd676c268 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -14,13 +14,13 @@ B I [B|B|B|B|B|B|B I [B|B|B|B] -=head2 OpenPower BMC (using IPMI): +=head2 OpenPOWER BMC (using IPMI): B I [B|B|B|B|B|B|B] B I [B|B|B|B] -=head2 OpenPower OpenBMC: +=head2 OpenPOWER OpenBMC: B I [B|B|B|B|B|B|B] diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index b8208abe8..cb2aba4a5 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -37,7 +37,7 @@ function cold_reset_bmc() { fi if [ "$XPROD" = "309" -o "$XPROD" = "43707" ] ; then if [ "$XPROD" = "43707" ]; then - # OpenPower SPECIFIC, the OpenPower machines with AMI BMC should NOT need a + # OpenPOWER SPECIFIC, the OpenPOWER machines with AMI BMC should NOT need a # reset after applying ipmitool commands. However, it seems there is a problem with # the BMC where after 15 seconds, it stops responding. To work around, sleep 30 # seconds before issuing the reset of the BMC. @@ -49,7 +49,7 @@ function cold_reset_bmc() { fi if [ "$XPROD" = "43707" ]; then - # OpenPower SPECIFIC, check the BMC with the following raw command to + # OpenPOWER SPECIFIC, check the BMC with the following raw command to # make sure that the bmc is really in a "ready" state before continuing SLEEP_INTERVAL=3 MAX_ITERATION=100 @@ -65,7 +65,7 @@ function cold_reset_bmc() { TOTAL_SEC=$((${SLEEP_INTERVAL} * ${MAX_ITERATION})) logger -s -t $log_label -p local4.error "ERROR, After waiting ${TOTAL_SEC} seconds, the BMC is not in a ready state." else - # for Non OpenPower servers, just sleep for some set time. + # for Non OpenPOWER servers, just sleep for some set time. sleep 15 TRIES=0 @@ -82,7 +82,7 @@ function cold_reset_bmc() { # # Function snooze() # -# The purpose of this is to work around the issue with OpenPower BMCs after +# The purpose of this is to work around the issue with OpenPOWER BMCs after # making a change to network configuration, sleep 30 to be sure the changes apply. # function snooze() { @@ -95,8 +95,8 @@ function snooze() { return fi if [ "$XPROD" = "43707" ]; then - # For OpenPower Machines - logger -s -t $log_label -p local4.debug "OpenPower, snooze for 30 seconds..." + # For OpenPOWER Machines + logger -s -t $log_label -p local4.debug "OpenPOWER, snooze for 30 seconds..." sleep 30 else logger -s -t $log_label -p local4.debug "snooze for 1 second..." @@ -167,7 +167,7 @@ logger -s -t $log_label -p local4.info "IPMIVER=$IPMIVER, IPMIMFG=$IPMIMFG, XPRO # # IPMIMFG=2 = IBM -# IPMIMFG=0 = OpenPower +# IPMIMFG=0 = OpenPOWER # IPMIMFG=42817 and XPROD=16975 = OpenBMC # if [ "$IPMIMFG" == 2 ]; then #IBM @@ -416,7 +416,7 @@ if [ ! -z "$ISOPENBMC" ]; then rm -f /tmp/ipmicfg.xml exit $bmc_config_rc fi -# After network commands are issued, pause to allow the BMC to apply (OpenPower) +# After network commands are issued, pause to allow the BMC to apply (OpenPOWER) snooze let idev=NUMBMCS-1 @@ -646,7 +646,7 @@ while [ $idev -gt 0 ]; do logger -s -t $log_label -p local4.info "Lighting Identify Light" if [ "$XPROD" = "43707" -a "$IPMIMFG" = '0' ]; then - # OpenPower BMC specific, turn on the LED beacon light. + # OpenPOWER BMC specific, turn on the LED beacon light. # - default interval, # ipmitool chassis identify # Chassis identify interval: default (15 seconds) # - 275 is too large, # ipmitool chassis identify 275 diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 5d3c15e87..59f70d20a 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2535,7 +2535,7 @@ sub power { my $code; if (($sessdata->{subcommand} !~ /^on$|^off$|^reset$|^boot$|^stat$|^state$|^status$/) and isopenpower($sessdata)) { - xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPower" ], $callback, $sessdata->{node}, %allerrornodes); + xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPOWER" ], $callback, $sessdata->{node}, %allerrornodes); return; } From 1f4cb4e64eb8112305d4248b714286e7828f8d65 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Jun 2017 15:18:46 -0400 Subject: [PATCH 093/201] Development code only warning --- xCAT-server/lib/xcat/plugins/openbmc.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7560ac0d5..6777b96aa 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -463,6 +463,10 @@ sub parse_args { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "rflash") { + # + # disable function until fully tested + # + $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } my $filename_passed = 0; foreach my $opt (@$extrargs) { # Only files ending on .tar are allowed From b8fdb3c890b45bca869c71aef523e03987524f83 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Sat, 3 Jun 2017 03:24:16 +0000 Subject: [PATCH 094/201] #2939: Add `-d` option alias for `makeknownhosts -r` --- xCAT-client/pods/man8/makeknownhosts.8.pod | 10 ++++-- xCAT-server/lib/xcat/plugins/00kitnodebase.pm | 2 +- .../lib/xcat/plugins/makeknownhosts.pm | 33 +++++++------------ .../autotest/testcase/makeknownhosts/cases0 | 12 +++++++ 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/xCAT-client/pods/man8/makeknownhosts.8.pod b/xCAT-client/pods/man8/makeknownhosts.8.pod index 612c04b7e..99047d1cb 100644 --- a/xCAT-client/pods/man8/makeknownhosts.8.pod +++ b/xCAT-client/pods/man8/makeknownhosts.8.pod @@ -4,7 +4,7 @@ B - Make a known_hosts file under $ROOTHOME/.ssh for input noder =head1 SYNOPSIS -B I [B<-r>|B<--remove>] [B<-V>|B<--verbose>] +B I [B<-r>|B<--remove>|B<-d>|B<--delete>] [B<-V>|B<--verbose>] B [B<-h>|B<--help>] @@ -29,10 +29,14 @@ The file should be distributed using B to all the nodes, if you want node A set of comma delimited node names and/or group names. See the I man page for details on supported formats. -=item B<-r|--remove> +=item B<-d|--delete> Only removes the entries for the nodes from the known_hosts file. +=item B<-r|--remove> + +Synonymous to B<-d|--delete>. + =item B<-V|--verbose> Verbose mode. @@ -56,7 +60,7 @@ To build the known_hosts entry for the nodes in the lpars and service groups =item 3. To remove the known_hosts entry for node02 - makeknownhosts node02 -r + makeknownhosts node02 -d =back diff --git a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm index 4eb76eacb..256ce90a3 100644 --- a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm +++ b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm @@ -130,7 +130,7 @@ sub process_request { if ($runconservercmd) { push @commandslist, [ 'makeconservercf', '-d' ]; } - push @commandslist, [ 'makeknownhosts', '-r' ]; + push @commandslist, [ 'makeknownhosts', '-d' ]; if ($macflag) { push @commandslist, [ 'makedhcp', '-d' ]; } diff --git a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm index ef15946a3..8779b257a 100644 --- a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm +++ b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm @@ -65,13 +65,14 @@ sub process_request if ($request && $request->{arg}) { @ARGV = @{ $request->{arg} }; } else { @ARGV = (); } - my $usage = "Usage: makeknownhosts [-r] [-V]\n makeknownhosts -h"; + my $usage = "Usage: makeknownhosts [-r|-d] [-V]\n makeknownhosts -h"; # print "argv=@ARGV\n"; if (!GetOptions( 'h|help' => \$::opt_h, 'V|verbose' => \$::opt_V, 'r|remove' => \$::opt_r + 'd|delete' => \$::opt_d )) { my $rsp = {}; @@ -81,23 +82,22 @@ sub process_request } # display the usage if -h - if ($::opt_h) - { + if ($::opt_h) { my $rsp = {}; $rsp->{data}->[0] = $usage; xCAT::MsgUtils->message("I", $rsp, $callback, 1); return 0; } - if ($nodes eq "") - { # no noderange + if ($nodes eq "") { + # no noderange my $rsp = {}; $rsp->{data}->[0] = "The Noderange is missing."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; } my $hostkey = "/etc/xcat/hostkeys/ssh_host_rsa_key.pub"; - if (!(-e $hostkey)) - { # the key is missing, cannot create known_hosts + if (!(-e $hostkey)) { + # the key is missing, cannot create known_hosts my $rsp = {}; $rsp->{data}->[0] = "The keyfile:$hostkey is missing. Cannot create the known_hosts file."; @@ -107,35 +107,28 @@ sub process_request # Backup the existing known_hosts file to known_hosts.backup $rc = backup_known_hosts_file($callback); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error backing up known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; - } # Remove the nodes from knownhosts file $rc = remove_nodes_from_knownhosts($callback, $nodes); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error backing up known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; - } # if -r flag is not specified, adding the nodes back to known_hosts file - if (!$::opt_r) - { + if (!($::opt_r or $::opt_d)) { my @nodelist = @$nodes; - foreach my $node (@nodelist) - { + foreach my $node (@nodelist) { $rc = add_known_host($node, $callback); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error building known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); @@ -153,8 +146,6 @@ sub process_request Backs up the old known_hosts file in roots .ssh directory, if it exists. - - =cut #------------------------------------------------------- diff --git a/xCAT-test/autotest/testcase/makeknownhosts/cases0 b/xCAT-test/autotest/testcase/makeknownhosts/cases0 index 3e7e2e512..afe1e371d 100644 --- a/xCAT-test/autotest/testcase/makeknownhosts/cases0 +++ b/xCAT-test/autotest/testcase/makeknownhosts/cases0 @@ -28,6 +28,18 @@ check:rc!=0 check:output!~$$CN end +start:makeknownhosts_node_d +description:delete known node entry from $ROOTHOME/.ssh +cmd:makeknownhosts $$CN +cmd:cat ~/.ssh/known_hosts|grep $$CN +check:output=~$$CN +cmd:makeknownhosts $$CN -d +check:rc==0 +cmd:cat ~/.ssh/known_hosts|grep $$CN +check:rc!=0 +check:output!~$$CN +end + start:makeknownhosts_node_v description:verbose cmd:makeknownhosts $$CN -V From 1cac6a2db3c560c1562886e8eab2a2cc6f1ecc2e Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 5 Jun 2017 00:26:44 -0400 Subject: [PATCH 095/201] Add rvitals test cases to pegas+p9 bundle --- .../autotest/bundle/rhels7.4-pegas_ppc64le.bundle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle index 74a0d4803..c80880576 100644 --- a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle @@ -41,5 +41,15 @@ rspconfig_gateway rspconfig_gateway_invalid rspconfig_node_invalid rspconfig_ip_null +rvitals_h +rvitals_v +rvitals_errorcommand +rvitals_noderange_err +rvitals_temp +rvitals_voltage +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_all reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat From d6266b9aaf605c43fb0b7651bf12696c6f164b3e Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Mon, 5 Jun 2017 13:14:02 +0800 Subject: [PATCH 096/201] fix issue 2797 and enhance confignetwork (#3169) * to return non-zero when error * fix a potential issue when nicdevice is wrong for bond definition. --- xCAT/postscripts/confignetwork | 167 ++++++++++++++++++--------------- xCAT/postscripts/nicutils.sh | 4 +- 2 files changed, 94 insertions(+), 77 deletions(-) diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 702fd5b2d..80ef76c1a 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -215,93 +215,94 @@ function find_nic_and_device_list { # ############################################################################### function sort_nics_device_order { + all_nics_list=$* eth_slot="" bond_slot="" vlan_slot="" num=1 - alone_nics=`echo "$all_nics_list"|awk '{if(01) print $0}'` - + #find stand alone nic num1=1 max1=`echo "$alone_nics"|wc -l` ((max1+=1)) while [ $num1 -lt $max1 ]; do - alonenic=`echo "$alone_nics"|sed -n "${num1}p"` + alonenic=`echo "$alone_nics"|sed -n "${num1}p"|sed "s/ //g"` echo "$nics_list"| grep "$alonenic" >/dev/null if [ $? -ne 0 ]; then echo $alonenic fi ((num1+=1)) done - # - num=1 - max=`echo "$nics_list"|wc -l` - ((max+=1)) - while [ $num -lt $max ]; - do - #for each nic and nicdevice : nic_dev base_nic_dev - #find nic type as nic_dev_type - #find nicdevice type as base_nic_type - base_nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $2}'` - if echo "$base_nic_dev"|grep "@" >/dev/null; then - for i in `echo "$base_nic_dev" |sed 's/@/ /g'` - do - temp_base_nic_type=`find_nic_type "$i"` - if [ x"$temp_base_nic_type_one" = x ]; then - temp_base_nic_type_one=$temp_base_nic_type - elif [ x"$temp_base_nic_type" != x"$temp_base_nic_type_one" ]; then - log_error "different nic device types in $base_nic_dev." - break 2 - fi - done - else - temp_base_nic_dev=$base_nic_dev - temp_base_nic_type=`find_nic_type "$temp_base_nic_dev"` - fi + if [ -n "$nics_list" ]; then + num=1 + max=`echo "$nics_list"|wc -l` + ((max+=1)) + while [ $num -lt $max ]; + do + #for each nic and nicdevice : nic_dev base_nic_dev + #find nic type as nic_dev_type + #find nicdevice type as base_nic_type + base_nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $2}'` + if echo "$base_nic_dev"|grep "@" >/dev/null; then + for i in `echo "$base_nic_dev" |sed 's/@/ /g'` + do + temp_base_nic_type=`find_nic_type "$i" | $utolcmd` + if [ x"$temp_base_nic_type_one" = x ]; then + temp_base_nic_type_one=$temp_base_nic_type + elif [ x"$temp_base_nic_type" != x"$temp_base_nic_type_one" ]; then + log_error "different nic device types in $base_nic_dev." + break 2 + fi + done + else + temp_base_nic_dev=$base_nic_dev + temp_base_nic_type=`find_nic_type "$temp_base_nic_dev" | $utolcmd` + fi - base_nic_type=$temp_base_nic_type - nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $1}'` - nic_dev_type=`find_nic_type "$nic_dev"` + base_nic_type=$temp_base_nic_type + nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $1}'` + nic_dev_type=`find_nic_type "$nic_dev" | $utolcmd` - #valid nic_dev and base_nic_dev pair as bond-ethernet or vlan-ethernet or bridge-ethernet - if [ x"$base_nic_type" = "xethernet" ]&& \ - [ x"$nic_dev_type" = "xbond" -o x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + #valid nic_dev and base_nic_dev pair as bond-ethernet or vlan-ethernet or bridge-ethernet + if [ x"$base_nic_type" = "xethernet" ]&& \ + [ x"$nic_dev_type" = "xbond" -o x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - if [ x"$eth_slot" = x ]; then - eth_slot=$num + if [ x"$eth_slot" = x ]; then + eth_slot=$num + else + eth_slot=$eth_slot" "$num + fi + + #valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond + elif [ x"$base_nic_type" = "xbond" ]&& \ + [ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + + if [ x"$bond_slot" = x ]; then + bond_slot=$num + else + bond_slot=$bond_slot" "$num + fi + + #valid nic_dev and base_nic_dev pair as bridge-vlan + elif [ x"$base_nic_type" = "xvlan" ]&& \ + [ x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + + if [ x"$vlan_slot" = x ]; then + vlan_slot=$num + else + vlan_slot=$vlan_slot" "$num + fi else - eth_slot=$eth_slot" "$num + echo "Error: $nic_dev $base_nic_dev pair is invalid nic and nicdevice pair." fi - - #valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond - elif [ x"$base_nic_type" = "xbond" ]&& \ - [ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - - if [ x"$bond_slot" = x ]; then - bond_slot=$num - else - bond_slot=$bond_slot" "$num - fi - - #valid nic_dev and base_nic_dev pair as bridge-vlan - elif [ x"$base_nic_type" = "xvlan" ]&& \ - [ x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - - if [ x"$vlan_slot" = x ]; then - vlan_slot=$num - else - vlan_slot=$vlan_slot" "$num - fi - else - log_error "Error: $nic_dev $base_nic_dev pair is invalid nic and nicdevice pair." - fi - ((num+=1)) - done + ((num+=1)) + done + fi new_order=$eth_slot" "$bond_slot" "$vlan_slot new_order_list="" if [ -n "$new_order" ]; then @@ -312,7 +313,6 @@ function sort_nics_device_order { echo "$nics_list" |sed -n "${i}p" done` fi - echo "$new_order_list" } @@ -326,15 +326,13 @@ function sort_nics_device_order { ################################################################################### function configure_nicdevice { nics_pair=$* - #nictypes support capital letters, for example, Ethernet and ethernet - #use $utolcmd to transform capital to lower case - utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" #configure nic and its device pair one by one num=1 max=`echo "$nics_pair"|wc -l` base_temp_nic="" base_nic_for_bond="" line_num="" + noip=1 ((max+=1)) while [ $num -lt $max ]; do @@ -354,22 +352,25 @@ function configure_nicdevice { echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" - #configure standalone ethernet nic if [ x"$nic_dev_type" = "xethernet" ]; then - + ipaddr=`find_nic_ips $nic_dev|awk -F"|" '{print $1}'` if [ -n "$ipaddr" ]; then create_ethernet_interface ifname=$nic_dev _ipaddr=$ipaddr else - log_error "There is no ip for $nic_dev." + log_warn "There is no ip for $nic_dev." + ((noip+=1)) fi - + #All Ethernet nics have no nicips + if [ $noip -eq $max ]; then + log_error "There is no any ip configured for any nic. Check nicips in nics table first." + errorcode=1 + fi #configure bridge #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type #configure vlan @@ -388,10 +389,12 @@ function configure_nicdevice { create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond else log_error "Error : please check nictypes for $nic_pair." + errorcode=1 fi ((num+=1)) done + return $errorcode } ############################################################################ @@ -420,6 +423,11 @@ function enable_network_service { # ############################################################################ +errorcode=0 + +#nictypes should support capital letters, for example, Ethernet and ethernet +utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" + #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` @@ -449,10 +457,19 @@ enable_network_service #sort nics device pair based on nicdevice type sorted_nicdevice_list=`sort_nics_device_order "$new_nicdevice"` + +#If there is invalid nics pair, errorcode is 1 +invalid_nicdevice_pair=`echo "$sorted_nicdevice_list" | grep "Error"` +if [ $? -eq 0 ]; then +log_error $invalid_nicdevice_pair +errorcode=1 +fi + +#delete invalid nics device pair based on Error +valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d'` log_info "All valid nics and device list:" -echo "$sorted_nicdevice_list" |log_lines info - - +echo "$valid_sorted_nicdevice_list" |log_lines info #config nics and ifcfg files -configure_nicdevice "$sorted_nicdevice_list" +configure_nicdevice "$valid_sorted_nicdevice_list" +exit $errorcode diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index d9abe01eb..73c4711f9 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -635,11 +635,11 @@ function add_br() { BRIDGE=$2 if [[ $BRIDGE == "bridge_ovs" ]]; then - type brctl >/dev/null 2>/dev/null || echo "There is no ovs-vsctl" >&2 && exit 1 + type brctl >/dev/null 2>/dev/null || (echo "There is no ovs-vsctl" >&2 && exit 1) log_info "ovs-vsctl add-br $BNAME" ovs-vsctl add-br $BNAME elif [[ $BRIDGE == "bridge" ]]; then - type brctl >/dev/null 2>/dev/null || echo "There is no brctl" >&2 && exit 1 + type brctl >/dev/null 2>/dev/null || (echo "There is no brctl" >&2 && exit 1) log_info "brctl addbr $BNAME" brctl addbr $BNAME log_info "brctl stp $BNAME on" From 3bfa5af98a600dcf9e21e29998d7f1c74f0f59a2 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Mon, 5 Jun 2017 13:44:08 +0800 Subject: [PATCH 097/201] add -r alias -d for makeknownhosts (#3186) --- .../admin-guides/references/man8/makeknownhosts.8.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst index 8dad0e800..495704d9c 100644 --- a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -d | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] \ **makeknownhosts**\ [\ **-h | -**\ **-help**\ ] @@ -53,7 +53,7 @@ OPTIONS -\ **-r|-**\ **-remove**\ +\ **-r| -d| -**\ **-remove**\ Only removes the entries for the nodes from the known_hosts file. @@ -98,6 +98,10 @@ EXAMPLES .. code-block:: perl makeknownhosts node02 -r + + or + + makeknownhosts node02 -d From 8196fd491455552f489843cdc0dcdb4c15c14510 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 5 Jun 2017 13:52:31 +0800 Subject: [PATCH 098/201] Add more verifications --- xCAT-test/autotest/testcase/migration/redhat_migration | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 6ce3b9432..f3817dd47 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -72,10 +72,11 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -97,6 +98,8 @@ check:rc==0 check:output=~running cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 @@ -184,10 +187,11 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -207,6 +211,8 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running +cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 From bf5fa8d11854ccff78d310943cd8aeda5dd1b179 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Mon, 5 Jun 2017 06:45:29 -0400 Subject: [PATCH 099/201] modify rvitals_voltage test,for openbmc testcases do not need to add hcp attributes --- xCAT-test/autotest/testcase/rvitals/cases0 | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 348c0caa3..9e759843d 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -46,7 +46,6 @@ end start:rvitals_voltage description:Retrieves power supply and VRM voltage readings Attribute: $$CN-The operation object of rvitals command -hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN voltage check:rc==0 check:output=~Frame Voltages|CPU VDD Volt|SysBrd From d861f68995d73f27dce5354c660798a07f6973e2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 5 Jun 2017 10:56:59 -0400 Subject: [PATCH 100/201] Sync usage, man and code for ipmi rvitals --- .../ppc64le/management/basic/rcons.rst | 2 +- .../admin-guides/references/man1/rvitals.1.rst | 8 +++++++- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rvitals.1.pod | 6 +++++- xCAT-server/lib/xcat/plugins/ipmi.pm | 16 ++++++++-------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 6fcd77a1d..396880103 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -46,7 +46,7 @@ The xCAT ``rcons`` command relies on conserver (http://www.conserver.com/). The OpenBMC Specific -``````````````` +```````````````` #. For OpenBMC managed servers, the root user must be able to ssh passwordless to the BMC for the ``rcons`` function to work. diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index c6a84c704..7fa7e62d6 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -60,7 +60,7 @@ OpenPOWER (IPMI) specific: ========================== -\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | all**\ ] +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | chassis | all**\ ] OpenPOWER (OpenBMC) specific: @@ -140,6 +140,12 @@ Processor for a single or range of nodes and groups. +\ **chassis**\ + + Retrieves chassis status. + + + \ **altitude**\ Retrieves altitude related attributes. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index f7db5790b..b93c5d788 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -82,7 +82,7 @@ my %usage = ( BMC specific: rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} OpenPOWER (IPMI) specific: - rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] + rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|chassis|all] OpenPOWER (OpenBMC) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index bb7fec138..fb246eb40 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -28,7 +28,7 @@ B I {B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B|B] =head2 OpenPOWER (OpenBMC) specific: @@ -79,6 +79,10 @@ Retrieves rack environmentals. Retrieves LEDs status. +=item B + +Retrieves chassis status. + =item B Retrieves altitude related attributes. diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 59f70d20a..a096071a7 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -6506,30 +6506,30 @@ sub vitals { $sensor_filters{leds} = 1; $doall = 1; } - if (grep /temp/, @textfilters) { + if (grep /^temp$/, @textfilters) { $sensor_filters{0x01} = 1; } - if (grep /volt/, @textfilters) { + if (grep /^voltage$/, @textfilters) { $sensor_filters{0x02} = 1; } - if (grep /watt/, @textfilters) { + if (grep /^wattage$/, @textfilters) { $sensor_filters{watt} = 1; } - if (grep /fan/, @textfilters) { + if (grep /^fanspeed$/, @textfilters) { $sensor_filters{0x04} = 1; } - if (grep /power/, @textfilters) { #power does not really include energy, but most people use 'power' to mean both + if (grep /^power$/, @textfilters) { #power does not really include energy, but most people use 'power' to mean both $sensor_filters{0x03} = 1; $sensor_filters{powerstate} = 1; $sensor_filters{energy} = 1; } - if (grep /energy/, @textfilters) { + if (grep /^energy$/, @textfilters) { $sensor_filters{energy} = 1; } - if (grep /led/, @textfilters) { + if (grep /^leds$/, @textfilters) { $sensor_filters{leds} = 1; } - if (grep /chassis/, @textfilters) { + if (grep /^chassis$/, @textfilters) { $sensor_filters{chassis} = 1; } unless (keys %sensor_filters) { From 551e9a0f483483a3f66348317887843d8de9bf0f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 5 Jun 2017 11:36:27 -0400 Subject: [PATCH 101/201] Spelling fixes for install guides --- docs/source/guides/install-guides/common_sections.rst | 4 ++-- .../guides/install-guides/maintenance/uninstall_xcat.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index e9f7cc87e..203b6cea9 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -37,11 +37,11 @@ xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` * **Latest Release (Stable) Builds** - *This is the latest GA (Generally Availability) build that has been tested throughly* + *This is the latest GA (Generally Availability) build that has been tested thoroughly* * **Latest Snapshot Builds** - *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested throughly* + *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested thoroughly* * **Development Builds** diff --git a/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst b/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst index bfc60691f..6e343f834 100644 --- a/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst +++ b/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst @@ -58,7 +58,7 @@ Remove xCAT Files dpkg -l | awk '/xcat/ { print $2 }' - If you want to remove more cleanly, the list bleow maybe helpful. Listed are the packages of xcat installation tarball. Some RPMs may not to be installed in a specific environment. + If you want to remove more cleanly, the list below maybe helpful. Listed are the packages of xcat installation tarball. Some RPMs may not to be installed in a specific environment. * XCAT Core Packages list (xcat-core): From 1d2bac4a2a05ce1286ac591bcb0baf8b84b1c4ed Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 5 Jun 2017 13:44:15 -0400 Subject: [PATCH 102/201] Fix typo associated with pull request #3180 --- xCAT-server/lib/xcat/plugins/makeknownhosts.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm index 8779b257a..f5efe5390 100644 --- a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm +++ b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm @@ -71,7 +71,7 @@ sub process_request if (!GetOptions( 'h|help' => \$::opt_h, 'V|verbose' => \$::opt_V, - 'r|remove' => \$::opt_r + 'r|remove' => \$::opt_r, 'd|delete' => \$::opt_d )) { From a2f2eaf0e76cea2ba457682631c855df2c46ccb4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 5 Jun 2017 20:05:00 -0400 Subject: [PATCH 103/201] Change bmcdiscover to look at system information instead of motherboard information for the MTM/Serial Number. Use variables for building up then endpoint for OpenBMC --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 28 +++++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 36f086c74..0811f73fe 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1046,30 +1046,42 @@ sub bmcdiscovery_openbmc{ my $request_command = shift; my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); + my $http_protocol="https"; + my $openbmc_project_url = "xyz/openbmc_project"; + my $login_endpoint = "login"; + my $system_endpoint = "inventory/system"; + my $node_data = $ip; my $brower = LWP::UserAgent->new( ssl_opts => { SSL_verify_mode => 0x00, verify_hostname => 0 }, ); my $cookie_jar = HTTP::Cookies->new(); my $header = HTTP::Headers->new('Content-Type' => 'application/json'); - my $url = "https://$ip/login"; my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; $brower->cookie_jar($cookie_jar); + + my $url = "$http_protocol://$ip/$login_endpoint"; my $login_request = HTTP::Request->new( 'POST', $url, $header, $data ); my $login_response = $brower->request($login_request); if ($login_response->is_success) { - my $req_url = "https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard"; - my $req = HTTP::Request->new('GET', $req_url, $header); + $url = "$http_protocol://$ip/$openbmc_project_url/$system_endpoint"; + my $req = HTTP::Request->new('GET', $url, $header); my $req_output = $brower->request($req); return if ($req_output->is_error); my $response = decode_json $req_output->content; my $mtm; my $serial; - if (defined($response->{data}) and defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{Model}; - $serial = $response->{data}->{SerialNumber}; - } else { - xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); + if (defined($response->{data})) { + if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{Model}; + $serial = $response->{data}->{SerialNumber}; + } else { + xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); + return; + } + + } else { + xCAT::MsgUtils->message("E", { data => ["Unable to connect to REST server at $ip"] }, $::CALLBACK); return; } From 7c54b60b8add8394dad71dde463d3455b78541e0 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 5 Jun 2017 21:25:03 -0400 Subject: [PATCH 104/201] add -y when run yum install git --- xCAT-test/autotest/testcase/simulator/setup_simulator | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index f2549cca3..6a4bb71f6 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -3,12 +3,12 @@ description:install dependent packaages, setup and start openbmc simulator cmd:#!/bin/bash os=`cat /etc/*release*` if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git + yum install git -y if [ $? != 0 ]; then exit 1 fi elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git + apt-get install git -y if [ $? != 0 ]; then exit 1 fi From b0fece290757f562179c32bbbfc465fff9561b86 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 5 Jun 2017 21:40:08 -0400 Subject: [PATCH 105/201] modify format of error msg for 2200 port to hash according to other msg --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 36f086c74..3a99ded8a 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -594,7 +594,9 @@ sub scan_process { bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command); } } else { - xCAT::MsgUtils->message("E", "Can not get status of 2200 port.", $::CALLBACK); + my $rsp = {}; + push @{ $rsp->{data} }, "Can not get status of 2200 port for ip ${$live_ip}[$i].\n"; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); exit 1; } From 5215b690f99b744fb10b8fd2d71bd7cf83b0f6ac Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 6 Jun 2017 02:47:52 -0400 Subject: [PATCH 106/201] Modify one bug:Use of implicit split to @_ is deprecated at xcattest line 1059 --- xCAT-test/xcattest | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 2bcbd7956..00133e425 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1056,9 +1056,9 @@ sub load_case { #log_this($running_log_fd, "Miss attribute:", @{$invalidcases{"missattr"}}); $$error_ref = "Miss attribute: " . join(",", @{ $invalidcases{"missattr"} }); foreach my $line (@{ $invalidcases{"missattr"} }) { - my $name = split(" ", $line); - if (!(grep /$name/, @wrong_cases)) { - push @wrong_cases, $name; + my @name = split(" ", $line); + if (!(grep /$name[0]/, @wrong_cases)) { + push @wrong_cases, $name[0]; } } $caseerror = 1; From f1b406dbc03c611743a7b1740537223544724d82 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Sat, 25 Mar 2017 17:30:59 +0000 Subject: [PATCH 107/201] Reduce `grep` invocations by passing `-[46]` to `ip` --- perl-xCAT/xCAT/Client.pm | 2 +- xCAT-OpenStack/postscripts/configgw | 2 +- xCAT-client/bin/rcons | 2 +- xCAT-genesis-builder/dhclient-script | 2 +- xCAT-genesis-scripts/bin/dodiscovery | 8 ++++---- xCAT-genesis-scripts/bin/doxcat | 6 +++--- xCAT-probe/subcmds/xcatmn | 2 +- xCAT-server/sbin/xcatd | 2 +- xCAT-server/share/xcat/install/scripts/post.rh.common | 6 +++--- xCAT-server/share/xcat/install/scripts/post.ubuntu.common | 4 ++-- xCAT-server/share/xcat/tools/detect_dhcpd | 2 +- xCAT/postscripts/hardeths | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index 079a62155..d7df0a9fc 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -33,7 +33,7 @@ if ($inet6support) { if ($^O =~ /^linux/i) { # Is IPv6 enabled on the MN or xcat client node at all? - my $ipv6enabled = `ip addr 2> /dev/null | grep inet6`; + my $ipv6enabled = `ip -6 -o addr 2> /dev/null`; if (!$ipv6enabled) { $inet6support = 0; } diff --git a/xCAT-OpenStack/postscripts/configgw b/xCAT-OpenStack/postscripts/configgw index 36c246eaf..e2b97be77 100755 --- a/xCAT-OpenStack/postscripts/configgw +++ b/xCAT-OpenStack/postscripts/configgw @@ -9,7 +9,7 @@ if [ -z "$1" ];then fi str_nic_name=$1 -str_ip_mask=`ip addr show dev $str_nic_name | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1` +str_ip_mask=`ip -4 -o addr show dev $str_nic_name | awk '{print $4}' | head -n 1` str_ip=`echo $str_ip_mask | awk -F'/' '{print $1}'` str_mask=`echo $str_ip_mask | awk -F'/' '{print $2}'` diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 2fa148d6a..20c7da036 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -87,7 +87,7 @@ if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/ fi if [ -z "$CONSERVER" ]; then CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '` - declare -a ipaddrs=`ip addr | grep 'inet' | awk {'print $2'} | cut -d/ -f1 | grep -v : | tr '\n' ' '` + declare -a ipaddrs=`ip -o a | awk {'print $4'} | cut -d/ -f1 | grep -v : | tr '\n' ' '` for IP in ${ipaddrs[*]}; do if [[ "${CONSERVER}" == "${IP}" ]]; then # conserver is the same node, do not connect using -s diff --git a/xCAT-genesis-builder/dhclient-script b/xCAT-genesis-builder/dhclient-script index fcf51c9ac..21c1e0e76 100755 --- a/xCAT-genesis-builder/dhclient-script +++ b/xCAT-genesis-builder/dhclient-script @@ -14,7 +14,7 @@ elif [ $reason = "BOUND" ]; then if [ ! -z "$old_ip_address" ]; then ip addr del dev $interface $old_ip_address/$old_subnet_mask fi - for oldip in `ip addr show dev $interface|grep 'inet '|awk '{print $2}'`; do + for oldip in `ip -o addr show dev $interface|awk '{print $4}'`; do ip addr del dev $interface $oldip done if [ ! -z "$new_ip_address" -a ! -z "$new_subnet_mask" ]; then diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index f33ef9c3d..5c3591c00 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -25,11 +25,11 @@ logger -s -t $log_label -p local4.info "Waiting for nics to get addresses" while [ ! -z "$NICSGETTINGADDR" -a $timewaiting != 700 ]; do NEWNICSGETTINGADDR="" for nic in $NICSGETTINGADDR; do - if ! ip addr show dev $nic |grep -v inet6|grep inet >/dev/null; then + if ! ip -4 -o a show dev $nic |grep -q inet; then NEWNICSGETTINGADDR="$NEWNICSGETTINGADDR $nic" else echo -n "$nic|" - ip addr show dev $nic |grep -v inet6|grep inet|sed -e s/\\/.*//|awk '{print $2}' + ip -4 -o addr show dev $nic | awk '{print $4}' | sed -e sX/.*XX fi done sleep 0.1 @@ -187,8 +187,8 @@ for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://|grep -v ONBOARDINDEX="" DRIVER=`grep DRIVER /sys/class/net/$dev/device/uevent|awk -F= '{print $2}'` PCI_SLOT=`grep PCI_SLOT_NAME /sys/class/net/$dev/device/uevent|awk -F= '{print $2}'` - ADDRESS=`ip address show dev $dev|grep "inet "|grep global|awk '{print $2}'` - MAC=`ip link show dev $dev|grep ether|awk '{print $2}'| tr /a-f/ /A-F/` + ADDRESS=`ip -4 -o a show dev $dev|awk '/global/{print $4}'` + MAC=`ip -o l show dev $dev|awk '/ether/{print $15}'| tr /a-f/ /A-F/` if [ "$MAC_OF_FIRST_UP_NIC" == "unknown" ]; then MAC_OF_FIRST_UP_NIC=`echo $MAC | sed -e s/://g` fi diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 88f86890d..b95a0e0e1 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -212,7 +212,7 @@ else tries=0 while [ -z "$bootnic" ]; do for tmp1 in $ALLUP_NICS; do - if ip addr show dev $tmp1|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; then + if ip -4 -o a show dev $tmp1|grep -v 'scope link'|grep -v 'dynamic'|grep -q inet ; then result=`ping -c1 -I $tmp1 $XCATMASTER 2>&1` if [ $? -eq 0 ]; then logger -s -t $log_label -p local4.info "the nic $tmp1 can ping $XCATMASTER" @@ -247,7 +247,7 @@ else gripeiter=101 logger -s -t $log_label -p local4.info "Acquiring network addresses.." - while ! ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; do + while ! ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -q inet; do sleep 0.1 if [ $gripeiter = 1 ]; then logger -s -t $log_label -p local4.info "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..." @@ -261,7 +261,7 @@ openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" -ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' +ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|awk '{print $4}' logger -s -t $log_label -p local4.info "Starting ntpd..." ntpd -g -x diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index d192ae60d..e7867d51c 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -387,7 +387,7 @@ sub check_network { # on SN, get ip address by compare 'master' attribute in 'site' table # choose the one in the same network with 'master' - my @ipoutput = `ip addr show 2>&1| grep inet | grep -v inet6`; + my @ipoutput = `ip -4 a show 2>&1| grep inet`; foreach (@ipoutput) { if ($_ =~ /inet\s+(.+)\/(.+)\s+brd\s+(.+)\s+scope global/i) { if (xCAT::NetworkUtils::isInSameSubnet($sitetable_ref->{master}, $1, $2, 1)) { diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 8132fad96..99792c097 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -97,7 +97,7 @@ if ($inet6support) { if ($^O =~ /^linux/i) { # Is IPv6 enabled on the MN or SN at all? - my $ipv6enabled = `ip addr | grep inet6`; + my $ipv6enabled = `ip -6 -o a`; if (!$ipv6enabled) { $inet6support = 0; } diff --git a/xCAT-server/share/xcat/install/scripts/post.rh.common b/xCAT-server/share/xcat/install/scripts/post.rh.common index e3f570030..d9cd19a5a 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh.common +++ b/xCAT-server/share/xcat/install/scripts/post.rh.common @@ -39,12 +39,12 @@ elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-F fi #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') -IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') -if [ -z $IP ] +IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') +if [ -z "$IP" ] then dhclient $PRINIC #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') - IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') + IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') fi export HOSTNAME=$(host $IP 2>/dev/null | awk '{print $5}' | awk -F. '{print $1}') diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu.common b/xCAT-server/share/xcat/install/scripts/post.ubuntu.common index 7d1fa02a7..c937a7273 100755 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu.common +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu.common @@ -22,12 +22,12 @@ elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-F export PRINIC=`ip -o link|grep -i "$PRINIC" |awk '{print $2}'|sed s/://` fi #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') -IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') +IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') if [ -z $IP ] then dhclient $PRINIC #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') - IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') + IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') fi if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then diff --git a/xCAT-server/share/xcat/tools/detect_dhcpd b/xCAT-server/share/xcat/tools/detect_dhcpd index 1769ba5f1..7003dc297 100755 --- a/xCAT-server/share/xcat/tools/detect_dhcpd +++ b/xCAT-server/share/xcat/tools/detect_dhcpd @@ -46,7 +46,7 @@ $start =~ s/(\d.*)\.(\d.*)/$1/; if (!$nic) { print "specify a nic\n"; print $::USAGE; exit 1; } #my $IP = `ifconfig $nic | grep "inet addr" | awk '{print \$2}' | awk -F: '{print \$2}'`; -my $IPADDRMASK = `ip addr show dev $nic | grep inet | grep -v inet6 | awk '{print \$2}' | head -n 1`; +my $IPADDRMASK = `ip -4 -o a show dev $nic | awk '/inet/{print \$4}' | head -n 1`; my ($IP, $MASK) = split(/\//, $IPADDRMASK); my $MAC; my $tmpMAC; diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index 0d51de150..da2880bb1 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -88,7 +88,7 @@ if [ ! -z $HOSTNAMECTL ] && [ ! -z $NODE ]; then fi for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do - IPADDRMASK=`ip addr show dev $nic | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1` + IPADDRMASK=`ip -4 -o a sh dev $nic | awk '/inet/{print $4}' | head -n 1` IPADDR=`echo $IPADDRMASK | awk -F'/' '{print $1}'` [ -z $IPADDR ] && continue PREFIXMASK=`echo $IPADDRMASK | awk -F'/' '{print $2}'` From ae09fdfe6de51bf08fdf5f3ceb1b9a991c076165 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 6 Jun 2017 13:04:41 -0400 Subject: [PATCH 108/201] Spelling for man1 and some formatting fixes --- .../restapi_resource/restapi_reference.rst | 32 +++++++++---------- docs/source/developers/github/change_code.rst | 2 +- .../ppc64le/management/basic/rcons.rst | 2 +- .../references/man1/bmcdiscover.1.rst | 4 +-- .../admin-guides/references/man1/cfgve.1.rst | 2 +- .../admin-guides/references/man1/chvm.1.rst | 6 ++-- .../references/man1/csm2xcat.1.rst | 2 +- .../references/man1/db2sqlsetup.1.rst | 2 +- .../references/man1/dumpxCATdb.1.rst | 4 +-- .../references/man1/genimage.1.rst | 2 +- .../references/man1/geninitrd.1.rst | 6 ++-- .../references/man1/getadapter.1.rst | 4 +-- .../references/man1/getmacs.1.rst | 12 +++---- .../references/man1/groupfiles4dsh.1.rst | 2 +- .../references/man1/imgexport.1.rst | 2 +- .../references/man1/imgimport.1.rst | 2 +- .../references/man1/liteimg.1.rst | 2 +- .../references/man1/lsflexnode.1.rst | 2 +- .../references/man1/lskitcomp.1.rst | 2 +- .../admin-guides/references/man1/lsslp.1.rst | 14 ++++---- .../admin-guides/references/man1/lstree.1.rst | 2 +- .../admin-guides/references/man1/lsvm.1.rst | 2 +- .../admin-guides/references/man1/mkdef.1.rst | 4 +-- .../references/man1/mkdocker.1.rst | 4 +-- .../references/man1/mkdsklsnode.1.rst | 6 ++-- .../references/man1/mknimimage.1.rst | 12 +++---- .../admin-guides/references/man1/mkvm.1.rst | 6 ++-- .../admin-guides/references/man1/monadd.1.rst | 4 +-- .../admin-guides/references/man1/moncfg.1.rst | 4 +-- .../references/man1/mondecfg.1.rst | 2 +- .../admin-guides/references/man1/monls.1.rst | 8 ++--- .../references/man1/monshow.1.rst | 2 +- .../references/man1/monstart.1.rst | 2 +- .../references/man1/nimnodecust.1.rst | 4 +-- .../references/man1/nimnodeset.1.rst | 13 ++++---- .../references/man1/nodeaddunmged.1.rst | 2 +- .../references/man1/nodechmac.1.rst | 2 +- .../references/man1/nodechprofile.1.rst | 2 +- .../references/man1/nodediscoverls.1.rst | 2 +- .../references/man1/nodediscoverstart.1.rst | 6 ++-- .../references/man1/nodediscoverstatus.1.rst | 2 +- .../references/man1/nodediscoverstop.1.rst | 2 +- .../references/man1/nodeimport.1.rst | 14 ++++---- .../admin-guides/references/man1/nodels.1.rst | 2 +- .../references/man1/nodepurge.1.rst | 2 +- .../references/man1/noderefresh.1.rst | 2 +- .../references/man1/nodestat.1.rst | 4 +-- .../references/man1/piflash.1.rst | 23 +++++++++++++ .../admin-guides/references/man1/rflash.1.rst | 16 +++++----- .../admin-guides/references/man1/rinv.1.rst | 6 ++-- .../references/man1/rmdocker.1.rst | 2 +- .../references/man1/rmdsklsnode.1.rst | 12 +++---- .../references/man1/rmhwconn.1.rst | 2 +- .../references/man1/rmigrate.1.rst | 2 +- .../references/man1/rmkitcomp.1.rst | 2 +- .../admin-guides/references/man1/rmvm.1.rst | 2 +- .../references/man1/rnetboot.1.rst | 4 +-- .../admin-guides/references/man1/rpower.1.rst | 6 ++-- .../references/man1/rspconfig.1.rst | 2 +- .../admin-guides/references/man1/sinv.1.rst | 8 ++--- .../admin-guides/references/man1/snmove.1.rst | 6 ++-- .../references/man1/swapnodes.1.rst | 6 ++-- .../references/man1/switchdiscover.1.rst | 10 +++--- .../references/man1/updatenode.1.rst | 10 +++--- .../references/man1/xcat2nim.1.rst | 2 +- docs/source/overview/quick_start.rst | 2 +- xCAT-client/pods/man1/bmcdiscover.1.pod | 4 +-- xCAT-client/pods/man1/cfgve.1.pod | 2 +- xCAT-client/pods/man1/chvm.1.pod | 6 ++-- xCAT-client/pods/man1/csm2xcat.1.pod | 2 +- xCAT-client/pods/man1/db2sqlsetup.1.pod | 2 +- xCAT-client/pods/man1/dumpxCATdb.1.pod | 4 +-- xCAT-client/pods/man1/genimage.1.pod | 2 +- xCAT-client/pods/man1/geninitrd.1.pod | 6 ++-- xCAT-client/pods/man1/getadapter.1.pod | 4 +-- xCAT-client/pods/man1/getmacs.1.pod | 12 +++---- xCAT-client/pods/man1/groupfiles4dsh.1.pod | 2 +- xCAT-client/pods/man1/imgexport.1.pod | 2 +- xCAT-client/pods/man1/imgimport.1.pod | 2 +- xCAT-client/pods/man1/liteimg.1.pod | 2 +- xCAT-client/pods/man1/lsflexnode.1.pod | 2 +- xCAT-client/pods/man1/lskitcomp.1.pod | 2 +- xCAT-client/pods/man1/lsslp.1.pod | 14 ++++---- xCAT-client/pods/man1/lstree.1.pod | 2 +- xCAT-client/pods/man1/lsvm.1.pod | 2 +- xCAT-client/pods/man1/mkdef.1.pod | 4 +-- xCAT-client/pods/man1/mkdocker.1.pod | 4 +-- xCAT-client/pods/man1/mkdsklsnode.1.pod | 6 ++-- xCAT-client/pods/man1/mknimimage.1.pod | 12 +++---- xCAT-client/pods/man1/mkvm.1.pod | 6 ++-- xCAT-client/pods/man1/monadd.1.pod | 4 +-- xCAT-client/pods/man1/moncfg.1.pod | 4 +-- xCAT-client/pods/man1/mondecfg.1.pod | 2 +- xCAT-client/pods/man1/monls.1.pod | 8 ++--- xCAT-client/pods/man1/monshow.1.pod | 2 +- xCAT-client/pods/man1/monstart.1.pod | 2 +- xCAT-client/pods/man1/nimnodecust.1.pod | 4 +-- xCAT-client/pods/man1/nimnodeset.1.pod | 13 ++++---- xCAT-client/pods/man1/nodeaddunmged.1.pod | 2 +- xCAT-client/pods/man1/nodechmac.1.pod | 2 +- xCAT-client/pods/man1/nodechprofile.1.pod | 2 +- xCAT-client/pods/man1/nodediscoverls.1.pod | 2 +- xCAT-client/pods/man1/nodediscoverstart.1.pod | 6 ++-- .../pods/man1/nodediscoverstatus.1.pod | 2 +- xCAT-client/pods/man1/nodediscoverstop.1.pod | 2 +- xCAT-client/pods/man1/nodeimport.1.pod | 14 ++++---- xCAT-client/pods/man1/nodels.1.pod | 2 +- xCAT-client/pods/man1/nodepurge.1.pod | 2 +- xCAT-client/pods/man1/noderefresh.1.pod | 2 +- xCAT-client/pods/man1/nodestat.1.pod | 4 +-- xCAT-client/pods/man1/rflash.1.pod | 16 +++++----- xCAT-client/pods/man1/rinv.1.pod | 6 ++-- xCAT-client/pods/man1/rmdocker.1.pod | 2 +- xCAT-client/pods/man1/rmdsklsnode.1.pod | 12 +++---- xCAT-client/pods/man1/rmhwconn.1.pod | 2 +- xCAT-client/pods/man1/rmigrate.1.pod | 2 +- xCAT-client/pods/man1/rmkitcomp.1.pod | 2 +- xCAT-client/pods/man1/rmvm.1.pod | 2 +- xCAT-client/pods/man1/rnetboot.1.pod | 4 +-- xCAT-client/pods/man1/rpower.1.pod | 6 ++-- xCAT-client/pods/man1/rspconfig.1.pod | 2 +- xCAT-client/pods/man1/sinv.1.pod | 8 ++--- xCAT-client/pods/man1/snmove.1.pod | 6 ++-- xCAT-client/pods/man1/swapnodes.1.pod | 6 ++-- xCAT-client/pods/man1/switchdiscover.1.pod | 10 +++--- xCAT-client/pods/man1/updatenode.1.pod | 10 +++--- xCAT-client/pods/man1/xcat2nim.1.pod | 2 +- 127 files changed, 322 insertions(+), 309 deletions(-) create mode 100644 docs/source/guides/admin-guides/references/man1/piflash.1.rst diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index e00105af5..d2cf1f937 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -567,7 +567,7 @@ Set the next boot state for the node1. :: ------------------------------------------------------------------------------- GET - Get all the vitals attributes. -``````````````````````````````````` +```````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -598,7 +598,7 @@ Get all the vitails attributes for the node1. :: -------------------------------------------------------------------------------------------------------------------------------------- GET - Get the specific vitals attributes. -```````````````````````````````````````` +````````````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -629,7 +629,7 @@ Get the 'fanspeed' vitals attribute. :: -------------------------------------------------------------------------------------- GET - Get all the inventory attributes. -`````````````````````````````````````` +``````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -660,7 +660,7 @@ Get all the inventory attributes for node1. :: -------------------------------------------------------------------------------------------------------------- GET - Get the specific inventory attributes. -``````````````````````````````````````````` +```````````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -1130,7 +1130,7 @@ Create osimage resources based on an xCAT image or configuration file :: ------------------------------------------------ GET - Get all the attributes for the osimage {imgname}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {imgname} which means to get image attributes for all the osimages. @@ -1163,7 +1163,7 @@ Get the attributes for the specified osimage. :: } PUT - Change the attributes for the osimage {imgname}. -````````````````````````````````````````````````````` +`````````````````````````````````````````````````````` Refer to the man page: :doc:`chdef ` @@ -1348,7 +1348,7 @@ Create the networks resources base on the network configuration on xCAT MN. :: ------------------------------------------------ GET - Get all the attributes for the network {netname}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {netname} which means to get network attributes for all the networks. @@ -1375,7 +1375,7 @@ Get all the attributes for network 'network1'. :: } PUT - Change the attributes for the network {netname}. -````````````````````````````````````````````````````` +`````````````````````````````````````````````````````` Refer to the man page: :doc:`chdef ` @@ -1488,7 +1488,7 @@ Get all the policy objects. :: ----------------------------------------------------- GET - Get all the attributes for a policy {policy_priority}. -``````````````````````````````````````````````````````````` +```````````````````````````````````````````````````````````` It will display all the policy attributes for one policy resource. @@ -1513,7 +1513,7 @@ Get all the attribute for policy 1. :: } PUT - Change the attributes for the policy {policy_priority}. -```````````````````````````````````````````````````````````` +````````````````````````````````````````````````````````````` It will change one or more attributes for a policy. @@ -1638,7 +1638,7 @@ Get all the group names from xCAT database. :: ---------------------------------------------- GET - Get all the attributes for the group {groupname}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` Refer to the man page: :doc:`lsdef ` @@ -1658,7 +1658,7 @@ Get all the attributes for group 'all'. :: } PUT - Change the attributes for the group {groupname}. -````````````````````````````````````````````````````` +`````````````````````````````````````````````````````` Refer to the man page: :doc:`chdef ` @@ -1955,7 +1955,7 @@ URI list which can be used to create, query, change table entries. For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in. GET - Get attributes of tables for a noderange. -`````````````````````````````````````````````` +``````````````````````````````````````````````` **Returns:** @@ -2026,7 +2026,7 @@ Get all the columns from tables nodetype and noderes for node1 and node2. :: } PUT - Change the node table attributes for {noderange}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` **Parameters:** @@ -2048,7 +2048,7 @@ Change the nodetype.arch and noderes.netboot attributes for nodes node1,node2. : For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in. GET - Get table attributes for a noderange. -`````````````````````````````````````````` +``````````````````````````````````````````` **Returns:** @@ -2120,7 +2120,7 @@ Use this for tables that don't have node name as the key of the table, for examp {keys} should be the name=value pairs which are used to search table. e.g. {keys} should be [net=192.168.1.0,mask=255.255.255.0] for networks table query since the net and mask are the keys of networks table. GET - Get attributes for rows from non-node tables. -`````````````````````````````````````````````````` +``````````````````````````````````````````````````` **Returns:** diff --git a/docs/source/developers/github/change_code.rst b/docs/source/developers/github/change_code.rst index 4eb5b79cd..e62064a32 100644 --- a/docs/source/developers/github/change_code.rst +++ b/docs/source/developers/github/change_code.rst @@ -25,7 +25,7 @@ Creating additional branches will allow you to work on different tasks/enhanceme Committing code and pushing to remote branch -------------------------------------------- +-------------------------------------------- Once your code is ready.... diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 6fcd77a1d..396880103 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -46,7 +46,7 @@ The xCAT ``rcons`` command relies on conserver (http://www.conserver.com/). The OpenBMC Specific -``````````````` +```````````````` #. For OpenBMC managed servers, the root user must be able to ssh passwordless to the BMC for the ``rcons`` function to work. diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index efe3bde5b..7173c39f5 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -35,7 +35,7 @@ DESCRIPTION *********** -The \ **bmcdiscover**\ command will discover Baseboard Management Controllers (BMCs) using a scan mathod. +The \ **bmcdiscover**\ command will discover Baseboard Management Controllers (BMCs) using a scan method. The command uses \ **nmap**\ to scan active nodes over a specified IP range. The IP range format should be a format that is acceptable by \ **nmap**\ . @@ -52,7 +52,7 @@ OPTIONS \ **-**\ **-range**\ - Specify one or more IP ranges acceptable to nmap. IP rance can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. + Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. diff --git a/docs/source/guides/admin-guides/references/man1/cfgve.1.rst b/docs/source/guides/admin-guides/references/man1/cfgve.1.rst index 6de85a9fd..3c53d9b20 100644 --- a/docs/source/guides/admin-guides/references/man1/cfgve.1.rst +++ b/docs/source/guides/admin-guides/references/man1/cfgve.1.rst @@ -98,7 +98,7 @@ OPTIONS be owned by vdsm:kvm. \ **localfs**\ : "/data/images/rhev" is set by default. - \ **virtsd.host**\ - A host must be specified for a storage doamin as SPM + \ **virtsd.host**\ - A host must be specified for a storage domain as SPM (Storage Pool Manager) when initialize the storage domain. The role of SPM may be migrated to other host by rhev-m during the running of the datacenter (For example, when the current SPM encountered issue or going to maintenance diff --git a/docs/source/guides/admin-guides/references/man1/chvm.1.rst b/docs/source/guides/admin-guides/references/man1/chvm.1.rst index 01e9afc33..14b1f28ea 100644 --- a/docs/source/guides/admin-guides/references/man1/chvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/chvm.1.rst @@ -151,7 +151,7 @@ PPC (using Direct FSP Management) specific: For Power 755(use option \ *--p775*\ to specify): -chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. +chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar. @@ -166,7 +166,7 @@ zVM specific: ============= -The chvm command modifes the virtual machine's configuration specified in noderange. +The chvm command modifies the virtual machine's configuration specified in noderange. @@ -336,7 +336,7 @@ VMware/KVM specific: \ **-**\ **-resize**\ \ *disk*\ =\ *size*\ - Change the size of the Hard disk. The disk in \ *qcow2*\ format can not be set to less than it's current size. The disk in \ *raw*\ format can be resized smaller, use caution. Multiple disks can be resized by using comma separated \ *disk*\ \ **=**\ \ *size*\ pairs. The disks are specified by SCSI id. Size defaults to GB. + Change the size of the Hard disk. The disk in \ *qcow2*\ format can not be set to less than its current size. The disk in \ *raw*\ format can be resized smaller, use caution. Multiple disks can be resized by using comma separated \ *disk*\ \ **=**\ \ *size*\ pairs. The disks are specified by SCSI id. Size defaults to GB. diff --git a/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst b/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst index f03df04a2..cd06071a9 100644 --- a/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The commmand will build two xCAT stanza files that can update the xCAT database with the chdef command. +The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The command will build two xCAT stanza files that can update the xCAT database with the chdef command. Copy the csm2xcat command to the CSM Management Server. Run the command, indicating where you want your stanza files saved with the \ **-**\ **-dir**\ parameter. Check the stanza files to see if the information is what you want put in the xCAT database. Copy the two stanza files: node.stanza, device.stanza back to your xCAT Management node, and run the chdef command to input into the xCAT database. diff --git a/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst b/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst index 96b2fad80..2ea1fed24 100644 --- a/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst +++ b/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst @@ -46,7 +46,7 @@ For full information on the setup of DB2, see Setting_Up_DB2_as_the_xCAT_DB. When running of db2sqlsetup on the MN: One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable. -The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overriden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. +The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overridden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. When running db2sqlseutp on the SN: Not only will the password for the DB2 instance Id be prompted for and must match the one on the Management Node; but also the hostname or ip address of the Management Node as known by the Service Node must be supplied , unless the XCATDB2SERVER environment variable is set. diff --git a/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst b/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst index 8dcaedc47..af89c9fef 100644 --- a/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst +++ b/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst @@ -35,7 +35,7 @@ If not using the binary dump option (-b), then the dumpxCATdb command creates .c Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables. The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records. -If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilites for backup of the entire database. +If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilities for backup of the entire database. ******* @@ -49,7 +49,7 @@ OPTIONS \ **-V**\ Verbose. -\ **-a**\ All,without this flag the eventlog and auditlog will be skipped. +\ **-a**\ All, without this flag the eventlog and auditlog will be skipped. \ **-b**\ This flag is only used for the DB2 or postgreSQL database. The routine will use the database backup utilities to create a binary backup of the entire database. Note to use this backup on DB2, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions. diff --git a/docs/source/guides/admin-guides/references/man1/genimage.1.rst b/docs/source/guides/admin-guides/references/man1/genimage.1.rst index 6d0f8adfd..d28fd3880 100644 --- a/docs/source/guides/admin-guides/references/man1/genimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/genimage.1.rst @@ -46,7 +46,7 @@ for stateless: \ **packimage**\ for statelite: \ **liteimg**\ -Besides prompting for some paramter values, the \ **genimage**\ command takes default guesses for the parameters not specified or not defined in the \ *osimage*\ and \ *linuximage*\ tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use \ **-**\ **-interactive**\ flag if you want the yum/zypper command to prompt you for the answers. +Besides prompting for some parameter values, the \ **genimage**\ command takes default guesses for the parameters not specified or not defined in the \ *osimage*\ and \ *linuximage*\ tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use \ **-**\ **-interactive**\ flag if you want the yum/zypper command to prompt you for the answers. If \ **-**\ **-onlyinitrd**\ is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. diff --git a/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst b/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst index ffac5dd95..881fff450 100644 --- a/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst @@ -43,7 +43,7 @@ If the initrd has been rebuilt by geninitrd, when run nodeset, the \ *--noupdate should be used to skip the rebuilding of initrd to improve the performance. Three attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. \ **netdrivers**\ - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -65,7 +65,7 @@ this command is used to generate the initrd from the rootimg which generated by So the 'genimage' must be run once before running the geninitrd command. Two attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. \ **netdrivers**\ - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -79,7 +79,7 @@ Parameters ********** -\ *imagename*\ specifies the name of an os image definition to be used. The specification for the image is storted in the \ *osimage*\ table and \ *linuximage*\ table. +\ *imagename*\ specifies the name of an os image definition to be used. The specification for the image is stored in the \ *osimage*\ table and \ *linuximage*\ table. \ **-**\ **-ignorekernelchk**\ diff --git a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst index 7bd216c97..982fcd4c3 100644 --- a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst @@ -35,8 +35,8 @@ Traditionally, network interfaces in Linux are enumerated as eth[0123...], but t \ **getadapter**\ For each node within the , follows below scheme: -If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. -If the target node has ever been scaned, \ **getadapter**\ will use the information from nics table first. +If the target node is scanned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. +If the target node has ever been scanned, \ **getadapter**\ will use the information from nics table first. If user hopes to scan the adapter information for the node but these information already exist, \ **-f**\ option can be used to start rescan process. \ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. diff --git a/docs/source/guides/admin-guides/references/man1/getmacs.1.rst b/docs/source/guides/admin-guides/references/man1/getmacs.1.rst index 05bfd6ff0..a38bc1abf 100644 --- a/docs/source/guides/admin-guides/references/man1/getmacs.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getmacs.1.rst @@ -51,12 +51,12 @@ DESCRIPTION The getmacs command collects MAC address from a single or range of nodes. -Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04). +Note that on AIX systems, the returned MAC address is not colon-separated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-separated (for example 8e:e2:24:5c:f0:04). If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database. For PPC (using Direct FSP Management) specific: -Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform \ **Discovery**\ with option "\ **-D**\ ", since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "\ **-D**\ " to get theirs MAC addresses. +Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform \ **Discovery**\ with option "\ **-D**\ ", since there is no HMC command to read them and getmacs has to login to open firmware. And if the LPARs has never been activated before, getmacs need to be performed with the option "\ **-D**\ " to get theirs MAC addresses. For PPC (using HMC) specific: @@ -74,7 +74,7 @@ OPTIONS \ **-**\ **-arp**\ -Read MAC address with ARP protocal. +Read MAC address with ARP protocol. \ **-C**\ @@ -90,7 +90,7 @@ Perform discovery for mac address. By default, it will run ping test to test th \ **-f**\ -Force immediate shutdown of the partition.This flag must be used with -D flag. +Force immediate shutdown of the partition. This flag must be used with -D flag. \ **-F**\ @@ -118,7 +118,7 @@ Read MAC address when the lpar is in openfirmware state. This option mush be us \ **-S**\ -The IP address of the machine to ping. The default is to read from xCAT databse if no \ **-S**\ specified. +The IP address of the machine to ping. The default is to read from xCAT database if no \ **-S**\ specified. \ **-v**\ @@ -167,7 +167,7 @@ Output is similar to: ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -2. To retrieve the MAC address with ARP protocal: +2. To retrieve the MAC address with ARP protocol: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst b/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst index ea06cfd04..3a2675767 100644 --- a/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst @@ -33,7 +33,7 @@ This tool will build a directory of files, one for each defined nodegroup in xCAT. The file will be named the nodegroup name and contain a list of nodes that belong to the nodegroup. The file can be used as input to the AIX dsh command. -The purpose of this tool is to allow backward compatiblity with scripts +The purpose of this tool is to allow backward compatibility with scripts that were created using the AIX or CSM dsh command Reference: man dsh. 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 2e08a1b61..3626725f1 100644 --- a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst @@ -61,7 +61,7 @@ For statelite: where x is the name of the profile. -Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using \ **-e**\ flag. +Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themselves need to be manualy exported using \ **-e**\ flag. For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported. 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 e5e542f7c..6359d535d 100644 --- a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst @@ -69,7 +69,7 @@ If \ **-p**\ flag is specified, the \ *postscripts*\ table will be updated wit If \ **-f**\ flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, \ */opt/xcat/share/xcat/netboot/sles/x.pkglist*\ will be copied to \ */install/custom/netboot/sles/compute_new.pkglist*\ and \ */install/netboot/sles11/ppc64/x/kernel*\ will be copied to \ */install/netboot/sles11/ppc64/compute_new/kernel*\ . This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one. -After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment. +After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node deployment. For stateful: nodeset diff --git a/docs/source/guides/admin-guides/references/man1/liteimg.1.rst b/docs/source/guides/admin-guides/references/man1/liteimg.1.rst index ceaec142a..266f59b73 100644 --- a/docs/source/guides/admin-guides/references/man1/liteimg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/liteimg.1.rst @@ -63,7 +63,7 @@ PARAMETERS ********** -\ *imagename*\ specifies the name of a os image definition to be used. The specification for the image is storted in the \ *osimage*\ table and \ *linuximage*\ table. +\ *imagename*\ specifies the name of a os image definition to be used. The specification for the image is stored in the \ *osimage*\ table and \ *linuximage*\ table. ******* diff --git a/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst b/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst index e3c553c2e..e72fc0ce0 100644 --- a/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst @@ -38,7 +38,7 @@ There are several concepts to support the HX5 multiple blades combination: \ **Complex**\ : Multiple blades which combined by a scalability card is a complex. -\ **Parition**\ : A logic concept which containing part of the \ **Blade slot node**\ in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) +\ **Partition**\ : A logic concept which containing part of the \ **Blade slot node**\ in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) \ **Blade slot node**\ : The physical blade which installed in the slot of a chassis. It can be a HX5 or MD. diff --git a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst index 81500f251..895a065e1 100644 --- a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst @@ -89,7 +89,7 @@ OPTIONS - Each tag contains info for a group of kit compoonents belonging to the same kit. The info inside is structured as follows: + Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/lsslp.1.rst b/docs/source/guides/admin-guides/references/man1/lsslp.1.rst index 0d16d5f50..3c83cb355 100644 --- a/docs/source/guides/admin-guides/references/man1/lsslp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsslp.1.rst @@ -41,13 +41,13 @@ OPTIONS ******* -\ **noderange**\ The nodes which the user want to discover. If the user specify the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. +\ **noderange**\ The nodes which the user wants to discover. If the user specifies the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. \ **-i**\ IP(s) the command will send out (defaults to all available adapters). \ **-h**\ Display usage message. -\ **-n**\ Only display and write the newly discovered hardwares. +\ **-n**\ Only display and write the newly discovered hardware. \ **-u**\ Do unicast to a specified IP range. Must be used with \ **-s**\ and \ **-**\ **-range**\ . The \ **-u**\ flag is not supported on AIX. @@ -55,15 +55,15 @@ OPTIONS \ **-r**\ Display Raw SLP response. -\ **-C**\ The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 secondes. The user can use -T flag the specify the time they want to use. A short time will limite the time costing, while a long time will help to find all the nodes. +\ **-C**\ The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 seconds. The user can use -T flag the specify the time they want to use. A short time will limit the time costing, while a long time will help to find all the nodes. -\ **-T**\ The number in seconds to limite the time costing of lsslp. +\ **-T**\ The number in seconds to limit the time of lsslp. \ **-s**\ Service type interested in discovering. \ **-t**\ Number or service-request attempts. -\ **-**\ **-vpdtable**\ Output the SLP response in vpdtable formatting. Easy for writting data to vpd table. +\ **-**\ **-vpdtable**\ Output the SLP response in vpdtable formatting. Easy for writing data to vpd table. \ **-v**\ Command Version. @@ -73,9 +73,9 @@ OPTIONS \ **-x**\ XML format. -\ **-z**\ Stanza formated output. +\ **-z**\ Stanza formatted output. -\ **-I**\ Give the warning message for the nodes in database which have no SLP responses. Note that this flag noly can be used after the database migration finished successfully. +\ **-I**\ Give the warning message for the nodes in database which have no SLP responses. Note that this flag can only be used after the database migration finished successfully. ************ diff --git a/docs/source/guides/admin-guides/references/man1/lstree.1.rst b/docs/source/guides/admin-guides/references/man1/lstree.1.rst index b4c58f176..e6a4eeddf 100644 --- a/docs/source/guides/admin-guides/references/man1/lstree.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lstree.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **lstree**\ command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to disply VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. +The \ **lstree**\ command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to display VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. ******* diff --git a/docs/source/guides/admin-guides/references/man1/lsvm.1.rst b/docs/source/guides/admin-guides/references/man1/lsvm.1.rst index dc53a2c47..ad48cc0af 100644 --- a/docs/source/guides/admin-guides/references/man1/lsvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsvm.1.rst @@ -360,7 +360,7 @@ Output is similar to: Available BSR array: 256 -Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. +Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class description)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. 9. For DFM-managed partition on normal power machine, list out the detailed information: diff --git a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst index 41084a288..066084735 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst @@ -84,7 +84,7 @@ OPTIONS \ **-**\ **-template**\ \ *template-object-name*\ - Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of \ **mkdef**\ command. If there are a template and an existing object with the same name \ *template-object-name*\ , the tempalte object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of \ **-**\ **-template**\ option in lsdef(1)|lsdef.1. + Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of \ **mkdef**\ command. If there are a template and an existing object with the same name \ *template-object-name*\ , the template object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of \ **-**\ **-template**\ option in lsdef(1)|lsdef.1. @@ -96,7 +96,7 @@ OPTIONS \ **-w**\ \ *attr==val*\ \ **-w**\ \ *attr=~val*\ ... - Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef commmand, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. + Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. Operator descriptions: == Select nodes where the attribute value is exactly this value. diff --git a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst index 87559be1c..f1e2d2e47 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst @@ -137,7 +137,7 @@ Output is similar to: host01c01: Pull image ubuntu start host01c01: Pull image ubuntu done host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success @@ -155,7 +155,7 @@ Output is similar to: .. code-block:: perl host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success diff --git a/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst b/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst index f1a4294e7..6968e6039 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst @@ -38,7 +38,7 @@ This command will also create a NIM resolv_conf resource to be used when install The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -57,11 +57,11 @@ You can use the "-n" option of the mkdsklsnode command to create and initialize \ **Note:**\ When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes. The NIM resources should not be shared between the old osimage and the new osimage. -You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. +You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. After the mkdsklsnode command completes you can use the \ **lsnim**\ command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **mkdsklsnode**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **mkdsklsnode**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **mkdsklsnode**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *diskless:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current current nodeset action, in this case "diskless". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **mkdsklsnode**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **mkdsklsnode**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **mkdsklsnode**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *diskless:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. ******* diff --git a/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst b/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst index 15d496c90..1d2985946 100644 --- a/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst @@ -43,7 +43,7 @@ When creating a mksysb image definition you must specify either the "-n" or the When creating a diskless osimage definition you also have the option of automatically updating the NIM SPOT resource. You can have additional software installed or you can have configuration files added or updated. To have software installed you must provide either the names of NIM installp_bundle resources or fileset names on the command line using the "attr=val" option. You may also supply the installp flags, RPM flags, emgr flags to use when installing the software. -To have configuration files updated you must provide the full path name of a "synclists" file which contains the the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. +To have configuration files updated you must provide the full path name of a "synclists" file which contains the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. \ **Updating an existing xCAT osimage**\ @@ -69,7 +69,7 @@ You can use the "-i" and "-p" options to copy an existing diskless osimage. To - any other resources (or attributes) included in the original osimage will be included in the new osimage definition. -- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redfined to NIM. (The default would be to use the original lpp_source - to save file system space.) +- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redefined to NIM. (The default would be to use the original lpp_source - to save file system space.) \ **Additional information**\ @@ -85,7 +85,7 @@ To list a NIM resource definition use the AIX \ **lsnim**\ command ("lsnim -l < To check the validity of a SPOT or lpp_source resource use the AIX \ **nim**\ command ("nim -o check "). -To remove specific NIM resource definitons use the AIX \ **nim**\ command. ("nim -o remove "). +To remove specific NIM resource definitions use the AIX \ **nim**\ command. ("nim -o remove "). ******* @@ -255,7 +255,7 @@ OPTIONS - Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). + Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma separated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). @@ -267,7 +267,7 @@ OPTIONS \ **-c|-**\ **-completeosimage**\ - Complete the creation of the osimage definition passed in on the command line. This option will use any additonal values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. + Complete the creation of the osimage definition passed in on the command line. This option will use any additional values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. @@ -492,7 +492,7 @@ The xCAT osimage definition created by this command will include the "otherpkgs" mknimimage -u 61dskls installp_bundle=bndres1,bndres2 installp_flags="-agcQX" -Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definiton is not used or updated. +Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definition is not used or updated. 13) Update an existing image to support NFSv4. Also specify verbose messages. diff --git a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst index 753ddd42e..effaaa109 100644 --- a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst @@ -148,7 +148,7 @@ OPTIONS \ **vmcpus=**\ \ *value*\ \ **vmmemory=**\ \ *value*\ \ **vmphyslots=**\ \ *value*\ \ **vmothersetting=**\ \ *value*\ \ **vmnics=**\ \ *value*\ \ **vmstorage=**\ \ *value*\ [\ **-**\ **-vios**\ ] - To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . + To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . The option \ *vios*\ is used to specify the partition that will be created is a VIOS partition. If specified, the value for \ *vmstorage*\ shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for \ *vmphyslots*\ , all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of \ *vios_name:server_slotid*\ to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. @@ -392,7 +392,7 @@ First, define a node object: mkdef -t node -o lpar1 mgt=fsp cons=fsp nodetype=ppc,osi id=1 hcp=cec parent=cec hwtype=lpar groups=lpar,all -Then, create the partion on the specified cec. +Then, create the partition on the specified cec. .. code-block:: perl @@ -515,7 +515,7 @@ The output is similar to: mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios -The resouces for the node is similar to: +The resources for the node is similar to: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/monadd.1.rst b/docs/source/guides/admin-guides/references/man1/monadd.1.rst index df2c69af8..bb8f629e8 100644 --- a/docs/source/guides/admin-guides/references/man1/monadd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monadd.1.rst @@ -39,9 +39,9 @@ Parameters ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. -\ *settings*\ is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: \ *-s key-value -s key=value ...*\ Note that the square brackets are needed here. Use \ *monls name -d*\ command to look for the possbile setting keys for a plug-in module. +\ *settings*\ is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: \ *-s key-value -s key=value ...*\ Note that the square brackets are needed here. Use \ *monls name -d*\ command to look for the possible setting keys for a plug-in module. ******* diff --git a/docs/source/guides/admin-guides/references/man1/moncfg.1.rst b/docs/source/guides/admin-guides/references/man1/moncfg.1.rst index febc5f32f..a7ac99ccd 100644 --- a/docs/source/guides/admin-guides/references/man1/moncfg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/moncfg.1.rst @@ -31,7 +31,7 @@ DESCRIPTION *********** -This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified, though the configuration of the nodes is usually performed during the node deployment stage. +This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configuration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified, though the configuration of the nodes is usually performed during the node deployment stage. ********** @@ -39,7 +39,7 @@ Parameters ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. \ *noderange*\ specifies the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst b/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst index 1b6b8439b..eeb0dc747 100644 --- a/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst @@ -31,7 +31,7 @@ DESCRIPTION *********** -This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified. The deconfigration operation will remove the nodes from the 3rd party software's monitoring domain. +This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified. The deconfiguration operation will remove the nodes from the 3rd party software's monitoring domain. ********** diff --git a/docs/source/guides/admin-guides/references/man1/monls.1.rst b/docs/source/guides/admin-guides/references/man1/monls.1.rst index 7f321d21b..f5241006d 100644 --- a/docs/source/guides/admin-guides/references/man1/monls.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monls.1.rst @@ -33,7 +33,7 @@ DESCRIPTION *********** -This command is used to list the status, desctiption, the configuration scripts and the settings of one or all of the monitoring plug-in modules. +This command is used to list the status, description, the configuration scripts and the settings of one or all of the monitoring plug-in modules. ********** @@ -49,9 +49,9 @@ OPTIONS ******* -\ **-a | -**\ **-all**\ Searches the \ *XCATROOT/lib/perl/xCAT_monitoring*\ directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the \ *monitoring*\ tabel. +\ **-a | -**\ **-all**\ Searches the \ *XCATROOT/lib/perl/xCAT_monitoring*\ directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the \ *monitoring*\ table. -\ **-d | -**\ **-description**\ Display the description of the plug-in modules. The description ususally contains the possible settings. +\ **-d | -**\ **-description**\ Display the description of the plug-in modules. The description usually contains the possible settings. \ **-h | -**\ **-help**\ Display usage message. @@ -110,7 +110,7 @@ The output looks like this: nagiosmon not-monitored -3. To list the status and the desciption for \ *snmpmon*\ module, enter: +3. To list the status and the description for \ *snmpmon*\ module, enter: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/monshow.1.rst b/docs/source/guides/admin-guides/references/man1/monshow.1.rst index e711239b7..2c8ff130c 100644 --- a/docs/source/guides/admin-guides/references/man1/monshow.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monshow.1.rst @@ -59,7 +59,7 @@ OPTIONS \ **-a**\ specifies a comma-separated list of attributes or metrics names. The default is all. -\ **-w**\ specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, serverity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. +\ **-w**\ specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, severity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. Operator descriptions: diff --git a/docs/source/guides/admin-guides/references/man1/monstart.1.rst b/docs/source/guides/admin-guides/references/man1/monstart.1.rst index 292c72265..1595b28b8 100644 --- a/docs/source/guides/admin-guides/references/man1/monstart.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monstart.1.rst @@ -39,7 +39,7 @@ PARAMETERS ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ **monls -a**\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ **monls -a**\ command to list all the monitoring plug-in modules that can be used. \ *noderange*\ is the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst b/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst index 8a82dad79..1fd244764 100644 --- a/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst @@ -57,9 +57,9 @@ To create a NIM installp_bundle definition you can use the "nim -o define" opera nim -o define -t installp_bundle -a server=master -a location=/install/nim/mypkgs.bnd mypackages -See the AIX documantation for more information on using installp_bundle files. +See the AIX documentation for more information on using installp_bundle files. -The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierachical environment. +The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierarchical environment. ******* diff --git a/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst b/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst index 8c03d0fd7..5f3511342 100644 --- a/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst @@ -33,7 +33,7 @@ This xCAT command can be used to initialize AIX/NIM standalone machines. Once th If you are using xCAT service nodes the \ **nimnodeset**\ command will automatically determine the correct server(s) for the node and do the initialization on that server(s). -The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definiions. +The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definitions. This command will also create a NIM resolv_conf resource to be used when installing the node. If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes. @@ -41,7 +41,7 @@ NIM resolv_conf resource will be created and allocated to the nodes. The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -58,13 +58,13 @@ will be created. You can specify additional attributes and values using the "attr=val" command line option. This information will be passed on to the underlying call to the NIM "nim -o bos_inst" command. See the NIM documentation for information on valid command line options for the nim command. The "attr" must correspond to a NIM attribute supported for the NIM "bos_inst" operation. Information provided by the "attr=val" option will take precedence over the information provided in the osimage definition. -The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. +The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. This command will also create a NIM script resource to enable the xCAT support for user-provided customization scripts. After the \ **nimnodeset**\ command completes you can use the \ **lsnim**\ command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **nimnodeset**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **nimnodeset**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **nimnodeset**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *standalone:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **nimnodeset**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **nimnodeset**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **nimnodeset**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *standalone:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. ******* @@ -76,7 +76,7 @@ OPTIONS \ *attr=val [attr=val ...]*\ Specifies one or more "attribute equals value" pairs, separated by spaces. Attr= - val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma seperated list. (ex. "script=ascript,bscript"). + val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma separated list. (ex. "script=ascript,bscript"). @@ -106,8 +106,7 @@ OPTIONS \ **-l|-**\ **-location**\ - The directory location to use when creating new NIM resolv_conf resources. The d - efault location is /install/nim. + The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim. diff --git a/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst b/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst index 2a7cd8d10..2ce52c742 100644 --- a/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst @@ -61,7 +61,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst b/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst index d293bcaea..84a1dce0c 100644 --- a/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst @@ -63,7 +63,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst b/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst index 1d02e020a..be6b5300e 100644 --- a/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst @@ -79,7 +79,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst index b791d5180..8d1458b64 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst @@ -114,7 +114,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst index 35e01991d..2171f8da9 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst @@ -59,7 +59,7 @@ When the nodes are discovered, PCM updates the affected configuration files on t When you power on the nodes, they PXE boot and DHCP/TFTP/HTTP on the management node give each node the xCAT genesis boot image, which inventories the node hardware and sends data to the management node. There, either the sequential discovery process or the -profile discovery process assigns node attributes and defines the node in the the database. +profile discovery process assigns node attributes and defines the node in the database. ******* @@ -127,7 +127,7 @@ OPTIONS -\ **chasiss=**\ \ *chassis-name*\ +\ **chassis=**\ \ *chassis-name*\ Sets the chassis name that the Blade server or PureFlex blade is located in, for either the Sequential Discovery or Profile Discovery methods. This option is used for the Blade server and PureFlex system only. You cannot specify this option with the rack option. @@ -196,7 +196,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst index 279166e08..182800616 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst @@ -52,7 +52,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst index 92e5ce339..f95b1b43f 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst @@ -53,7 +53,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst b/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst index 27341b4e8..ccd2a8ab9 100644 --- a/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **nodeimport**\ command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location infomation like rack, chassis, start unit, server height...etc +The \ **nodeimport**\ command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location information like rack, chassis, start unit, server height...etc After nodes imported, the configuration files related with these nodes will be updated automatically. For example: /etc/hosts, dns configuration, dhcp configuration. And the kits node plugins will also be triggered automatically to update kit related configuration/services. @@ -83,9 +83,9 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured while validating parameters. +1 An error has occurred while validating parameters. -2 An error has occured while parsing hostinfo file. +2 An error has occurred while parsing hostinfo file. ******** @@ -143,7 +143,7 @@ To import nodes using a profile, follow the following steps: # hostinfo end. - Another example of a node infomation file, a PureFlex X/P node defined: + Another example of a node information file, a PureFlex X/P node defined: # hostinfo begin # To define a PureFlex P/X node, chassis and slot id must be specified. # The chassis must be a PureFlex chassis. @@ -191,7 +191,7 @@ Description: The name of the node, where __hostname__ is automatically generated \ **mac= This is a mandatory item. -Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. +Description: Specify the MAC address for the NIC used by the provisioning node, where is the NICs MAC address. \ **switches= This is a mandatory item, when define switch, switchport and node nic name relationship. @@ -221,9 +221,9 @@ Description: Lists the IP address for each network interface configuration (NIC) Description: node location info. Specify the rack name which this node will be placed into. If not specify this item, there will be no node location info set for this node. this item must be specified together with height + unit. -\ **chasiss= This is an optional item. +\ **chassis= This is an optional item. -Description: node location info, for blade(or PureFlex) only. Specify the chasiss name which this blade will be placed into. this item can not be specified together with rack. +Description: node location info, for blade(or PureFlex) only. Specify the chassis name which this blade will be placed into. this item can not be specified together with rack. \ **height= This is an optional item. diff --git a/docs/source/guides/admin-guides/references/man1/nodels.1.rst b/docs/source/guides/admin-guides/references/man1/nodels.1.rst index 692331e73..395c72848 100644 --- a/docs/source/guides/admin-guides/references/man1/nodels.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodels.1.rst @@ -109,7 +109,7 @@ OPTIONS \ **-b|-**\ **-blame**\ - For values inherited from groups, display which groups provided the inheritence + For values inherited from groups, display which groups provided the inheritance diff --git a/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst b/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst index c11871cdc..847eb6c7b 100644 --- a/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst @@ -59,7 +59,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst b/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst index 5eabc41af..7f110d908 100644 --- a/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst @@ -57,7 +57,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst index f51b0d015..8d3afd684 100644 --- a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst @@ -63,7 +63,7 @@ Keywords to use: port -- the application daemon port number, if not specified, use internal list, then /etc/services. group -- the name of a node group that needs to get the application status from. If not specified, assume all the nodes in the nodelist table. To specify more than one groups, use group=a,group=b format. cmd -- the command that will be run locally on mn or sn. - lcmd -- the command that will be run the the mn only. + lcmd -- the command that will be run the mn only. dcmd -- the command that will be run distributed on the nodes using xdsh .... @@ -94,7 +94,7 @@ For the command specified by 'dcmd', no input is needed, the output can be a str \ **-m | -**\ **-usemon**\ - Uses the settings from the \ **monsetting**\ talbe to determine a list of applications that need to get status for. + Uses the settings from the \ **monsetting**\ table to determine a list of applications that need to get status for. diff --git a/docs/source/guides/admin-guides/references/man1/piflash.1.rst b/docs/source/guides/admin-guides/references/man1/piflash.1.rst new file mode 100644 index 000000000..1959a893e --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/piflash.1.rst @@ -0,0 +1,23 @@ + +######### +piflash.1 +######### + +.. highlight:: perl + + +******** +SYNOPSIS +******** + + +\ **piflash**\ -**\ **-package + + +*********** +DESCRIPTION +*********** + + +\ **piflash**\ Remotely applies firmware updates to servers. + diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 47b35ae06..087047ab6 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -73,7 +73,7 @@ PPC (with HMC) specific: ======================== -The \ **rflash**\ command uses the \ **xdsh**\ command to connect to the HMC controlling the given managed system and perform the updates. Before running \ **rflash**\ , use \ **rspconfig**\ to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use \ **rspconfig**\ comamnd. +The \ **rflash**\ command uses the \ **xdsh**\ command to connect to the HMC controlling the given managed system and perform the updates. Before running \ **rflash**\ , use \ **rspconfig**\ to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use \ **rspconfig**\ command. \ **Warning!**\ This command may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. @@ -83,7 +83,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f The \ **-**\ **-commit**\ flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The \ **-**\ **-recover**\ flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored. -\ **NOTE:**\ When the \ **-**\ **-commit**\ or \ **-**\ **-recover**\ two flags is used, the noderange \ **cannot**\ be BPA. It only \ **can**\ be CEC or LPAR ,and will take effect for \ **both**\ managed systems and power subsystems. +\ **NOTE:**\ When the \ **-**\ **-commit**\ or \ **-**\ **-recover**\ two flags is used, the noderange \ **cannot**\ be BPA. It only \ **can**\ be CEC or LPAR, and will take effect for \ **both**\ managed systems and power subsystems. xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems. @@ -104,7 +104,7 @@ The \ **deferred**\ option will load the new firmware into the T (temp) side, b In Direct FSP/BPA Management, there is \ **-d**\ \ *data_directory*\ option. The default value is /tmp. When doing firmware update, \ **rflash**\ will put some related data from rpm packages in directory, so the execution of \ **rflash**\ will require available disk space in for the command to properly execute: -For one GFW rpm package and one power code rpm package , if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5\*gfw_rpmsize + 1.5\*power_rpmsize +For one GFW rpm package and one power code rpm package, if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5\*gfw_rpmsize + 1.5\*power_rpmsize For Power 775, the \ **rflash**\ command takes effect on the primary and secondary FSPs or BPAs almost in parallel. @@ -115,7 +115,7 @@ NeXtScale FPC specific: ======================= -The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters +The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters OpenPOWER specific: @@ -140,7 +140,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node \ **-c|-**\ **-check**\ - Chech the firmware version of BMC and HPM file. + Check the firmware version of BMC and HPM file. @@ -209,7 +209,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -1. To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +1. To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: .. code-block:: perl @@ -219,7 +219,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -2. To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +2. To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: .. code-block:: perl @@ -239,7 +239,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -4. To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: +4. To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index df454d284..c554e702f 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -114,10 +114,10 @@ zVM specific: ******************* -\ **rinv**\ retrieves hardware configuration information from the on-board +\ **rinv**\ retrieves hardware configuration information from the on-board Service Processor for a single or range of nodes and groups. -Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. +Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. *************** @@ -140,7 +140,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **config**\ - Retrieves number of processors, speed, total memory, and DIMM + Retrieves number of processors, speed, total memory, and DIMM locations. diff --git a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst index 33db44ce4..db021f2a9 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst @@ -48,7 +48,7 @@ EXAMPLES .. code-block:: perl rmdocker host01c01 - host01c01: Disconnect customzied network 'mynet0' done + host01c01: Disconnect customized network 'mynet0' done host01c01: success diff --git a/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst b/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst index 1ad0c3b3e..b9dd2625d 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst @@ -39,11 +39,11 @@ If the node you are trying to remove is currently running the \ **rmdsklsnode**\ \ **Removing alternate NIM client definitions**\ -If you used the "-n" option when you created the NIM client definitions with the \ **mkdsklsnode**\ command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions you must provide the name of the osimage that was used using the "-i" option. +If you used the "-n" option when you created the NIM client definitions with the \ **mkdsklsnode**\ command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions, you must provide the name of the osimage that was used using the "-i" option. -In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The \ **rmdsklsnode -r**\ option can be used to remove the old alternate client defintions without stopping the running node. +In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The \ **rmdsklsnode -r**\ option can be used to remove the old alternate client definitions without stopping the running node. -However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason it is recommended that you wait to do this cleanup until right before you do your next upgrade. +However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason, it is recommended that you wait to do this cleanup until right before you do your next upgrade. ******* @@ -60,8 +60,7 @@ OPTIONS \ **-b |-**\ **-backupSN**\ - When using backup service nodes only update the backup. The default is to updat - e both the primary and backup service nodes. + When using backup service nodes only update the backup. The default is to update both the primary and backup service nodes. @@ -85,8 +84,7 @@ OPTIONS \ **-p|-**\ **-primarySN**\ - When using backup service nodes only update the primary. The default is to upda - te both the primary and backup service nodes. + When using backup service nodes only update the primary. The default is to update both the primary and backup service nodes. diff --git a/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst b/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst index 1edd0ad07..225bb4627 100644 --- a/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst @@ -52,7 +52,7 @@ DESCRIPTION For PPC (with HMC) specific: -This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc talbe in xCAT DB. +This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc table in xCAT DB. Note: If a CEC belongs to a frame with a BPA installed, this CEC cannot be disconnected individually. Instead, the whole frame should be disconnected. diff --git a/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst b/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst index d6b67dfcb..c76a6584e 100644 --- a/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst @@ -88,7 +88,7 @@ zVM specific: \ **vm**\ table - -Table governing VM paramaters. See vm(5)|vm.5 for further details. +Table governing VM parameters. See vm(5)|vm.5 for further details. This is used to determine the current host to migrate from. diff --git a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst index 675774440..183372691 100644 --- a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit comoponent meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. +The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. Note: The xCAT support for Kits is only available for Linux operating systems. diff --git a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst index f3fc52f98..39a083ec7 100644 --- a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst @@ -65,7 +65,7 @@ OPTIONS \ **-**\ **-service**\ Remove the service partitions of the specified CECs. -\ **-p**\ KVM: Purge the existence of the VM from persistant storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partiton on normal power machine. +\ **-p**\ KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partition on normal power machine. \ **-f**\ Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. diff --git a/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst b/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst index 90cc2f5fe..866e10306 100644 --- a/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst @@ -66,11 +66,11 @@ Note: if the "val" fields includes spaces or any other characters that will be p \ **-r**\ -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. \ **-t**\ -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. \ **-V|-**\ **-verbose**\ diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index eb9037303..414471bd5 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -181,7 +181,7 @@ OPTIONS \ **resetsp**\ - Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the sametime. + Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the same time. @@ -320,13 +320,13 @@ OPTIONS \ **-r**\ \ *retrycount*\ - specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. + specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. \ **-t**\ \ *timeout*\ - Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. + Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. Power off, then on. diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst index 9660a425d..c2165234b 100644 --- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst @@ -564,7 +564,7 @@ OPTIONS \ **USERID**\ ={\ *newpasswd*\ } \ **updateBMC**\ ={\ **y|n**\ } - Change the password of the userid \ **USERID**\ for CMM in Flex system cluster. The option \ *updateBMC*\ can be used to specify whether updating the password of BMCs that connected to the speified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. + Change the password of the userid \ **USERID**\ for CMM in Flex system cluster. The option \ *updateBMC*\ can be used to specify whether updating the password of BMCs that connected to the specified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. If value "\*" is specified for USERID and the object node is \ *Flex System X node*\ , the password used to access the BMC of the System X node through IPMI will be updated as the same password of the userid \ **USERID**\ of the CMM in the same cluster. diff --git a/docs/source/guides/admin-guides/references/man1/sinv.1.rst b/docs/source/guides/admin-guides/references/man1/sinv.1.rst index f1274c9d6..89bf04d4e 100644 --- a/docs/source/guides/admin-guides/references/man1/sinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/sinv.1.rst @@ -116,7 +116,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. then a new template will be created from the node output. This will result in having all nodes that match a given template reported in their group at the end of the run in the output file. - If no template count is specified, 0 is the default, and all nodes will + If no template count is specified, 0 is the default, and all nodes will be compared against the first template. @@ -127,7 +127,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. that is stored in template path. You can use this parameter instead of running the command yourself to build the template. - \ **Note:**\ If the template path file does not exists, and no seed node is + \ **Note:**\ If the template path file does not exist, and no seed node is supplied, the seed node automatically is one node in the noderange. @@ -152,7 +152,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. there can exist more lines in the xdsh return from the nodes. For example, if running a "rpm -qa | grep xCAT" command, without exactmatch - set, if the node containes more xCAT rpms that listed in the template, + set, if the node contains more xCAT rpms that listed in the template, it would be considered a match, as long as all rpms listed in the template were on the node. With exactmatch set, the output must be identical to the template. @@ -165,7 +165,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. of relevant device configuration file. The devicetype value must correspond to a valid device configuration file. xCAT ships some default configuration files - for Ethernet switches and and IB switches under + for Ethernet switches 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. diff --git a/docs/source/guides/admin-guides/references/man1/snmove.1.rst b/docs/source/guides/admin-guides/references/man1/snmove.1.rst index 80c0fd598..453e64c94 100644 --- a/docs/source/guides/admin-guides/references/man1/snmove.1.rst +++ b/docs/source/guides/admin-guides/references/man1/snmove.1.rst @@ -59,7 +59,7 @@ node is second. The \ **xcatmaster**\ attribute must be set to the hostname of the primary service node as it is known by the node. When the \ **snmove**\ command is run it modifies the xCAT database to -switch the the primary server to the backup server. +switch the primary server to the backup server. It will also check the other services that are being used for the node (tftpserver, monserver, nfsserver, conserver), and if they were set @@ -114,13 +114,13 @@ OPTIONS \ **-l|-**\ **-liteonly**\ - Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of thre nodes the the backup servers. + Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of the nodes to the backup servers. \ **-P|-**\ **-postscripts**\ - Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new serive node. If \ **all**\ is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. + Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service node. If \ **all**\ is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. diff --git a/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst b/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst index 55c8b6f4e..158c5f4cf 100644 --- a/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst +++ b/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst @@ -44,7 +44,7 @@ The \ **swapnodes**\ command shouldn't make the decision of which 2 nodes are s After running \ **swapnodes**\ command, the order of the I/O devices may be changed after IO re-assignment, so the administrator needs to run \ **rbootseq**\ to set the boot string for the current_node. And then boot the node with the same image and same postscripts because they have the same attributes. -Without \ **-o**\ option, it's used to swap the location info in the db between 2 nodes. With \ **-o**\ option, it's used to move the \ *current_node*\ definition to \ *fip_node*\ (the 2nd octant), not move the \ *fip_node*\ definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the \ *current_node*\ is a defective non-compute node, and \ *fip_node*\ is a avaible compute node. After the swapping, the \ *current_node*\ will be a available node. +Without \ **-o**\ option, it's used to swap the location info in the db between 2 nodes. With \ **-o**\ option, it's used to move the \ *current_node*\ definition to \ *fip_node*\ (the 2nd octant), not move the \ *fip_node*\ definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the \ *current_node*\ is a defective non-compute node, and \ *fip_node*\ is a available compute node. After the swapping, the \ *current_node*\ will be a available node. ******* @@ -94,7 +94,7 @@ EXAMPLES -1. To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped, and the the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. +1. To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped, and the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. .. code-block:: perl @@ -104,7 +104,7 @@ EXAMPLES -2. To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. +2. To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst index 1ba9aff9b..e84f3e74d 100644 --- a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst @@ -23,13 +23,13 @@ DESCRIPTION *********** -The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format. +The switchdiscover command scans the subnets and discovers all the switches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format. \ **-**\ **-setup**\ flag is for switch-based switch discovery. It will find all the discovered switches on the subnets, then match them with predefined switches in the xCATDB. Next, it will set discovered switches with static ip address and hostname based on the predefined switch. It will also enable snmpv3 configuration. The details of the process are defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html. -To view all the switches defined in the xCAT databasee use \ **lsdef -w "nodetype=switch"**\ command. +To view all the switches defined in the xCAT database use \ **lsdef -w "nodetype=switch"**\ command. -For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep packge or you can get it from http://vincentbernat.github.io/lldpd/installation.html. +For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html. For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. @@ -102,13 +102,13 @@ OPTIONS \ **-x**\ - XML formated output. + XML formatted output. \ **-z**\ - Stanza formated output. + Stanza formatted output. 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 55043ad8d..cd9a37448 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -325,7 +325,7 @@ PARAMETERS The scripts must be executable and copied to the /install/postscripts directory. Each script can take zero or more parameters. - If parameters are spcified, the whole list needs to be quoted by double quotes. + If parameters are specified, the whole list needs to be quoted by double quotes. For example: @@ -341,7 +341,7 @@ PARAMETERS Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. The currently supported attributes are: "installp_bundle", "otherpkgs", "installp_flags", - "emgr_flags" and "rpm_flags". These attribute are only valid for AIX software + "emgr_flags" and "rpm_flags". These attributes are only valid for AIX software maintenance support. @@ -355,9 +355,7 @@ OPTIONS \ **-**\ **-fanout**\ =\ *fanout_value*\ - Specifies a fanout value for the maximum number of concur- - rently executing remote shell processes. Serial execution - can be specified by indicating a fanout value of \ **1**\ . If \ **-**\ **-fanout**\ is not specified, a default fanout value of \ **64**\ is used. + Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of \ **1**\ . If \ **-**\ **-fanout**\ is not specified, a default fanout value of \ **64**\ is used. @@ -441,7 +439,7 @@ OPTIONS AIX and Linux and updating software (-S) for Linux only. 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 hiearchical cluster, that is the node is serviced by a service 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. diff --git a/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst b/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst index e23510646..9069b27de 100644 --- a/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst @@ -153,7 +153,7 @@ EXAMPLES xcat2nim -l -t node clstrn02 -7. To re-create a NIM machine definiton and display verbose output. +7. To re-create a NIM machine definition and display verbose output. .. code-block:: perl diff --git a/docs/source/overview/quick_start.rst b/docs/source/overview/quick_start.rst index 8bf22dfae..d26fc33b8 100644 --- a/docs/source/overview/quick_start.rst +++ b/docs/source/overview/quick_start.rst @@ -33,7 +33,7 @@ If xCAT looks suitable for your requirement, following steps are recommended pro Now you have the node definition. Verify the hardware control for defined nodes is working. e.g. ``rpower stat``. - Refer to the doc: :doc:`Hardware Management ` to learn how to perform the remote hardware control. + Refer to the doc: :doc:`Hardware Management <../guides/admin-guides/manage_clusters/ppc64le/management/index>` to learn how to perform the remote hardware control. #. Deploy OS on the target nodes diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 3d4058f51..2e967fab5 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -17,7 +17,7 @@ B [B<-u> I] [B<-p> I] B<-i> I B<--ips =head1 DESCRIPTION -The B command will discover Baseboard Management Controllers (BMCs) using a scan mathod. +The B command will discover Baseboard Management Controllers (BMCs) using a scan method. The command uses B to scan active nodes over a specified IP range. The IP range format should be a format that is acceptable by B. @@ -31,7 +31,7 @@ Note: The scan method currently support is B. =item B<--range> -Specify one or more IP ranges acceptable to nmap. IP rance can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. +Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. =item B<-s> diff --git a/xCAT-client/pods/man1/cfgve.1.pod b/xCAT-client/pods/man1/cfgve.1.pod index 93c8dbc60..e2df6268f 100644 --- a/xCAT-client/pods/man1/cfgve.1.pod +++ b/xCAT-client/pods/man1/cfgve.1.pod @@ -81,7 +81,7 @@ The NFS export directory must be configured for read write access and must be owned by vdsm:kvm. B: "/data/images/rhev" is set by default. -B - A host must be specified for a storage doamin as SPM +B - A host must be specified for a storage domain as SPM (Storage Pool Manager) when initialize the storage domain. The role of SPM may be migrated to other host by rhev-m during the running of the datacenter (For example, when the current SPM encountered issue or going to maintenance diff --git a/xCAT-client/pods/man1/chvm.1.pod b/xCAT-client/pods/man1/chvm.1.pod index 99ec573f7..f1ac27855 100644 --- a/xCAT-client/pods/man1/chvm.1.pod +++ b/xCAT-client/pods/man1/chvm.1.pod @@ -114,7 +114,7 @@ This command also supports to change specific partition attributes by specifying For Power 755(use option I<--p775> to specify): -chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. +chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar. @@ -127,7 +127,7 @@ chvm could be used to modify the resources assigned to partitions. The admin sha =head2 zVM specific: -The chvm command modifes the virtual machine's configuration specified in noderange. +The chvm command modifies the virtual machine's configuration specified in noderange. =head1 OPTIONS @@ -248,7 +248,7 @@ Purge the Hard disk. Deregisters and deletes the files. Multiple can be done w =item B<--resize> I=I -Change the size of the Hard disk. The disk in I format can not be set to less than it's current size. The disk in I format can be resized smaller, use caution. Multiple disks can be resized by using comma separated IB<=>I pairs. The disks are specified by SCSI id. Size defaults to GB. +Change the size of the Hard disk. The disk in I format can not be set to less than its current size. The disk in I format can be resized smaller, use caution. Multiple disks can be resized by using comma separated IB<=>I pairs. The disks are specified by SCSI id. Size defaults to GB. =back diff --git a/xCAT-client/pods/man1/csm2xcat.1.pod b/xCAT-client/pods/man1/csm2xcat.1.pod index fc1f66411..dffc47c79 100644 --- a/xCAT-client/pods/man1/csm2xcat.1.pod +++ b/xCAT-client/pods/man1/csm2xcat.1.pod @@ -11,7 +11,7 @@ B [B<-h>] =head1 DESCRIPTION -The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The commmand will build two xCAT stanza files that can update the xCAT database with the chdef command. +The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The command will build two xCAT stanza files that can update the xCAT database with the chdef command. Copy the csm2xcat command to the CSM Management Server. Run the command, indicating where you want your stanza files saved with the B<--dir> parameter. Check the stanza files to see if the information is what you want put in the xCAT database. Copy the two stanza files: node.stanza, device.stanza back to your xCAT Management node, and run the chdef command to input into the xCAT database. diff --git a/xCAT-client/pods/man1/db2sqlsetup.1.pod b/xCAT-client/pods/man1/db2sqlsetup.1.pod index 4bf2768de..8d9e9f059 100644 --- a/xCAT-client/pods/man1/db2sqlsetup.1.pod +++ b/xCAT-client/pods/man1/db2sqlsetup.1.pod @@ -28,7 +28,7 @@ For full information on the setup of DB2, see Setting_Up_DB2_as_the_xCAT_DB. When running of db2sqlsetup on the MN: One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable. -The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overriden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. +The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overridden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. When running db2sqlseutp on the SN: Not only will the password for the DB2 instance Id be prompted for and must match the one on the Management Node; but also the hostname or ip address of the Management Node as known by the Service Node must be supplied , unless the XCATDB2SERVER environment variable is set. diff --git a/xCAT-client/pods/man1/dumpxCATdb.1.pod b/xCAT-client/pods/man1/dumpxCATdb.1.pod index b9e155a08..fbdf7e392 100644 --- a/xCAT-client/pods/man1/dumpxCATdb.1.pod +++ b/xCAT-client/pods/man1/dumpxCATdb.1.pod @@ -17,7 +17,7 @@ If not using the binary dump option (-b), then the dumpxCATdb command creates .c Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables. The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records. -If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilites for backup of the entire database. +If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilities for backup of the entire database. =head1 OPTIONS @@ -28,7 +28,7 @@ B<-v> Command Version. B<-V> Verbose. -B<-a> All,without this flag the eventlog and auditlog will be skipped. +B<-a> All, without this flag the eventlog and auditlog will be skipped. B<-b> This flag is only used for the DB2 or postgreSQL database. The routine will use the database backup utilities to create a binary backup of the entire database. Note to use this backup on DB2, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions. diff --git a/xCAT-client/pods/man1/genimage.1.pod b/xCAT-client/pods/man1/genimage.1.pod index 7d2414604..bc4f09d8b 100644 --- a/xCAT-client/pods/man1/genimage.1.pod +++ b/xCAT-client/pods/man1/genimage.1.pod @@ -29,7 +29,7 @@ for stateless: B for statelite: B -Besides prompting for some paramter values, the B command takes default guesses for the parameters not specified or not defined in the I and I tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use B<--interactive> flag if you want the yum/zypper command to prompt you for the answers. +Besides prompting for some parameter values, the B command takes default guesses for the parameters not specified or not defined in the I and I tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use B<--interactive> flag if you want the yum/zypper command to prompt you for the answers. If B<--onlyinitrd> is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. diff --git a/xCAT-client/pods/man1/geninitrd.1.pod b/xCAT-client/pods/man1/geninitrd.1.pod index fce267474..f2d4cfc7a 100644 --- a/xCAT-client/pods/man1/geninitrd.1.pod +++ b/xCAT-client/pods/man1/geninitrd.1.pod @@ -26,7 +26,7 @@ If the initrd has been rebuilt by geninitrd, when run nodeset, the I<--noupdatei should be used to skip the rebuilding of initrd to improve the performance. Three attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. B - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -51,7 +51,7 @@ this command is used to generate the initrd from the rootimg which generated by So the 'genimage' must be run once before running the geninitrd command. Two attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. B - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -64,7 +64,7 @@ B - comma separated driver rpm packages (full path should be sp =head1 Parameters -I specifies the name of an os image definition to be used. The specification for the image is storted in the I table and I table. +I specifies the name of an os image definition to be used. The specification for the image is stored in the I table and I table. =over 12 diff --git a/xCAT-client/pods/man1/getadapter.1.pod b/xCAT-client/pods/man1/getadapter.1.pod index 0c10af7a1..d9e43c6e9 100644 --- a/xCAT-client/pods/man1/getadapter.1.pod +++ b/xCAT-client/pods/man1/getadapter.1.pod @@ -16,8 +16,8 @@ B use genesis to collect network adapters information, so that mean B For each node within the , follows below scheme: -If the target node is scaned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. -If the target node has ever been scaned, B will use the information from nics table first. +If the target node is scanned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. +If the target node has ever been scanned, B will use the information from nics table first. If user hopes to scan the adapter information for the node but these information already exist, B<-f> option can be used to start rescan process. B tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. diff --git a/xCAT-client/pods/man1/getmacs.1.pod b/xCAT-client/pods/man1/getmacs.1.pod index 68572339f..8bbbb8d17 100644 --- a/xCAT-client/pods/man1/getmacs.1.pod +++ b/xCAT-client/pods/man1/getmacs.1.pod @@ -23,12 +23,12 @@ B I [B<-V>| B<--verbose>] [B<-d>] [B<--arp>] [B<-i> I =head1 DESCRIPTION The getmacs command collects MAC address from a single or range of nodes. -Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04). +Note that on AIX systems, the returned MAC address is not colon-separated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-separated (for example 8e:e2:24:5c:f0:04). If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database. For PPC (using Direct FSP Management) specific: -Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform B with option "B<-D>", since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses. +Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform B with option "B<-D>", since there is no HMC command to read them and getmacs has to login to open firmware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses. For PPC (using HMC) specific: @@ -42,7 +42,7 @@ Note: If "B<-d>" is specified, all the MAC of the blades will be displayed. If n B<--arp> -Read MAC address with ARP protocal. +Read MAC address with ARP protocol. B<-C> @@ -58,7 +58,7 @@ Perform discovery for mac address. By default, it will run ping test to test th B<-f> -Force immediate shutdown of the partition.This flag must be used with -D flag. +Force immediate shutdown of the partition. This flag must be used with -D flag. B<-F> @@ -86,7 +86,7 @@ Read MAC address when the lpar is in openfirmware state. This option mush be us B<-S> -The IP address of the machine to ping. The default is to read from xCAT databse if no B<-S> specified. +The IP address of the machine to ping. The default is to read from xCAT database if no B<-S> specified. B<-v> @@ -122,7 +122,7 @@ Output is similar to: ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -2. To retrieve the MAC address with ARP protocal: +2. To retrieve the MAC address with ARP protocol: getmacs lpar4 --arp diff --git a/xCAT-client/pods/man1/groupfiles4dsh.1.pod b/xCAT-client/pods/man1/groupfiles4dsh.1.pod index 171b99978..7f2281eba 100644 --- a/xCAT-client/pods/man1/groupfiles4dsh.1.pod +++ b/xCAT-client/pods/man1/groupfiles4dsh.1.pod @@ -15,7 +15,7 @@ This tool will build a directory of files, one for each defined nodegroup in xCAT. The file will be named the nodegroup name and contain a list of nodes that belong to the nodegroup. The file can be used as input to the AIX dsh command. -The purpose of this tool is to allow backward compatiblity with scripts +The purpose of this tool is to allow backward compatibility with scripts that were created using the AIX or CSM dsh command Reference: man dsh. diff --git a/xCAT-client/pods/man1/imgexport.1.pod b/xCAT-client/pods/man1/imgexport.1.pod index a2376df26..0e535a57b 100644 --- a/xCAT-client/pods/man1/imgexport.1.pod +++ b/xCAT-client/pods/man1/imgexport.1.pod @@ -45,7 +45,7 @@ For statelite: where x is the name of the profile. -Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using B<-e> flag. +Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themselves need to be manualy exported using B<-e> flag. For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported. diff --git a/xCAT-client/pods/man1/imgimport.1.pod b/xCAT-client/pods/man1/imgimport.1.pod index f652f9d74..2757ee48a 100644 --- a/xCAT-client/pods/man1/imgimport.1.pod +++ b/xCAT-client/pods/man1/imgimport.1.pod @@ -50,7 +50,7 @@ If B<-p> flag is specified, the I table will be updated with the po If B<-f> flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, I will be copied to I and I will be copied to I. This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one. -After this command, you can run the B command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment. +After this command, you can run the B command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node deployment. For stateful: nodeset diff --git a/xCAT-client/pods/man1/liteimg.1.pod b/xCAT-client/pods/man1/liteimg.1.pod index 4a98c114a..9f8ed39ff 100644 --- a/xCAT-client/pods/man1/liteimg.1.pod +++ b/xCAT-client/pods/man1/liteimg.1.pod @@ -41,7 +41,7 @@ Note: If you make any changes to your litefile table after running liteimg then =head1 PARAMETERS -I specifies the name of a os image definition to be used. The specification for the image is storted in the I table and I table. +I specifies the name of a os image definition to be used. The specification for the image is stored in the I table and I table. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/lsflexnode.1.pod b/xCAT-client/pods/man1/lsflexnode.1.pod index bcb1a2c93..4fa436316 100644 --- a/xCAT-client/pods/man1/lsflexnode.1.pod +++ b/xCAT-client/pods/man1/lsflexnode.1.pod @@ -22,7 +22,7 @@ There are several concepts to support the HX5 multiple blades combination: B: Multiple blades which combined by a scalability card is a complex. -B: A logic concept which containing part of the B in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) +B: A logic concept which containing part of the B in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) B: The physical blade which installed in the slot of a chassis. It can be a HX5 or MD. diff --git a/xCAT-client/pods/man1/lskitcomp.1.pod b/xCAT-client/pods/man1/lskitcomp.1.pod index 413e7f6be..dfd6e307c 100644 --- a/xCAT-client/pods/man1/lskitcomp.1.pod +++ b/xCAT-client/pods/man1/lskitcomp.1.pod @@ -57,7 +57,7 @@ Return the output with XML tags. The data is returned as: -Each tag contains info for a group of kit compoonents belonging to the same kit. The info inside is structured as follows: +Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: The sub-tag contains the kit's name. The sub-tags store info about the kit's components. diff --git a/xCAT-client/pods/man1/lsslp.1.pod b/xCAT-client/pods/man1/lsslp.1.pod index 81d5cfdef..fe1e04cac 100755 --- a/xCAT-client/pods/man1/lsslp.1.pod +++ b/xCAT-client/pods/man1/lsslp.1.pod @@ -19,13 +19,13 @@ NOTE: SLP broadcast requests will propagate only within the subnet of the networ =head1 OPTIONS -B The nodes which the user want to discover. If the user specify the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. +B The nodes which the user wants to discover. If the user specifies the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. B<-i> IP(s) the command will send out (defaults to all available adapters). B<-h> Display usage message. -B<-n> Only display and write the newly discovered hardwares. +B<-n> Only display and write the newly discovered hardware. B<-u> Do unicast to a specified IP range. Must be used with B<-s> and B<--range>. The B<-u> flag is not supported on AIX. @@ -33,16 +33,16 @@ B<--range> Specify one or more IP ranges. Must be use in unicast mode. It ac B<-r> Display Raw SLP response. -B<-C> The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 secondes. The user can use -T flag the specify the time they want to use. A short time will limite the time costing, while a long time will help to find all the nodes. +B<-C> The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 seconds. The user can use -T flag the specify the time they want to use. A short time will limit the time costing, while a long time will help to find all the nodes. -B<-T> The number in seconds to limite the time costing of lsslp. +B<-T> The number in seconds to limit the time of lsslp. B<-s> Service type interested in discovering. B<-t> Number or service-request attempts. -B<--vpdtable> Output the SLP response in vpdtable formatting. Easy for writting data to vpd table. +B<--vpdtable> Output the SLP response in vpdtable formatting. Easy for writing data to vpd table. B<-v> Command Version. @@ -52,9 +52,9 @@ B<-w> Writes output to xCAT database. B<-x> XML format. -B<-z> Stanza formated output. +B<-z> Stanza formatted output. -B<-I> Give the warning message for the nodes in database which have no SLP responses. Note that this flag noly can be used after the database migration finished successfully. +B<-I> Give the warning message for the nodes in database which have no SLP responses. Note that this flag can only be used after the database migration finished successfully. =head1 RETURN VALUE diff --git a/xCAT-client/pods/man1/lstree.1.pod b/xCAT-client/pods/man1/lstree.1.pod index 182abe37b..618151539 100644 --- a/xCAT-client/pods/man1/lstree.1.pod +++ b/xCAT-client/pods/man1/lstree.1.pod @@ -10,7 +10,7 @@ B [B<-s> | B<--servicenode>] [B<-H> | B<--hardwaremgmt>] [B<-v> | B<--vi =head1 DESCRIPTION -The B command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to disply VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. +The B command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to display VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/lsvm.1.pod b/xCAT-client/pods/man1/lsvm.1.pod index d588fbf42..ac802ed7a 100644 --- a/xCAT-client/pods/man1/lsvm.1.pod +++ b/xCAT-client/pods/man1/lsvm.1.pod @@ -248,7 +248,7 @@ Output is similar to: Bytes per BSR array: 4096 Available BSR array: 256 -Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. +Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class description)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. 9. For DFM-managed partition on normal power machine, list out the detailed information: diff --git a/xCAT-client/pods/man1/mkdef.1.pod b/xCAT-client/pods/man1/mkdef.1.pod index 8f5cdb899..af59220b2 100644 --- a/xCAT-client/pods/man1/mkdef.1.pod +++ b/xCAT-client/pods/man1/mkdef.1.pod @@ -50,7 +50,7 @@ A set of comma delimited object types. Use the help option to get a list of val =item B<--template> I -Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of B command. If there are a template and an existing object with the same name I, the tempalte object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of B<--template> option in L. +Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of B command. If there are a template and an existing object with the same name I, the template object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of B<--template> option in L. =item B<-V|--verbose> @@ -58,7 +58,7 @@ Verbose mode. =item B<-w> I B<-w> I ... -Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef commmand, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. +Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. Operator descriptions: == Select nodes where the attribute value is exactly this value. diff --git a/xCAT-client/pods/man1/mkdocker.1.pod b/xCAT-client/pods/man1/mkdocker.1.pod index 1f9ee535c..dcb4eb0e4 100644 --- a/xCAT-client/pods/man1/mkdocker.1.pod +++ b/xCAT-client/pods/man1/mkdocker.1.pod @@ -82,7 +82,7 @@ Output is similar to: host01c01: Pull image ubuntu start host01c01: Pull image ubuntu done host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success 2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". @@ -92,7 +92,7 @@ Output is similar to: Output is similar to: host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success =head1 SEE ALSO diff --git a/xCAT-client/pods/man1/mkdsklsnode.1.pod b/xCAT-client/pods/man1/mkdsklsnode.1.pod index 5e0a95278..3b51f160f 100644 --- a/xCAT-client/pods/man1/mkdsklsnode.1.pod +++ b/xCAT-client/pods/man1/mkdsklsnode.1.pod @@ -19,7 +19,7 @@ This command will also create a NIM resolv_conf resource to be used when install The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -41,11 +41,11 @@ You can use the "-n" option of the mkdsklsnode command to create and initialize B When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes. The NIM resources should not be shared between the old osimage and the new osimage. -You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. +You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. After the mkdsklsnode command completes you can use the B command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/mknimimage.1.pod b/xCAT-client/pods/man1/mknimimage.1.pod index 78dc2b00e..700ccdc43 100644 --- a/xCAT-client/pods/man1/mknimimage.1.pod +++ b/xCAT-client/pods/man1/mknimimage.1.pod @@ -24,7 +24,7 @@ B When creating a diskless osimage definition you also have the option of automatically updating the NIM SPOT resource. You can have additional software installed or you can have configuration files added or updated. To have software installed you must provide either the names of NIM installp_bundle resources or fileset names on the command line using the "attr=val" option. You may also supply the installp flags, RPM flags, emgr flags to use when installing the software. -To have configuration files updated you must provide the full path name of a "synclists" file which contains the the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. +To have configuration files updated you must provide the full path name of a "synclists" file which contains the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. B @@ -50,7 +50,7 @@ You can use the "-i" and "-p" options to copy an existing diskless osimage. To - any other resources (or attributes) included in the original osimage will be included in the new osimage definition. -- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redfined to NIM. (The default would be to use the original lpp_source - to save file system space.) +- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redefined to NIM. (The default would be to use the original lpp_source - to save file system space.) B @@ -67,7 +67,7 @@ To list a NIM resource definition use the AIX B command ("lsnim -l command ("nim -o check "). -To remove specific NIM resource definitons use the AIX B command. ("nim -o remove "). +To remove specific NIM resource definitions use the AIX B command. ("nim -o remove "). =head1 OPTIONS @@ -187,7 +187,7 @@ Value Specifies the security method required for NFS access. =back -Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). +Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma separated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). =item B<-b> I @@ -195,7 +195,7 @@ Used to specify the path name of a mksysb file to use when defining a NIM mksysb =item B<-c|--completeosimage> -Complete the creation of the osimage definition passed in on the command line. This option will use any additonal values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. +Complete the creation of the osimage definition passed in on the command line. This option will use any additional values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. =item B<-f|--force> @@ -333,7 +333,7 @@ The xCAT osimage definition created by this command will include the "otherpkgs" mknimimage -u 61dskls installp_bundle=bndres1,bndres2 installp_flags="-agcQX" -Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definiton is not used or updated. +Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definition is not used or updated. 13) Update an existing image to support NFSv4. Also specify verbose messages. diff --git a/xCAT-client/pods/man1/mkvm.1.pod b/xCAT-client/pods/man1/mkvm.1.pod index 700521841..fd98f4525 100644 --- a/xCAT-client/pods/man1/mkvm.1.pod +++ b/xCAT-client/pods/man1/mkvm.1.pod @@ -88,7 +88,7 @@ Request to create a new full system partition for each CEC. =item B I B I B I B I B I B I [B<--vios>] -To specify the parameters which are used to create a partition. The I, I are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. +To specify the parameters which are used to create a partition. The I, I are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. The option I is used to specify the partition that will be created is a VIOS partition. If specified, the value for I shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for I, all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of I to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. @@ -241,7 +241,7 @@ First, define a node object: mkdef -t node -o lpar1 mgt=fsp cons=fsp nodetype=ppc,osi id=1 hcp=cec parent=cec hwtype=lpar groups=lpar,all -Then, create the partion on the specified cec. +Then, create the partition on the specified cec. mkvm lpar1 --full @@ -321,7 +321,7 @@ The output is similar to: mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios -The resouces for the node is similar to: +The resources for the node is similar to: viosnode: Lpar Processor Info: Curr Processor Min: 1. diff --git a/xCAT-client/pods/man1/monadd.1.pod b/xCAT-client/pods/man1/monadd.1.pod index 1e587afdd..1ad4bd093 100644 --- a/xCAT-client/pods/man1/monadd.1.pod +++ b/xCAT-client/pods/man1/monadd.1.pod @@ -18,9 +18,9 @@ This command is used to register a monitoring plug-in module to monitor the xCAT =head1 Parameters -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. -I is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: I<-s key-value -s key=value ...> Note that the square brackets are needed here. Use I command to look for the possbile setting keys for a plug-in module. +I is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: I<-s key-value -s key=value ...> Note that the square brackets are needed here. Use I command to look for the possible setting keys for a plug-in module. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/moncfg.1.pod b/xCAT-client/pods/man1/moncfg.1.pod index a1fc5a20c..47a3bba3a 100644 --- a/xCAT-client/pods/man1/moncfg.1.pod +++ b/xCAT-client/pods/man1/moncfg.1.pod @@ -15,12 +15,12 @@ B I I<[noderange]> B<[-r|--remote]> =head1 DESCRIPTION -This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified, though the configuration of the nodes is usually performed during the node deployment stage. +This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configuration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified, though the configuration of the nodes is usually performed during the node deployment stage. =head1 Parameters -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. I specifies the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/xCAT-client/pods/man1/mondecfg.1.pod b/xCAT-client/pods/man1/mondecfg.1.pod index 1884ab1b1..6f7ccc753 100644 --- a/xCAT-client/pods/man1/mondecfg.1.pod +++ b/xCAT-client/pods/man1/mondecfg.1.pod @@ -15,7 +15,7 @@ B I I<[noderange]> B<[-r|--remote]> =head1 DESCRIPTION -This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified. The deconfigration operation will remove the nodes from the 3rd party software's monitoring domain. +This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified. The deconfiguration operation will remove the nodes from the 3rd party software's monitoring domain. =head1 PARAMETERS diff --git a/xCAT-client/pods/man1/monls.1.pod b/xCAT-client/pods/man1/monls.1.pod index 55cd86498..c9130a98e 100644 --- a/xCAT-client/pods/man1/monls.1.pod +++ b/xCAT-client/pods/man1/monls.1.pod @@ -15,7 +15,7 @@ B =head1 DESCRIPTION -This command is used to list the status, desctiption, the configuration scripts and the settings of one or all of the monitoring plug-in modules. +This command is used to list the status, description, the configuration scripts and the settings of one or all of the monitoring plug-in modules. =head1 Parameters @@ -26,9 +26,9 @@ I is the name of the monitoring plug-in module. =head1 OPTIONS -B<-a | --all> Searches the I directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the I tabel. +B<-a | --all> Searches the I directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the I table. -B<-d | --description> Display the description of the plug-in modules. The description ususally contains the possible settings. +B<-d | --description> Display the description of the plug-in modules. The description usually contains the possible settings. B<-h | --help> Display usage message. @@ -64,7 +64,7 @@ The output looks like this: nagiosmon not-monitored -3. To list the status and the desciption for I module, enter: +3. To list the status and the description for I module, enter: monls snmpmon -d diff --git a/xCAT-client/pods/man1/monshow.1.pod b/xCAT-client/pods/man1/monshow.1.pod index 22d4309f9..c3aa85385 100755 --- a/xCAT-client/pods/man1/monshow.1.pod +++ b/xCAT-client/pods/man1/monshow.1.pod @@ -36,7 +36,7 @@ B<-t> specifies a range of time for the data, The default is last 60 minutes. Fo B<-a> specifies a comma-separated list of attributes or metrics names. The default is all. -B<-w> specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, serverity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. +B<-w> specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, severity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. Operator descriptions: diff --git a/xCAT-client/pods/man1/monstart.1.pod b/xCAT-client/pods/man1/monstart.1.pod index 624fad4fa..092d6a399 100644 --- a/xCAT-client/pods/man1/monstart.1.pod +++ b/xCAT-client/pods/man1/monstart.1.pod @@ -18,7 +18,7 @@ This command is used to start a 3rd party software, (for example start the daemo =head1 PARAMETERS -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use B command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use B command to list all the monitoring plug-in modules that can be used. I is the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/xCAT-client/pods/man1/nimnodecust.1.pod b/xCAT-client/pods/man1/nimnodecust.1.pod index ea5eaa711..93cba2a36 100644 --- a/xCAT-client/pods/man1/nimnodecust.1.pod +++ b/xCAT-client/pods/man1/nimnodecust.1.pod @@ -30,9 +30,9 @@ To create a NIM installp_bundle definition you can use the "nim -o define" opera nim -o define -t installp_bundle -a server=master -a location=/install/nim/mypkgs.bnd mypackages -See the AIX documantation for more information on using installp_bundle files. +See the AIX documentation for more information on using installp_bundle files. -The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierachical environment. +The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierarchical environment. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/nimnodeset.1.pod b/xCAT-client/pods/man1/nimnodeset.1.pod index 2e9b9835f..04ecd9587 100644 --- a/xCAT-client/pods/man1/nimnodeset.1.pod +++ b/xCAT-client/pods/man1/nimnodeset.1.pod @@ -14,7 +14,7 @@ This xCAT command can be used to initialize AIX/NIM standalone machines. Once th If you are using xCAT service nodes the B command will automatically determine the correct server(s) for the node and do the initialization on that server(s). -The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definiions. +The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definitions. This command will also create a NIM resolv_conf resource to be used when installing the node. If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes. @@ -22,7 +22,7 @@ NIM resolv_conf resource will be created and allocated to the nodes. The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -35,13 +35,13 @@ will be created. You can specify additional attributes and values using the "attr=val" command line option. This information will be passed on to the underlying call to the NIM "nim -o bos_inst" command. See the NIM documentation for information on valid command line options for the nim command. The "attr" must correspond to a NIM attribute supported for the NIM "bos_inst" operation. Information provided by the "attr=val" option will take precedence over the information provided in the osimage definition. -The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. +The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. This command will also create a NIM script resource to enable the xCAT support for user-provided customization scripts. After the B command completes you can use the B command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 OPTIONS @@ -50,7 +50,7 @@ You can supply your own scripts to be run on the management node or on the serv =item I Specifies one or more "attribute equals value" pairs, separated by spaces. Attr= -val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma seperated list. (ex. "script=ascript,bscript"). +val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma separated list. (ex. "script=ascript,bscript"). =item B<-b|--backupSN> @@ -70,8 +70,7 @@ The name of an existing xCAT osimage definition. =item B<-l|--location> -The directory location to use when creating new NIM resolv_conf resources. The d -efault location is /install/nim. +The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim. =item B<-p|--primarySN> diff --git a/xCAT-client/pods/man1/nodeaddunmged.1.pod b/xCAT-client/pods/man1/nodeaddunmged.1.pod index 60258c7a0..675daa669 100644 --- a/xCAT-client/pods/man1/nodeaddunmged.1.pod +++ b/xCAT-client/pods/man1/nodeaddunmged.1.pod @@ -34,7 +34,7 @@ Sets the IP address of the unmanaged node, where I is the IP address 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodechmac.1.pod b/xCAT-client/pods/man1/nodechmac.1.pod index 593b20a51..0bf9830f8 100644 --- a/xCAT-client/pods/man1/nodechmac.1.pod +++ b/xCAT-client/pods/man1/nodechmac.1.pod @@ -36,7 +36,7 @@ Sets the new MAC address for the NIC used by the provisioning node, where is 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverls.1.pod b/xCAT-client/pods/man1/nodediscoverls.1.pod index 5b6af9bf6..bde7b37e0 100644 --- a/xCAT-client/pods/man1/nodediscoverls.1.pod +++ b/xCAT-client/pods/man1/nodediscoverls.1.pod @@ -76,7 +76,7 @@ Command version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstart.1.pod b/xCAT-client/pods/man1/nodediscoverstart.1.pod index 165a68d5a..4e3b98d37 100755 --- a/xCAT-client/pods/man1/nodediscoverstart.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstart.1.pod @@ -52,7 +52,7 @@ When the nodes are discovered, PCM updates the affected configuration files on t When you power on the nodes, they PXE boot and DHCP/TFTP/HTTP on the management node give each node the xCAT genesis boot image, which inventories the node hardware and sends data to the management node. There, either the sequential discovery process or the -profile discovery process assigns node attributes and defines the node in the the database. +profile discovery process assigns node attributes and defines the node in the database. =head1 OPTIONS @@ -99,7 +99,7 @@ Sets the node groups that the discovered nodes should be put in for either the S Sets the rack name where the node is located for either the Sequential Discovery or Profile Discovery methods. -=item BI +=item BI Sets the chassis name that the Blade server or PureFlex blade is located in, for either the Sequential Discovery or Profile Discovery methods. This option is used for the Blade server and PureFlex system only. You cannot specify this option with the rack option. @@ -146,7 +146,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstatus.1.pod b/xCAT-client/pods/man1/nodediscoverstatus.1.pod index 2e261fdef..f65597e40 100644 --- a/xCAT-client/pods/man1/nodediscoverstatus.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstatus.1.pod @@ -25,7 +25,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstop.1.pod b/xCAT-client/pods/man1/nodediscoverstop.1.pod index 8cde9a0cb..b8ce5b563 100644 --- a/xCAT-client/pods/man1/nodediscoverstop.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstop.1.pod @@ -26,7 +26,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodeimport.1.pod b/xCAT-client/pods/man1/nodeimport.1.pod index 30087957b..2c3b670f7 100644 --- a/xCAT-client/pods/man1/nodeimport.1.pod +++ b/xCAT-client/pods/man1/nodeimport.1.pod @@ -10,7 +10,7 @@ B B I B I command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location infomation like rack, chassis, start unit, server height...etc +The B command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location information like rack, chassis, start unit, server height...etc After nodes imported, the configuration files related with these nodes will be updated automatically. For example: /etc/hosts, dns configuration, dhcp configuration. And the kits node plugins will also be triggered automatically to update kit related configuration/services. @@ -56,9 +56,9 @@ Sets the node groups that the imported node belongs to, where is a 0 The command completed successfully. -1 An error has occured while validating parameters. +1 An error has occurred while validating parameters. -2 An error has occured while parsing hostinfo file. +2 An error has occurred while parsing hostinfo file. =head1 EXAMPLES @@ -106,7 +106,7 @@ To import nodes using a profile, follow the following steps: # hostinfo end. - Another example of a node infomation file, a PureFlex X/P node defined: + Another example of a node information file, a PureFlex X/P node defined: # hostinfo begin # To define a PureFlex P/X node, chassis and slot id must be specified. # The chassis must be a PureFlex chassis. @@ -153,7 +153,7 @@ Description: The name of the node, where __hostname__ is automatically generated B> This is a mandatory item. -Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. +Description: Specify the MAC address for the NIC used by the provisioning node, where is the NICs MAC address. B> This is a mandatory item, when define switch, switchport and node nic name relationship. @@ -183,9 +183,9 @@ B> This is an optional item. Description: node location info. Specify the rack name which this node will be placed into. If not specify this item, there will be no node location info set for this node. this item must be specified together with height + unit. -B> This is an optional item. +B> This is an optional item. -Description: node location info, for blade(or PureFlex) only. Specify the chasiss name which this blade will be placed into. this item can not be specified together with rack. +Description: node location info, for blade(or PureFlex) only. Specify the chassis name which this blade will be placed into. this item can not be specified together with rack. B> This is an optional item. diff --git a/xCAT-client/pods/man1/nodels.1.pod b/xCAT-client/pods/man1/nodels.1.pod index b976091bf..e3e76cd58 100644 --- a/xCAT-client/pods/man1/nodels.1.pod +++ b/xCAT-client/pods/man1/nodels.1.pod @@ -75,7 +75,7 @@ Force display of table name and column name context for each result =item B<-b|--blame> -For values inherited from groups, display which groups provided the inheritence +For values inherited from groups, display which groups provided the inheritance =item B<-S> diff --git a/xCAT-client/pods/man1/nodepurge.1.pod b/xCAT-client/pods/man1/nodepurge.1.pod index 73b6a94ba..714f164f2 100644 --- a/xCAT-client/pods/man1/nodepurge.1.pod +++ b/xCAT-client/pods/man1/nodepurge.1.pod @@ -32,7 +32,7 @@ The nodes to be removed. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/noderefresh.1.pod b/xCAT-client/pods/man1/noderefresh.1.pod index b25693c71..cafd50986 100644 --- a/xCAT-client/pods/man1/noderefresh.1.pod +++ b/xCAT-client/pods/man1/noderefresh.1.pod @@ -30,7 +30,7 @@ The nodes to be updated. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodestat.1.pod b/xCAT-client/pods/man1/nodestat.1.pod index 42a0dc5f0..fd964a3c9 100644 --- a/xCAT-client/pods/man1/nodestat.1.pod +++ b/xCAT-client/pods/man1/nodestat.1.pod @@ -41,7 +41,7 @@ Keywords to use: port -- the application daemon port number, if not specified, use internal list, then /etc/services. group -- the name of a node group that needs to get the application status from. If not specified, assume all the nodes in the nodelist table. To specify more than one groups, use group=a,group=b format. cmd -- the command that will be run locally on mn or sn. - lcmd -- the command that will be run the the mn only. + lcmd -- the command that will be run the mn only. dcmd -- the command that will be run distributed on the nodes using xdsh .... For commands specified by 'cmd' and 'lcmd', the input of is a list of comma separated node names, the output must be in the following format: @@ -63,7 +63,7 @@ Uses fping instead of nmap even if nmap is available. If you seem to be having =item B<-m>|B<--usemon> -Uses the settings from the B talbe to determine a list of applications that need to get status for. +Uses the settings from the B table to determine a list of applications that need to get status for. =item B<-p>|B<--powerstat> diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index de1f11e60..091eec11a 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -40,7 +40,7 @@ The command will update firmware for NeXtScale FPC when given an FPC node and th =head2 PPC (with HMC) specific: -The B command uses the B command to connect to the HMC controlling the given managed system and perform the updates. Before running B, use B to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B comamnd. +The B command uses the B command to connect to the HMC controlling the given managed system and perform the updates. Before running B, use B to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B command. B This command may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. @@ -50,7 +50,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f The B<--commit> flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The B<--recover> flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored. -BWhen the B<--commit> or B<--recover> two flags is used, the noderange B be BPA. It only B be CEC or LPAR ,and will take effect for B managed systems and power subsystems. +BWhen the B<--commit> or B<--recover> two flags is used, the noderange B be BPA. It only B be CEC or LPAR, and will take effect for B managed systems and power subsystems. xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems. @@ -68,7 +68,7 @@ The B option will load the new firmware into the T (temp) side, but wi In Direct FSP/BPA Management, there is B<-d> I option. The default value is /tmp. When doing firmware update, B will put some related data from rpm packages in directory, so the execution of B will require available disk space in for the command to properly execute: -For one GFW rpm package and one power code rpm package , if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5*gfw_rpmsize + 1.5*power_rpmsize +For one GFW rpm package and one power code rpm package, if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5*gfw_rpmsize + 1.5*power_rpmsize For Power 775, the B command takes effect on the primary and secondary FSPs or BPAs almost in parallel. @@ -76,7 +76,7 @@ For more details about the Firmware Update using Direct FSP/BPA Management, refe =head2 NeXtScale FPC specific: -The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters +The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters =head2 OpenPOWER specific: @@ -92,7 +92,7 @@ Writes the command's usage statement to standard output. =item B<-c|--check> -Chech the firmware version of BMC and HPM file. +Check the firmware version of BMC and HPM file. =item B<-p> I @@ -139,12 +139,12 @@ Verbose output. =over 4 =item 1. -To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: rflash cec_name -p /tmp/fw --activate disruptive =item 2. -To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: rflash bpa_name -p /tmp/fw --activate disruptive @@ -154,7 +154,7 @@ To commit a firmware update to permanent flash for both managed system and the r rflash cec_name --commit =item 4. -To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: +To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: rflash fpc01 http://10.1.147.169/install/firmware/fhet17a/ibm_fw_fpc_fhet17a-2.02_anyos_noarch.rom diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 3a5c92f29..30fab0f2c 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -69,10 +69,10 @@ B I [B<--zfcppoolnames>] =head1 B -B retrieves hardware configuration information from the on-board +B retrieves hardware configuration information from the on-board Service Processor for a single or range of nodes and groups. -Calling B for VMware will display the UUID/GUID, nuumber of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. +Calling B for VMware will display the UUID/GUID, number of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. =head1 B @@ -88,7 +88,7 @@ List all buses for each I/O slot. =item B -Retrieves number of processors, speed, total memory, and DIMM +Retrieves number of processors, speed, total memory, and DIMM locations. =item B diff --git a/xCAT-client/pods/man1/rmdocker.1.pod b/xCAT-client/pods/man1/rmdocker.1.pod index efe339027..d02992870 100644 --- a/xCAT-client/pods/man1/rmdocker.1.pod +++ b/xCAT-client/pods/man1/rmdocker.1.pod @@ -29,7 +29,7 @@ Force to removal of a running container or failed to disconnect customized netwo =head1 EXAMPLES rmdocker host01c01 - host01c01: Disconnect customzied network 'mynet0' done + host01c01: Disconnect customized network 'mynet0' done host01c01: success =head1 SEE ALSO diff --git a/xCAT-client/pods/man1/rmdsklsnode.1.pod b/xCAT-client/pods/man1/rmdsklsnode.1.pod index 9500d2290..f7ed75e27 100644 --- a/xCAT-client/pods/man1/rmdsklsnode.1.pod +++ b/xCAT-client/pods/man1/rmdsklsnode.1.pod @@ -20,11 +20,11 @@ If the node you are trying to remove is currently running the B com B -If you used the "-n" option when you created the NIM client definitions with the B command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions you must provide the name of the osimage that was used using the "-i" option. +If you used the "-n" option when you created the NIM client definitions with the B command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions, you must provide the name of the osimage that was used using the "-i" option. -In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The B option can be used to remove the old alternate client defintions without stopping the running node. +In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The B option can be used to remove the old alternate client definitions without stopping the running node. -However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason it is recommended that you wait to do this cleanup until right before you do your next upgrade. +However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason, it is recommended that you wait to do this cleanup until right before you do your next upgrade. =head1 OPTIONS @@ -36,8 +36,7 @@ Use the force option to stop and remove running nodes. This handles the situatio =item B<-b |--backupSN> -When using backup service nodes only update the backup. The default is to updat -e both the primary and backup service nodes. +When using backup service nodes only update the backup. The default is to update both the primary and backup service nodes. =item B<-h |--help> @@ -53,8 +52,7 @@ A set of comma delimited node names and/or group names. See the "noderange" man =item B<-p|--primarySN> -When using backup service nodes only update the primary. The default is to upda -te both the primary and backup service nodes. +When using backup service nodes only update the primary. The default is to update both the primary and backup service nodes. =item B<-r|--remdef> diff --git a/xCAT-client/pods/man1/rmhwconn.1.pod b/xCAT-client/pods/man1/rmhwconn.1.pod index 86ea9a15e..d0dd7cad9 100644 --- a/xCAT-client/pods/man1/rmhwconn.1.pod +++ b/xCAT-client/pods/man1/rmhwconn.1.pod @@ -24,7 +24,7 @@ B B<-s> For PPC (with HMC) specific: -This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc talbe in xCAT DB. +This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc table in xCAT DB. Note: If a CEC belongs to a frame with a BPA installed, this CEC cannot be disconnected individually. Instead, the whole frame should be disconnected. diff --git a/xCAT-client/pods/man1/rmigrate.1.pod b/xCAT-client/pods/man1/rmigrate.1.pod index fea02a867..2be54a94f 100644 --- a/xCAT-client/pods/man1/rmigrate.1.pod +++ b/xCAT-client/pods/man1/rmigrate.1.pod @@ -49,7 +49,7 @@ The maximum quiesce time a VM may be stopped during a relocation attempt. =head1 B B table - -Table governing VM paramaters. See L for further details. +Table governing VM parameters. See L for further details. This is used to determine the current host to migrate from. =head1 B diff --git a/xCAT-client/pods/man1/rmkitcomp.1.pod b/xCAT-client/pods/man1/rmkitcomp.1.pod index 591f0cfd7..5484300dc 100644 --- a/xCAT-client/pods/man1/rmkitcomp.1.pod +++ b/xCAT-client/pods/man1/rmkitcomp.1.pod @@ -10,7 +10,7 @@ B [B<-V>|B<--verbose>] [B<-u>|B<--uninstall>] [B<-f>|B<--force>] [B<- =head1 DESCRIPTION -The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit comoponent meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. +The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. Note: The xCAT support for Kits is only available for Linux operating systems. diff --git a/xCAT-client/pods/man1/rmvm.1.pod b/xCAT-client/pods/man1/rmvm.1.pod index 959a350d8..2dcf8cc67 100644 --- a/xCAT-client/pods/man1/rmvm.1.pod +++ b/xCAT-client/pods/man1/rmvm.1.pod @@ -37,7 +37,7 @@ B<-r> Retain the data object definitions of the nodes. B<--service> Remove the service partitions of the specified CECs. -B<-p> KVM: Purge the existence of the VM from persistant storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partiton on normal power machine. +B<-p> KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partition on normal power machine. B<-f> Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. diff --git a/xCAT-client/pods/man1/rnetboot.1.pod b/xCAT-client/pods/man1/rnetboot.1.pod index 6b9fc9671..e968e9f2d 100644 --- a/xCAT-client/pods/man1/rnetboot.1.pod +++ b/xCAT-client/pods/man1/rnetboot.1.pod @@ -41,11 +41,11 @@ Note: if the "val" fields includes spaces or any other characters that will be p B<-r> -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. B<-t> -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. B<-V|--verbose> diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index fd676c268..0e38e78c8 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -104,7 +104,7 @@ Exit Rack standby will be the default state that a rack goes into when power is =item B -Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the sametime. +Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the same time. =item B @@ -207,11 +207,11 @@ Do not use dependency table (default is to use dependency table). Valid only wit =item B<-r> I -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. =item B<-t> I -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. Power off, then on. diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index 900224f65..aba5fcd5a 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -416,7 +416,7 @@ Set the blade or MPA textid. When using '*', the textid used is the node name sp =item B={I} B={B} -Change the password of the userid B for CMM in Flex system cluster. The option I can be used to specify whether updating the password of BMCs that connected to the speified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. +Change the password of the userid B for CMM in Flex system cluster. The option I can be used to specify whether updating the password of BMCs that connected to the specified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. If value "*" is specified for USERID and the object node is I, the password used to access the BMC of the System X node through IPMI will be updated as the same password of the userid B of the CMM in the same cluster. diff --git a/xCAT-client/pods/man1/sinv.1.pod b/xCAT-client/pods/man1/sinv.1.pod index 9c08ced7e..b81db7b57 100644 --- a/xCAT-client/pods/man1/sinv.1.pod +++ b/xCAT-client/pods/man1/sinv.1.pod @@ -95,7 +95,7 @@ If there is no match, and we are not over the template count, then a new template will be created from the node output. This will result in having all nodes that match a given template reported in their group at the end of the run in the output file. -If no template count is specified, 0 is the default, and all nodes will +If no template count is specified, 0 is the default, and all nodes will be compared against the first template. =item B<-s>|B<--seed> I @@ -104,7 +104,7 @@ This is the node that will be used to build the first template that is stored in template path. You can use this parameter instead of running the command yourself to build the template. -B If the template path file does not exists, and no seed node is +B If the template path file does not exist, and no seed node is supplied, the seed node automatically is one node in the noderange. @@ -126,7 +126,7 @@ template (except for xdshcoll header and comments). If not in exactmatch mode, there can exist more lines in the xdsh return from the nodes. For example, if running a "rpm -qa | grep xCAT" command, without exactmatch -set, if the node containes more xCAT rpms that listed in the template, +set, if the node contains more xCAT rpms that listed in the template, it would be considered a match, as long as all rpms listed in the template were on the node. With exactmatch set, the output must be identical to the template. @@ -137,7 +137,7 @@ Specify a user-defined device type that references the location of relevant device configuration file. The devicetype value must correspond to a valid device configuration file. xCAT ships some default configuration files -for Ethernet switches and and IB switches under +for Ethernet switches and IB switches under I directory. If you want to overwrite any of the configuration files, copy them to I directory and cutomize. diff --git a/xCAT-client/pods/man1/snmove.1.pod b/xCAT-client/pods/man1/snmove.1.pod index 477ba7ea6..d1e4fad4d 100644 --- a/xCAT-client/pods/man1/snmove.1.pod +++ b/xCAT-client/pods/man1/snmove.1.pod @@ -40,7 +40,7 @@ node is second. The B attribute must be set to the hostname of the primary service node as it is known by the node. When the B command is run it modifies the xCAT database to -switch the the primary server to the backup server. +switch the primary server to the backup server. It will also check the other services that are being used for the node (tftpserver, monserver, nfsserver, conserver), and if they were set @@ -84,11 +84,11 @@ No modifications will be made on the nodes. If not specified, several xCAT posts =item B<-l|--liteonly> -Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of thre nodes the the backup servers. +Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of the nodes to the backup servers. =item B<-P|--postscripts> -Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new serive node. If B is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. +Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service node. If B is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. =item B<-s|--source> diff --git a/xCAT-client/pods/man1/swapnodes.1.pod b/xCAT-client/pods/man1/swapnodes.1.pod index c1e17308f..63b3c59f2 100644 --- a/xCAT-client/pods/man1/swapnodes.1.pod +++ b/xCAT-client/pods/man1/swapnodes.1.pod @@ -25,7 +25,7 @@ The B command shouldn't make the decision of which 2 nodes are swappe After running B command, the order of the I/O devices may be changed after IO re-assignment, so the administrator needs to run B to set the boot string for the current_node. And then boot the node with the same image and same postscripts because they have the same attributes. -Without B<-o> option, it's used to swap the location info in the db between 2 nodes. With B<-o> option, it's used to move the I definition to I (the 2nd octant), not move the I definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the I is a defective non-compute node, and I is a avaible compute node. After the swapping, the I will be a available node. +Without B<-o> option, it's used to swap the location info in the db between 2 nodes. With B<-o> option, it's used to move the I definition to I (the 2nd octant), not move the I definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the I is a defective non-compute node, and I is a available compute node. After the swapping, the I will be a available node. =head1 OPTIONS @@ -61,12 +61,12 @@ one way. Only move the I definition to the I's hardware =over 3 =item 1. -To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped, and the the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. +To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped, and the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. swapnodes -c sn1 -f compute2 =item 2. -To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. +To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. swapnodes -c sn1 -f compute2 diff --git a/xCAT-client/pods/man1/switchdiscover.1.pod b/xCAT-client/pods/man1/switchdiscover.1.pod index 7bcdbc27b..ec16fcaad 100755 --- a/xCAT-client/pods/man1/switchdiscover.1.pod +++ b/xCAT-client/pods/man1/switchdiscover.1.pod @@ -16,13 +16,13 @@ B [I | B<--range> I] B<[-V] [-w][-r|-x|-z] =head1 DESCRIPTION -The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format. +The switchdiscover command scans the subnets and discovers all the switches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format. B<--setup> flag is for switch-based switch discovery. It will find all the discovered switches on the subnets, then match them with predefined switches in the xCATDB. Next, it will set discovered switches with static ip address and hostname based on the predefined switch. It will also enable snmpv3 configuration. The details of the process are defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html. -To view all the switches defined in the xCAT databasee use B command. +To view all the switches defined in the xCAT database use B command. -For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep packge or you can get it from http://vincentbernat.github.io/lldpd/installation.html. +For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html. For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. @@ -77,11 +77,11 @@ Writes output to xCAT database. =item B<-x> -XML formated output. +XML formatted output. =item B<-z> -Stanza formated output. +Stanza formatted output. =item B<--setup> diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index 5f7f060f2..582a9da26 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -249,7 +249,7 @@ A comma-separated list of script names. The scripts must be executable and copied to the /install/postscripts directory. Each script can take zero or more parameters. -If parameters are spcified, the whole list needs to be quoted by double quotes. +If parameters are specified, the whole list needs to be quoted by double quotes. For example: "script1 p1 p2,script2" @@ -259,7 +259,7 @@ For example: Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. The currently supported attributes are: "installp_bundle", "otherpkgs", "installp_flags", -"emgr_flags" and "rpm_flags". These attribute are only valid for AIX software +"emgr_flags" and "rpm_flags". These attributes are only valid for AIX software maintenance support. =back @@ -270,9 +270,7 @@ maintenance support. =item B<--fanout>=I -Specifies a fanout value for the maximum number of concur- -rently executing remote shell processes. Serial execution -can be specified by indicating a fanout value of B<1>. If B<--fanout> is not specified, a default fanout value of B<64> is used. +Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of B<1>. If B<--fanout> is not specified, a default fanout value of B<64> is used. =item B<-A|--updateallsw> @@ -340,7 +338,7 @@ Specifies a non-root user name to use for remote command execution. This option AIX and Linux and updating software (-S) for Linux only. 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 hiearchical cluster, that is the node is serviced by a service 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. diff --git a/xCAT-client/pods/man1/xcat2nim.1.pod b/xCAT-client/pods/man1/xcat2nim.1.pod index 97e7e9aee..318aad0df 100644 --- a/xCAT-client/pods/man1/xcat2nim.1.pod +++ b/xCAT-client/pods/man1/xcat2nim.1.pod @@ -98,7 +98,7 @@ B<-V|--verbose> Verbose mode. xcat2nim -l -t node clstrn02 -7. To re-create a NIM machine definiton and display verbose output. +7. To re-create a NIM machine definition and display verbose output. xcat2nim -V -t node -f clstrn05 From dbf52b4be79aa77e3d3757ef3bdac4f4b2db0ee1 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 6 Jun 2017 15:37:31 -0400 Subject: [PATCH 109/201] Add global mac address for mallanox switches --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 12b3dc03c..168cf6ea8 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -38,6 +38,15 @@ my %global_mac_identity = ( "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", "7c:fe:90" => "Mellanox switch", + "e4:1d:2d" => "Mellanox switch", + "24:8a:07" => "Mellanox switch", + "00:25:8b" => "Mellanox switch", + "00:02:c9" => "Mellanox switch", + "f4:52:14" => "Mellanox switch", + "ec:0d:9a" => "Mellanox switch", + "cc:37:ab" => "Edgecore Networks Switch", + "a8:2b:b5" => "Edgecore Networks Switch", + "70:72:cf" => "Edgecore Networks Switch", "8c:ea:1b" => "Edgecore Networks Switch" ); @@ -54,6 +63,8 @@ my %global_switch_type = ( mellanox => "Mellanox", MLNX => "Mellanox", MELLAN => "Mellanox", + Cumulus => "onie", + cumulus => "onie", Edgecore => "onie" ); From 0aff97e196a9affe9a56a883a7a674c0156d3517 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 7 Jun 2017 04:00:17 -0400 Subject: [PATCH 110/201] fix testcase clear_openbmc_simulator error --- xCAT-test/autotest/testcase/simulator/change_ip.sh | 4 +++- xCAT-test/autotest/testcase/simulator/clear_simulator | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh index 15ed0ad7c..59fb80b0a 100755 --- a/xCAT-test/autotest/testcase/simulator/change_ip.sh +++ b/xCAT-test/autotest/testcase/simulator/change_ip.sh @@ -13,7 +13,9 @@ elif [ $flag = "-c" ]; then cnip=`cat /tmp/simulator` chdef $cnhn bmc=$cnip process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'` - kill $process + if [ $process ]; then + kill $process + fi rm -rf "openbmc_simulator" fi exit $? diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 85b2557bd..61e2207c9 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -1,5 +1,5 @@ start:clear_openbmc_simulator description:clear evironment -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -c $$MN $$CN check:rc==0 end From b5827d3797e75cad8d143458cb95abccc62e0981 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 7 Jun 2017 17:17:21 +0800 Subject: [PATCH 111/201] Revert "Add more verifications in migration test cases" (#3228) --- xCAT-test/autotest/testcase/migration/redhat_migration | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index f3817dd47..6ce3b9432 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -72,11 +72,10 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" +cmd:ssh $$CN "copycds /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -98,8 +97,6 @@ check:rc==0 check:output=~running cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 @@ -187,11 +184,10 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" +cmd:ssh $$CN "copycds /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -211,8 +207,6 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 From 374991356f9774d7529893f4471dbfeec46adbbc Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 7 Jun 2017 17:18:39 +0800 Subject: [PATCH 112/201] Revert "Do operating system deployment in migration test cases" (#3229) --- .../testcase/migration/redhat_migration | 42 +++++++------------ .../testcase/migration/sles_migration | 42 +++++++------------ .../testcase/migration/ubuntu_migration1_p8le | 21 ++++------ .../testcase/migration/ubuntu_migration1_vm | 21 ++++------ .../testcase/migration/ubuntu_migration2_p8le | 21 ++++------ .../testcase/migration/ubuntu_migration2_vm | 21 ++++------ 6 files changed, 57 insertions(+), 111 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 6ce3b9432..c2d43ff7b 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -71,13 +71,11 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -95,15 +93,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -183,12 +178,10 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 @@ -207,14 +200,9 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index d822385e0..f20f56edb 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -74,12 +74,10 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -97,14 +95,9 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 @@ -191,12 +184,10 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -214,14 +205,9 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 2a6c8af8f..cf77bd24f 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -80,12 +80,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -116,15 +114,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 8c519b898..636553292 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -79,12 +79,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -115,15 +113,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index ca3fe6569..1d3216e8c 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -80,12 +80,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -116,15 +114,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index adfe3244a..34c7123cb 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -79,12 +79,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -115,15 +113,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end From 061b230edba9ca575788b916339b7e4a27c68f74 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 7 Jun 2017 11:59:54 -0400 Subject: [PATCH 113/201] Change to PartNumber and SerialNumber for bmcdiscover --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 0811f73fe..b0bb1514e 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1072,8 +1072,8 @@ sub bmcdiscovery_openbmc{ my $serial; if (defined($response->{data})) { - if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{Model}; + if (defined($response->{data}->{PartNumber}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{PartNumber}; $serial = $response->{data}->{SerialNumber}; } else { xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); From d90eafb453448901767f26a6477eb5676c2404d8 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 7 Jun 2017 14:30:30 -0400 Subject: [PATCH 114/201] modify from code review --- xCAT-server/share/xcat/scripts/configMellanox | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 8095d3bc6..43dc783b7 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -26,13 +26,13 @@ use xCAT::MsgUtils; Getopt::Long::Configure("bundling"); $Getopt::Long::ignorecase = 0; -#global variables +# global variables my @nodes; my @filternodes; #--------------------------------------------------------- -#Main +# Main # parse the options if ( @@ -97,7 +97,7 @@ my $vlan; my $port; my $mode; -#set community string for switch +# set community string for switch my $community = "public"; my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); my $tmp = $snmpcs[0]; @@ -143,7 +143,7 @@ sub config_ip { next; } - #Validate if this IP is reachable + # Validate if this IP is reachable my $p = Net::Ping->new(); if (!$p->ping($dip)) { print "$dip is not reachable\n"; @@ -158,7 +158,7 @@ sub config_ip { next; } - #get hostname + # get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); # if hostnames are same, created different one for discovery name @@ -166,7 +166,7 @@ sub config_ip { $dswitch=""; } - #if not defined, need to create one for xdsh to use + # if not defined, need to create one for xdsh to use if (!$dswitch) { my $ip_str = $dip; $ip_str =~ s/\./\-/g; @@ -197,7 +197,7 @@ sub config_ip { push (@discover_switches, $dswitch); next; } - #get netmask + # get netmask my $mask; foreach my $net (@nets) { if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $static_ip, $net->{'mask'}, 0)) { @@ -214,7 +214,7 @@ sub config_ip { } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=ip_configed otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); @@ -224,7 +224,7 @@ sub config_ip { if (@discover_switches) { my $dsw = join(",",@discover_switches); - #remove discover switch from xCATdb and /etc/hosts + # remove discover switch from xCATdb and /etc/hosts $cmd = "makedns -d $dsw"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts -d $dsw"; @@ -256,14 +256,14 @@ sub config_hostname { print "$switch: Changing host name to $switch\n"; } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=hostname_configed" ; $rc= xCAT::Utils->runcmd($cmd, 0); } } -#setup secure SNMP v3 +# setup secure SNMP v3 sub config_snmp { my $snmp_user; my $snmp_passwd; @@ -314,25 +314,25 @@ sub run_rspconfig { $master = `hostname -i`; foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; - #call rspconfig command to setup switch - #enable ssh + # call rspconfig command to setup switch + # enable ssh $cmd=`rspconfig $switch sshcfg=enable`; - #enable snmp function on the switch + # enable snmp function on the switch $cmd=`rspconfig $switch snmpcfg=enable`; - #enable the snmp trap + # enable the snmp trap $cmd=`rspconfig $switch alert=enable`; - #Logging destination: + # Logging destination: $cmd=`rspconfig $switch logdest=$master`; - #config ntp + # config ntp $cmd = `xdsh $switch -l $user --devicetype IBSwitch::Mellanox "enable;configure terminal;ntp enable;ntpdate $master; ntp server $master;configuration write;show ntp" `; push (@config_switches, $switch); } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=switch_configed" ; $rc= xCAT::Utils->runcmd($cmd, 0); @@ -358,17 +358,17 @@ sub config_vlan { } } } else { - xCAT::MsgUtils->message("E","Error - When configuring VLAN, a port must be provided."); + xCAT::MsgUtils->message("E"," When configuring VLAN, a port must be provided."); &usage; exit(1); } - #will default to trunk mode + # will default to trunk mode if ($::MODE) { $mode = $::MODE; if (!($mode =~ m/(access|trunk|hybrid|access-dcb|dot1q-tunnel)/) ) { - xCAT::MsgUtils->message("E","Error - Please provided supported mode"); + xCAT::MsgUtils->message("E"," Please provided supported mode"); &usage; exit(1); } @@ -396,7 +396,7 @@ sub config_vlan { print "Tagging VLAN=$vlan for $switch port $port_input\n"; - #create vlan + # create vlan my $vlan_cmd = `xdsh $switch --devicetype $devicetype "enable;configure terminal;vlan $vlan;exit;exit" `; my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; From e73d85c5eb4faeb88527b41108c5ab0d533f3439 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 7 Jun 2017 14:53:55 -0400 Subject: [PATCH 115/201] openbmc rflash command support for -l --list option --- xCAT-server/lib/xcat/plugins/openbmc.pm | 69 +++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d9f5519ac..7e1d8727f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -204,6 +204,13 @@ my %status_info = ( RVITALS_RESPONSE => { process => \&rvitals_response, }, + RFLASH_LIST_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RFLASH_LIST_RESPONSE => { + process => \&rflash_response, + }, ); $::RESPONSE_OK = "200 OK"; @@ -483,7 +490,7 @@ sub parse_args { else { # Filename was not passed, check flags allowed without file if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { - return ([ 1, "Unsupported no file command command option: $opt" ]); + return ([ 1, "Unsupported no file command option: $opt" ]); } } } @@ -693,8 +700,9 @@ sub parse_command_status { $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; } if ($list) { - xCAT::SvrUtils::sendmsg("List option is not yet supported.", $callback); - return 1; + #Display firmware update files uploaded to BMC + $next_status{LOGIN_RESPONSE} = "RFLASH_LIST_REQUEST"; + $next_status{RFLASH_LIST_REQUEST} = "RFLASH_LIST_RESPONSE"; } if ($delete) { xCAT::SvrUtils::sendmsg("Delete option is not yet supported.", $callback); @@ -1364,5 +1372,60 @@ sub rvitals_response { return; } +#------------------------------------------------------- +=head3 rflash_response + + Deal with response of rflash command + Input: + $node: nodename of current response + $response: Async return response + +=cut + +#------------------------------------------------------- +sub rflash_response { + my $node = shift; + my $response = shift; + + my $response_info = decode_json $response->content; + + print Dumper(%{$response_info->{data}}); + + my $update_id; + my $update_activation; + my $update_purpose; + my $update_version; + + if ($node_info{$node}{cur_status} eq "RFLASH_LIST_RESPONSE") { + # Display "list" option header and data + xCAT::SvrUtils::sendmsg("ID Purpose State Version", $callback, $node); + xCAT::SvrUtils::sendmsg("-" x 55, $callback, $node); + + foreach my $key_url (keys %{$response_info->{data}}) { + my %content = %{ ${ $response_info->{data} }{$key_url} }; + + $update_id = (split(/\//, $key_url))[ -1 ]; + if (defined($content{Version}) and $content{Version}) { + $update_version = $content{Version}; + } + if (defined($content{Activation}) and $content{Activation}) { + $update_activation = (split(/\./, $content{Activation}))[ -1 ]; + } + if (defined($content{Purpose}) and $content{Purpose}) { + $update_purpose = (split(/\./, $content{Purpose}))[ -1 ]; + } + xCAT::SvrUtils::sendmsg(sprintf("%-8s %-7s %-8s %s", $update_id, $update_purpose, $update_activation, $update_version), $callback, $node); + } + xCAT::SvrUtils::sendmsg("", $callback, $node); #Separate output in case more than 1 endpoint + } + + if ($next_status{ $node_info{$node}{cur_status} }) { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + gen_send_request($node); + } else { + $wait_node_num--; + } + return; +} 1; From 9fd9e211d0e4a1112565602e65eded4192edf8d0 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Thu, 8 Jun 2017 11:15:07 +0800 Subject: [PATCH 116/201] rm / from path of xcatpost folder when run rm command (#3238) --- xCAT/postscripts/xcatdsklspost | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3e2c4ffb1..7aac7ab28 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -126,9 +126,8 @@ download_postscripts() retry=0 rc=1 # this is a fail return while [ 0 -eq 0 ]; do - - if [ -e "\/$xcatpost" ]; then - rm -rf "\/$xcatpost" + if [ -e "$xcatpost" ]; then + rm -rf "$xcatpost" fi export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /$xcatpost 2> /tmp/wget.log From cccf4b783f531c3afcde32c8fe58ceba9e07d62f Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 8 Jun 2017 11:21:05 +0800 Subject: [PATCH 117/201] =?UTF-8?q?fix=203224=20nodeset=20create=20dracut.?= =?UTF-8?q?*=20file=20in=20sles=20statelite=20cost=20too=20much=E2=80=A6?= =?UTF-8?q?=20(#3227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix 3224 nodeset create dracut.* file in sles statelite cost too much time * polished based on comments --- xCAT-server/lib/xcat/plugins/sles.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 164e6d46c..f69689a1e 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1707,12 +1707,10 @@ erver, if so, stop it first and try again" ], sub using_dracut { my $rootimgdir = shift; - my $chkcmd = "chroot $rootimgdir/rootimg dracut --list-modules"; - my $rc = system($chkcmd); - if ($rc) { - return 0; - } else { + if ( -f "$rootimgdir/rootimg/etc/dracut.conf" ) { return 1; + } else { + return 0; } } From d9d0cfd42ccdee03085f36fed194d850622804b9 Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 8 Jun 2017 11:21:26 +0800 Subject: [PATCH 118/201] Avoid of circular reference in a loop of rinstall (#3121) This is a temporary fix for getadapter which will hang forever if error happens in `rinstall stage`. The root cause is the circular reference in `runxcmd`. As global variable `$::xcmd_outref` and `%::xcmd_outref_hash` are used to save the output message, if the plugin command are called with runxcmd and the plugin called also calls another plugin with `runxcmd`, the circular reference will happen. In this situation, if the output reponse is used in a iterator, like: ``` foreach my $line (@$res) { xCAT::MsgUtils->message("I", $rsp, $callback); ``` `$res` points to the global variable, and `MsgUtils->message` in the runxcmd calls also add the value in the global variable, as the iter object is changed, the loop will not be terminated. This patch can not solve the circular reference problem, it is just a workaround to avoid infinite loop. Some known issues: the error message will print twice as the `MsgUtils->message` called in runxcmd. But we can not simply remove it as the plugin may not be called with `runxcmd`. Error message example: ``` Error: frame10node10: mgt configuration can not be found. frame10node10: Unable to identify plugin for this command, check relevant tables: noderes.netboot frame10node10: Unable to identify plugin for this command, check relevant tables: noderes.netboot Failed to run 'nodeset' against the following nodes: frame10node10 Error: failed to run command: rinstall frame10node10 runcmd=getadapter ``` partial-fix: #3046 --- xCAT-server/lib/xcat/plugins/rinstall.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 4fba96ed0..906746b33 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -351,7 +351,9 @@ sub rinstall { # We got an error with the nodeset my @successnodes; my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if (($line =~ /: install/) or ($line =~ /: netboot/)) { my $successnode; @@ -414,7 +416,6 @@ sub rinstall { }, $subreq, -1, 1); - $rc = $::RUNCMD_RC; my $rsp = {}; if ($VERBOSE) { @@ -427,7 +428,9 @@ sub rinstall { # We got an error with the rnetboot my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if ($line =~ /: Success/) { my $successnode; @@ -491,7 +494,9 @@ sub rinstall { # We got an error with the rsetboot my @successnodes; my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if ($line =~ /: Network/) { my $successnode; @@ -550,7 +555,9 @@ sub rinstall { unless ($rc == 0) { # We got an error with the rpower my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if (($line =~ /: on reset/) or ($line =~ /: off on/)) { my $successnode; From e269d43bdc459c93ff6054184ec5e1cf212d02f7 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 8 Jun 2017 09:00:20 -0400 Subject: [PATCH 119/201] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rvitals/cases0 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 9e759843d..11c30bf70 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -110,6 +110,12 @@ check:rc==0 check:output=~12V Sense|AC Avg Power check:output=~Mem Cache Power|MEM Avg Power end +start:rvitals_altitude +description:Retrieves altitude readings. +Attribute: $$CN-The operation object of rvitals command +cmd:rvitals $$CN altitude +check:rc==0 +end start:rvitals_noderange_err description:using not defined node cmd:rvitals testnode From 0580e8d02aae3a4f7c261604af4e8e11ca5f79e2 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 9 Jun 2017 02:16:46 -0400 Subject: [PATCH 120/201] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rvitals/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 11c30bf70..996ee8dea 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -115,6 +115,7 @@ description:Retrieves altitude readings. Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN altitude check:rc==0 +check:output=~No attributes returned from the BMC end start:rvitals_noderange_err description:using not defined node From b888c12291dc1f7374cebbe7ad4fbb3db74bd99e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 9 Jun 2017 08:00:30 -0400 Subject: [PATCH 121/201] Remove mprom from the man page for rinv --- docs/source/guides/admin-guides/references/man1/rinv.1.rst | 2 +- xCAT-client/pods/man1/rinv.1.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 3cc89c839..0a1c944d5 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -39,7 +39,7 @@ OpenPOWER (OpenBMC) server specific: ==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | mprom | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index b08b15279..b680c0c7e 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -16,7 +16,7 @@ B I [B|B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B] =head2 PPC (with HMC) specific: From 7e4c748eaa092db9e4c0716463154c83af18f845 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 9 Jun 2017 11:02:36 -0400 Subject: [PATCH 122/201] Change osver to OSVER for onie switch support --- xCAT/postscripts/hardeths | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index 0d51de150..9dd75dcde 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -47,11 +47,11 @@ network_ipv4calc () } if [ -f /etc/os-release ] && (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1); then - osver="cumulus" + OSVER="cumulus" fi defgw=`ip route | grep default | awk '{print $3}'` -if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") +if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then echo `hostname` >/etc/hostname mv /etc/network/interfaces /etc/network/interfaces.old # this file will be filled up next @@ -94,7 +94,7 @@ for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do PREFIXMASK=`echo $IPADDRMASK | awk -F'/' '{print $2}'` # converts to x.x.x.x mask value maskfromprefix $PREFIXMASK - if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") + if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then NETWORK=`network_ipv4calc $IPADDR $NETMASK` #BROADCAST=`ifconfig $nic | grep Bcast | awk '{print $3}' | awk -F: '{print $2}'` @@ -169,7 +169,7 @@ EOF fi done -if ( pmatch $OSVER "ubuntu*") || (pmatch $osver "cumulus") +if ( pmatch $OSVER "ubuntu*") || (pmatch $OSVER "cumulus") then cat >>/etc/network/interfaces < Date: Fri, 9 Jun 2017 13:51:22 -0400 Subject: [PATCH 123/201] Review updates --- xCAT-server/lib/xcat/plugins/openbmc.pm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7e1d8727f..ff192fbbf 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -119,6 +119,14 @@ my %status_info = ( process => \&reventlog_response, }, + RFLASH_LIST_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RFLASH_LIST_RESPONSE => { + process => \&rflash_response, + }, + RINV_REQUEST => { method => "GET", init_url => "$openbmc_project_url/inventory/enumerate", @@ -204,13 +212,6 @@ my %status_info = ( RVITALS_RESPONSE => { process => \&rvitals_response, }, - RFLASH_LIST_REQUEST => { - method => "GET", - init_url => "$openbmc_project_url/software/enumerate", - }, - RFLASH_LIST_RESPONSE => { - process => \&rflash_response, - }, ); $::RESPONSE_OK = "200 OK"; @@ -484,13 +485,13 @@ sub parse_args { if ($filename_passed) { # Filename was passed, check flags allowed with file if ($opt !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) { - return ([ 1, "Unsupported file command option: $opt" ]); + return ([ 1, "Invalid option specified when a file is provided: $opt" ]); } } else { # Filename was not passed, check flags allowed without file if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { - return ([ 1, "Unsupported no file command option: $opt" ]); + return ([ 1, "Invalid option specified: $opt" ]); } } } @@ -691,16 +692,16 @@ sub parse_command_status { } } else { - #TODO Process file id passed in + # TODO Process file id passed in } } if ($check_version) { - #Display firmware version on BMC + # Display firmware version on BMC $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; } if ($list) { - #Display firmware update files uploaded to BMC + # Display firmware update files uploaded to BMC $next_status{LOGIN_RESPONSE} = "RFLASH_LIST_REQUEST"; $next_status{RFLASH_LIST_REQUEST} = "RFLASH_LIST_RESPONSE"; } From 56500ea6bf99ce3270bd3b904352eb1676ee89a5 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 12 Jun 2017 09:08:53 -0400 Subject: [PATCH 124/201] Failed to run dhcpd if tftpserver defined as in the network (#3223) table --- xCAT-server/lib/xcat/plugins/dhcp.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 301796b0a..291a9b370 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2457,10 +2457,11 @@ sub addnet { $tftp = $ent->{tftpserver}; } - else - { #presume myself to be it, dhcp no longer does this for us + if (!$tftp || ($tftp eq '')) + { $tftp = $myip; } + if ($ent and $ent->{gateway}) { $gateway = $ent->{gateway}; From 17d8358c3bd87477735baff7f12a50f3682905c8 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 12 Jun 2017 09:09:58 -0400 Subject: [PATCH 125/201] Support user defined ip address for cumulus switch (#3241) --- xCAT-server/share/xcat/scripts/configonie | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/scripts/configonie b/xCAT-server/share/xcat/scripts/configonie index 68a9ab1a0..f3e49a59b 100755 --- a/xCAT-server/share/xcat/scripts/configonie +++ b/xCAT-server/share/xcat/scripts/configonie @@ -125,11 +125,28 @@ sub config_ssh { my $cmd; my @config_switches; + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs(\@nodes,['ip','otherinterfaces']); + foreach my $switch (@nodes) { #remove old host key from /root/.ssh/known_hosts $cmd = `ssh-keygen -R $switch`; - my ($exp, $errstr) = cumulus_connect($switch, $userid, $password, $timeout); + my $static_ip = $nodehash->{$switch}->[0]->{ip}; + my $discover_ip = $nodehash->{$switch}->[0]->{otherinterfaces}; + my $ssh_ip; + + my $p = Net::Ping->new(); + if ($p->ping($static_ip)) { + $ssh_ip = $static_ip; + } elsif ($p->ping($discover_ip)) { + $ssh_ip = $discover_ip; + } else { + print "$switch is not reachable\n"; + next; + } + + my ($exp, $errstr) = cumulus_connect($ssh_ip, $userid, $password, $timeout); if (!defined $exp) { print ("connect failed $errstr\n"); next; @@ -142,6 +159,10 @@ sub config_ssh { ($ret, $err) = cumulus_exec($exp, "chmod 700 /root/.ssh"); ($ret, $err) = cumulus_exec($exp, "echo \"$rootkey\" >/root/.ssh/authorized_keys"); ($ret, $err) = cumulus_exec($exp, "chmod 644 /root/.ssh/authorized_keys"); + #config dhcp ip address to static + if ($ssh_ip eq $discover_ip) { + ($ret, $err) = cumulus_exec($exp, "ifconfig eth0 $static_ip"); + } $exp->hard_close(); push (@config_switches, $switch); From dc1b787f8e193efe9e47b915a8b57a08d0684188 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 12 Jun 2017 10:20:58 -0400 Subject: [PATCH 126/201] add cases for confignetwork to config installnic and secondarynic --- .../autotest/testcase/confignetwork/cases0 | 445 ++++++++++++++++++ 1 file changed, 445 insertions(+) create mode 100644 xCAT-test/autotest/testcase/confignetwork/cases0 diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 new file mode 100644 index 000000000..fbd1fd177 --- /dev/null +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -0,0 +1,445 @@ +start: confignetwork_s_installnic_diskful +description: this case is to test confignetwork -s could config installnic successfully in diskful provision. +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +cmd:sleep 20 +cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:sleep 10 +cmd:copycds $$ISO +check:rc==0 +cmd:chdef $$CN postscripts="confignetwork -s" +check:rc==0 +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi +check:rc==0 +cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +check:rc==0 +cmd:sleep 300 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:chdef -m -t node $$CN postscripts="confignetwork -s" +check:rc==0 +end + +start:confignetwork_s_installnic_diskless +description: this case is to test confignetwork -s could config installnic successfully in diskless provision. +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 +cmd:chdef -t node -o $$CN postbootscripts="confignetwork -s" +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf $$CN +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi +check:rc==0 +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:sleep 900 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:chdef -m -t node $$CN postscripts="confignetwork -s" +check:rc==0 +cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi +end + +start: confignetwork_secondarynic_diskless +description: this case is to test confignetwork -s could config installnic and secondarynic at the same time successfully in diskless provision. +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 +cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=100.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=100_1_0_0-255_255_0_0 +check:rc==0 +cmd:chdef -t node -o $$CN postbootscripts="confignetwork -s" +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf $$CN +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi +check:rc==0 +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:sleep 900 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep 100.1.0.100 /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 100.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 100.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~100.1.0.100 +check:output!~dhcp +cmd:chdef -m -t node $$CN postscripts="confignetwork -s" +check:rc==0 +cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi +cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= +check:rc==0 +end + +start:confignetwork_secondarynic_updatenode +description: this case is to test confignetwork could config secondarynic successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +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 mtu=1501 +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 +check:rc==0 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output=~MTU=1501 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start: confignetwork_secondarynic_nicaliases_updatenode +description: this case is to test confignetwork could config secondarynic nicaliases successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.bak +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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1|aliases1-2" +check:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~aliases1-1 +check:output=~aliases1-2 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:output=~12.1.0.100 +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if [ -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 +end + +start:confignetwork_secondarynic_nicextraparams_updatenode +description: this case is to test confignetwork could config secondarynic nicextraparams successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.bak +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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" +check:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~$$CN-$$SECONDNIC-1 +check:output=~$$CN-$$SECONDNIC-2 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:output=~12.1.0.100 +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if [ -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 +end + +start:confignetwork_secondarynic_nicnetworks_updatenode_false +description: this case is to test confignetwork could return error message when there is no not enough attributes when configing secondarynic with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +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= +check:rc==0 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc!=0 +#TODO check the error message +cmd:rmdef -t network -o 11_1_0_0-255_255_0_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 +end + +start:confignetwork_secondarynic_nicips_updatenode_false +description: this case is to test confignetwork could return error message when there is no not enough attributes when configing secondarynic with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +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= nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc!=0 +#TODO check the error message +cmd:rmdef -t network -o 11_1_0_0-255_255_0_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 +end + +start:confignetwork_secondarynic_nictype_updatenode_false +description: this case is to test confignetwork could return error message when there is no not enough attributes when configing secondarynic with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +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= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc!=0 +#TODO check the error message +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +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 +end + +start:confignetwork_disable_set_to_yes +description: this case is to test if confignetwork could work correctly when disable is set to yes in nics table +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=100.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 +check:rc==0 +cmd:chtab node=$$CN nics.disable=yes +check:rc==0 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output!~11.1.0.100 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +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:chtab node=$$CN nics.disable=0 +check:rc==0 +end + +start:confignetwork_disable_set_to_1 +description: this case is to test if confignetwork could work correctly when disable is set to 1 in nics table +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=100.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 +check:rc==0 +cmd:chtab node=$$CN nics.disable=1 +check:rc==0 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output!~11.1.0.100 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +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:chtab node=$$CN nics.disable=0 +check:rc==0 +end + +start:confignetwork_niccustomscripts +description: this case is to test confignetwork could config secondarynic and envoke scripts to execute. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:echo "echo hello > /tmp/confignetwork_niccustomscript" > /tmp/script1 +check:rc==0 +cmd:chmod a+x /tmp/script1 +check:rc==0 +cmd:cp /tmp/script1 /install/postscripts +check:rc==0 +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 mut=1501 +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 niccustomscripts.$$SECONDNIC=script1 +check:rc==0 +cmd:chdef -t node -o $$CN postscripts=confignetwork +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output=~MTU=1501 +check:output!~dhcp +cmd:xdsh $$CN "cat /tmp/confignetwork_niccustomscript" +check:rc==0 +check:output=~hello +cmd:xdsh $$CN "rm -rf /tmp/confignetwork_niccustomscript" +check:rc==0 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +description:this case is to verify if confignetwork could config serveral nics' multiple value at the same time. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +check:rc==0 +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" +check:rc==0 +cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="13_1_0_0-255_255_0_0|14_1_0_0-255_255_0_0" nichostnamesuffixes.$$THIRDNIC="-$$THIRDNIC-1|-$$THIRDNIC-2" +check:rc==0 +cmd:cp /etc/hosts /etc/hosts.bak +cmd:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~$$CN-$$SECONDNIC-1 +check:output=~$$CN-$$SECONDNIC-2 +check:output=~$$CN-$$THIRDNIC-1 +check:output=~$$CN-$$THIRDNIC-2 +cmd:chdef -t node -o $$CN postscripts="confignetwork" +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:output=~12.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~13.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +check:output=~14.1.0.100 +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.bak /etc/hosts +end + +start:confignetwork_help +cmd:confignetworks -h +check:rc==0 +#TODO help information is printed +cmd:confignetworks --help +check:rc==0 +#TODO help information is printed +end + + + + + + + From fac7d28f3fa8182883c3af0adc8694727bb20097 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 13 Jun 2017 04:59:19 -0400 Subject: [PATCH 127/201] add a description for help case --- xCAT-test/autotest/testcase/confignetwork/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index fbd1fd177..46d93588e 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -429,6 +429,7 @@ cmd:mv -f /etc/hosts.bak /etc/hosts end start:confignetwork_help +description:this case is to verify if help information is provided cmd:confignetworks -h check:rc==0 #TODO help information is printed From 9b0b05eb6ce3975522173391aec14d9433c4232a Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 13 Jun 2017 05:03:55 -0400 Subject: [PATCH 128/201] update for won't fix issue --- xCAT-test/autotest/testcase/confignics/cases0 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index b2b5b0af1..a730ff864 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -163,11 +163,11 @@ cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Eth check:rc==0 cmd:makehosts $$CN check:rc==0 -cmd:cat /etc/hosts -check:output=~aliases1-1 -check:output=~aliases1-2 -check:output=~aliases2-1 -check:output=~aliases2-2 +#cmd:cat /etc/hosts +#check:output=~aliases1-1 +#check:output=~aliases1-2 +#check:output=~aliases2-1 +#check:output=~aliases2-2 cmd:updatenode $$CN -P confignics check:rc==0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi From 0f3411ae36b98bbf75321cd0a082a01c50673f5f Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 13 Jun 2017 11:21:13 -0400 Subject: [PATCH 129/201] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rvitals/cases0 | 31 +++------- .../autotest/testcase/rvitals/openbmctest.sh | 59 +++++++++++++++++++ 2 files changed, 68 insertions(+), 22 deletions(-) create mode 100755 xCAT-test/autotest/testcase/rvitals/openbmctest.sh diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 996ee8dea..4a40f6b5c 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -18,9 +18,8 @@ end start:rvitals_temp description:Retrieves temperatures Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN temp +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN temp check:rc==0 -check:output=~System Temperature|Ambient Temp|temperature end start:rvitals_disktemp @@ -46,17 +45,15 @@ end start:rvitals_voltage description:Retrieves power supply and VRM voltage readings Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN voltage +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN voltage check:rc==0 -check:output=~Frame Voltages|CPU VDD Volt|SysBrd end start:rvitals_power description:Retrieves power status Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN power +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN power check:rc==0 -check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) end start:rvitals_state @@ -79,12 +76,8 @@ end start:rvitals_all description:Retrieves all status Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN all +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN all check:rc==0 -check:output=~System Temperature|Ambient Temp -check:output=~Frame Voltages|CPU VDD Volt|SysBrd -check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) -check:output=~ System State:|System Event:|NMI State end start:rvitals_leds @@ -98,34 +91,28 @@ end start:rvitals_fanspeed description:Retrieves fan speeds. Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN fanspeed +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN fanspeed check:rc==0 -check:output=~Fan|Fan\s*\d:\s*\w+\s*RPM end start:rvitals_wattage description:Retrieves wattage readings. Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN wattage +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN wattage check:rc==0 -check:output=~12V Sense|AC Avg Power -check:output=~Mem Cache Power|MEM Avg Power end start:rvitals_altitude description:Retrieves altitude readings. Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN altitude +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN altitude check:rc==0 -check:output=~No attributes returned from the BMC end start:rvitals_noderange_err description:using not defined node -cmd:rvitals testnode +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals testnode check:rc!=0 -check:output=~Error end start:rvitals_errorcommand description:using wrong command -cmd: rvitals $$CN errorcommand +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN errorcommand check:rc!=0 -check:output=~Unrecognized rvitals arguments end diff --git a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh new file mode 100755 index 000000000..8584e79e4 --- /dev/null +++ b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +function test_openbmccommand() +{ +node_number=0; +number=0; +if [[ $1 ]]&&[[ $2 ]]&&[[ $3 ]];then + `$1 $2 $3 >/tmp/openbmccommand.test`; + if [[ $? -eq 0 ]];then + echo right command; + number=`awk 'END{print NR}' /tmp/openbmccommand.test` + echo number is $number + `cat /tmp/openbmccommand.test |awk -F : '{print $1}' > /tmp/openbmccommand.test1` + for i in `cat /tmp/openbmccommand.test1` + do + echo $i + if [[ $i == $2 ]];then + node_number=1; + else + echo no than more node checkeid + node_number=2; + fi + done + if [[ $node_number -eq 1 ]];then + `cat /tmp/openbmccommand.test |awk -F : '{print $2}'> /tmp/openbmccommand.test2` + if [[ $number -eq 1 ]]&&[[ `awk -F "" '{for(i=1;i<=NF;++i) if($i==":") ++sum}END{print sum}' /tmp/openbmccommand.test` -eq 1 ]];then + if [[ `cat /tmp/openbmccommand.test` =~ "No attributes returned from the BMC" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No mprom information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No deviceid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No uuid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No guid information is available" ]];then + echo "No attributes" + return 0; + else + return 1; + fi + else + if [[ `cat /tmp/openbmccommand.test2` =~ "No attributes returned from the BMC" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No mprom information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No deviceid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No uuid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No guid information is available" ]];then + echo "wrong return" + return 1; + else + echo "right return" + return 0 + fi + fi + else + if [[ $node_number -eq 2 ]];then + return 0; + fi + fi + else + return 1; + fi +else + return 1; +fi +} +test_openbmccommand $1 $2 $3 +if [[ $? -eq 0 ]];then + exit 0; +else + exit 1; +fi From d3a85b352d124e4fb04c2b74f57580b884189556 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 03:57:05 -0400 Subject: [PATCH 130/201] refine test cases to check hostname in sles12.2 statelite #2690 --- .../installation/reg_linux_statelite_installation_flat | 6 ++++++ .../reg_linux_statelite_installation_hierarchy_by_nfs | 3 +++ .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 3 +++ 3 files changed, 12 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 4b3b6849b..7cc906537 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -75,6 +75,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~compute/rootimg on / type nfs +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "echo "test"> /test.statelite" check:rc!=0 @@ -110,6 +113,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~rootfs on / type tmpfs +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:sleep 120 cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 076a14c2d..65ac3cf86 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -95,6 +95,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~compute/rootimg on / type nfs +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "echo "test"> /test.statelite" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index e9851d362..fd7d84f4e 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -89,6 +89,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~rootfs on / type +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 From 4fcacba83893f98dab2fe934a8b73f59ea8b8078 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 14 Jun 2017 01:38:32 -0400 Subject: [PATCH 131/201] fix issue Couldn't find ID in the discinfo database #3254 --- perl-xCAT/xCAT/data/discinfo.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 75274be3e..c3432566a 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -11,8 +11,9 @@ require Exporter; @EXPORT = qw(); @EXPORT_OK = qw(distnames numdiscs); +use strict; -my %distnames = ( +our %distnames = ( "1480943823.812754" => "centos7.3", #x86_64 "1450147276.351714" => "centos7.2", #ppc64le "1449699925.561114" => "centos7.2", #x86_64 @@ -135,7 +136,7 @@ my %distnames = ( "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM ); -my %numdiscs = ( +our %numdiscs = ( "1156364963.862322" => 4, "1178480581.024704" => 3 ); From ae2f2a5bdc32348692d8cb9191c6fa6d0ae50d8b Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 03:22:52 -0400 Subject: [PATCH 132/201] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases0 | 96 +++++++++++++++++++------ 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index 5b61937df..d5aae55f0 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -4,14 +4,30 @@ #check:rc!=0 #check:output=~Usage #end +start:rinv_h +description:show help information for rinv +cmd:rinv -h +check:rc==0 +check:output=~Usage +check:output=~rinv +end +start:rinv_v +description:show version for Version +cmd:rinv -v +check:rc==0 +check:output=~Version +end + start:rinv_bus -arch:ppc +description:rinv list all buses for each I/O slot +Attribute: $$CN-The operation object of rinv command cmd:rinv $$CN bus check:rc==0 check:output=~I/O Bus Information end start:rinv_config -arch:ppc +description:Retrieves number of processors, speed, total memory, and DIMM locations. +Attribute: $$CN-The operation object of rinv command cmd:rinv $$CN config check:rc==0 check:output=~Machine Configuration Info @@ -19,38 +35,76 @@ check:output=~Number of Processors:\s*\d+ check:output=~Total Memory \(\w+\):\s*\d+ end start:rinv_serial -arch:ppc -cmd:rinv $$CN serial +description:Retrieves serial number. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN serial check:rc==0 -check:output=~Serial Number:\s*\w{7} end start:rinv_model -arch:ppc -cmd:rinv $$CN model +description:Retrieves serial number. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN model check:rc==0 -check:output=~Machine Type/Model\s*:\s*\w{4}-\w{3} end start:rinv_firm -arch:ppc -cmd:rinv $$CN firm +description:Retrieves firmware versions. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN firm check:rc==0 -check:output=~Release Level\s*:\s*\w+ end start:rinv_all -arch:ppc -cmd:rinv $$CN all +description:get serial,model +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN all +check:rc==0 +end +start:rinv_cpu +description:get cpu information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN cpu +check:rc==0 +end +start:rinv_dimm +description:get dimm information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN dimm +check:rc==0 +end +start:rinv_uuid +description:get uuid information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN uuid check:rc==0 -check:output=~I/O Bus Information -check:output=~Machine Configuration Info -check:output=~Number of Processors:\s*\d+ -check:output=~Total Memory \(\w+\):\s*\d+ -check:output=~Serial Number:\s*\w{7} -check:output=~Machine Type/Model\s*:\s*\w{4}-\w{3} -check:output=~Release Level\s*:\s*\w+ end start:rinv_noderange_err cmd:rinv testnode check:rc!=0 check:output=~Error end - +start:rinv_mixnode +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ +check:rc==0 +cmd:chdef -p -t node -o $$CN groups="test" +check:rc==0 +cmd:rinv test all +check:rc==1 +check:output=~testnode: Error +check:output=~$$CN: SYSTEM +cmd:chdef -m -t node -o $$CN groups="test" +check:rc==0 +cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi +check:rc==0 +end +start:rinv_wrongbmcpasswd +cmd:lsdef -l $$CN -z >/tmp/testnode.stanza +check:rc==0 +cmd:chdef $$CN bmcpassword=test +check:rc==0 +cmd:rinv $$CN all +check:rc==1 +check:output=~$$CN: Error: Invalid username or password +cmd:cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza +check:rc==0 +end From d1a87e7b44dbfdcbbe4272c66bc1cd63580e1400 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 05:32:53 -0400 Subject: [PATCH 133/201] modify rinv testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases0 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index d5aae55f0..5cd9d942c 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -76,12 +76,21 @@ Attribute: $$CN-The operation object of rinv command cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN uuid check:rc==0 end +start:rinv_vpd +description:get vpd information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN vpd +check:rc==0 +end + start:rinv_noderange_err cmd:rinv testnode check:rc!=0 check:output=~Error end start:rinv_mixnode +description:get mixnode information,one is invalid node +Attribute: $$CN-The operation object of rinv command cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi check:rc==0 cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ @@ -98,6 +107,8 @@ cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stan check:rc==0 end start:rinv_wrongbmcpasswd +description:get right return if bmc's passwd wrong +Attribute: $$CN-The operation object of rinv command cmd:lsdef -l $$CN -z >/tmp/testnode.stanza check:rc==0 cmd:chdef $$CN bmcpassword=test From 4eeb0c1fef8b2cf3e8c8ae726997c1ca5dce9924 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 05:33:34 -0400 Subject: [PATCH 134/201] modify rinv testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases1 | 70 ------------------------- 1 file changed, 70 deletions(-) delete mode 100644 xCAT-test/autotest/testcase/rinv/cases1 diff --git a/xCAT-test/autotest/testcase/rinv/cases1 b/xCAT-test/autotest/testcase/rinv/cases1 deleted file mode 100644 index 292e9b915..000000000 --- a/xCAT-test/autotest/testcase/rinv/cases1 +++ /dev/null @@ -1,70 +0,0 @@ -start:rinv_serial -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN serial -check:rc==0 -check:output=~NODE 1 Chassis Serial Number:\s*\w{7} -end - -start:rinv_model -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN model -check:rc==0 -check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} -end - -start:rinv_firm -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN firm -check:rc==0 -check:output=~BMC Firmware\s*:\s*\w+.\w+ -end - -start:rinv_deviceid -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN deviceid -check:rc==0 -check:output=~Device ID:\s*\w+ -check:output=~Product ID:\s*\w+ -check:output=~Manufacturer ID:\s*\w+ -end - - -start:rinv_vpd -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN vpd -check:rc==0 -check:output=~Manufacturer ID:\s*\w+ -check:output=~Device ID:\s*\w+ -check:output=~BMC Firmware:\s*\w+.\w+ -check:output=~NODE 1 Chassis Serial Number:\s*\w{7} -check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} -end - - -start:rinv_all -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN all -check:rc==0 -check:output=~BMC Firmware:\s*\w+.\w+ -check:output=~BMCCARD Board Part Number:\s*\w{7} -check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ -check:output=~Product ID:\s*\d+ -check:output=~Manufacturer ID:\s*\d+ -check:output=~Device ID:\s*\d+ -check:output=~BMCCARD Board Serial Number:\s*\w+ -end - -start:rinv_noderange_err -hcp:ipmi -arch:ppc64le -cmd:rinv testnode -check:rc!=0 -check:output=~Error -end - From 5d2e814243e723578774c67f036da0f31ecc1e5f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 14 Jun 2017 15:15:51 -0400 Subject: [PATCH 135/201] openbmc rflash command support for -u --upload option --- xCAT-server/lib/xcat/plugins/openbmc.pm | 71 +++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index ff192fbbf..618e96200 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -36,6 +36,7 @@ $::POWER_STATE_POWERING_OFF="powering-off"; $::POWER_STATE_POWERING_ON="powering-on"; $::POWER_STATE_QUIESCED="quiesced"; $::POWER_STATE_RESET="reset"; +$::UPLOAD_FILE=""; $::NO_ATTRIBUTES_RETURNED="No attributes returned from the BMC."; @@ -126,6 +127,13 @@ my %status_info = ( RFLASH_LIST_RESPONSE => { process => \&rflash_response, }, + RFLASH_FILE_UPLOAD_REQUEST => { + method => "PUT", + init_url => "$openbmc_project_url/upload/image/", + }, + RFLASH_FILE_UPLOAD_RESPONSE => { + process => \&rflash_response, + }, RINV_REQUEST => { method => "GET", @@ -217,6 +225,7 @@ my %status_info = ( $::RESPONSE_OK = "200 OK"; $::RESPONSE_SERVER_ERROR = "500 Internal Server Error"; $::RESPONSE_SERVICE_UNAVAILABLE = "503 Service Unavailable"; +$::RESPONSE_METHOD_NOT_ALLOWED = "405 Method Not Allowed"; #----------------------------- @@ -677,6 +686,7 @@ sub parse_command_status { if ($update_file =~ /.*\.tar$/) { # Filename ending on .tar was specified $filename = $update_file; + $::UPLOAD_FILE = $update_file; # Save filename to upload if ($check_version) { # Display firmware version of the specified .tar file my $firmware_version_in_file = `$grep_cmd $version_tag $filename`; @@ -710,8 +720,9 @@ sub parse_command_status { return 1; } if ($upload) { - xCAT::SvrUtils::sendmsg("Upload option is not yet supported.", $callback); - return 1; + # Upload specified update file to BMC + $next_status{LOGIN_RESPONSE} = "RFLASH_FILE_UPLOAD_REQUEST"; + $next_status{"RFLASH_FILE_UPLOAD_REQUEST"} = "RFLASH_FILE_UPLOAD_RESPONSE"; } } @@ -832,7 +843,13 @@ sub gen_send_request { if ($method eq "GET") { $debug_info = "$node: DEBUG $method $request_url"; } else { - $debug_info = "$node: DEBUG $method $request_url -d $content"; + if ($::UPLOAD_FILE) { + # Slightly different debug message when doing a file upload + $debug_info = "$node: DEBUG $method $request_url -T " . $::UPLOAD_FILE; + } + else { + $debug_info = "$node: DEBUG $method $request_url -d $content"; + } } print "$debug_info\n"; @@ -864,6 +881,15 @@ sub deal_with_response { my $error; if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) { $error = $::RESPONSE_SERVICE_UNAVAILABLE; + } elsif ($response->status_line eq $::RESPONSE_METHOD_NOT_ALLOWED) { + # Special processing for file upload. At this point we do not know how to + # form a proper file upload request. It always fails with "Method not allowed" error. + # If that happens, just assume it worked. + # TODO remove this block when proper request can be generated + $status_info{ $node_info{$node}{cur_status} }->{process}->($node, $response); + + return; + } else { my $response_info = decode_json $response->content; if ($response->status_line eq $::RESPONSE_SERVER_ERROR) { @@ -1420,6 +1446,45 @@ sub rflash_response { } xCAT::SvrUtils::sendmsg("", $callback, $node); #Separate output in case more than 1 endpoint } + if ($node_info{$node}{cur_status} eq "RFLASH_FILE_UPLOAD_RESPONSE") { + # Special processing for file upload. At this point we do not know how to + # form a proper file upload request. It always fails with "Method not allowed" error. + # If that happens, just call the curl commands for now. + # TODO remove this block when proper request can be generated + if ($::UPLOAD_FILE) { + my $request_url_login = "$http_protocol://" . $node_info{$node}{bmc} . "/login"; + my $request_url_logout = "$http_protocol://" . $node_info{$node}{bmc} . "/logout"; + my $request_url_upload = "$http_protocol://" . $node_info{$node}{bmc} . "/upload/image/"; + my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; + my $content_logout = '{ "data": [ ] }'; + + # curl commands + my $curl_login_cmd = "curl -c cjar -k -H 'Content-Type: application/json' -X POST $request_url_login -d '" . $content_login . "'"; + my $curl_logout_cmd = "curl -b cjar -k -H 'Content-Type: application/json' -X POST $request_url_logout -d '" . $content_logout . "'"; + my $curl_upload_cmd = "curl -b cjar -k -H 'Content-Type: application/octet-stream' -X PUT -T $::UPLOAD_FILE $request_url_upload"; + + # Try to login + my $curl_login_result = `$curl_login_cmd`; + my $h = from_json($curl_login_result); # convert command output to hash + if ($h->{message} eq $::RESPONSE_OK) { + # Login successfull, upload the file + my $curl_upload_result = `$curl_upload_cmd`; + $h = from_json($curl_upload_result); # convert command output to hash + if ($h->{message} eq $::RESPONSE_OK) { + # Upload successfull + xCAT::SvrUtils::sendmsg("Update file $::UPLOAD_FILE successfully uploaded", $callback, $node); + # Try to logoff, no need to check result, as there is nothing else to do if failure + my $curl_logout_result = `$curl_logout_cmd`; + } + else { + xCAT::SvrUtils::sendmsg("Failed to upload update file $::UPLOAD_FILE :" . $h->{message} . " - " . $h->{data}->{description}, $callback, $node); + } + } + else { + xCAT::SvrUtils::sendmsg("Unable to login :" . $h->{message} . " - " . $h->{data}->{description}, $callback, $node); + } + } + } if ($next_status{ $node_info{$node}{cur_status} }) { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; From eeda12c26558430b88efde2e42dba8458c11ec8a Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 14 Jun 2017 23:17:11 -0400 Subject: [PATCH 136/201] fix autotest statelite case failure --- xCAT-test/autotest/testcase/installation/litefile_sles.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/installation/litefile_sles.csv b/xCAT-test/autotest/testcase/installation/litefile_sles.csv index b3ade0407..d4e7d90e7 100644 --- a/xCAT-test/autotest/testcase/installation/litefile_sles.csv +++ b/xCAT-test/autotest/testcase/installation/litefile_sles.csv @@ -4,6 +4,7 @@ "ALL","/etc/ntp.conf","tmpfs",, "ALL","/etc/ntp.conf.org","tmpfs",, "ALL","/etc/resolv.conf","tmpfs",, +"ALL","/etc/hostname","tmpfs",, "ALL","/etc/ssh/","tmpfs",, "ALL","/etc/sysconfig/","tmpfs",, "ALL","/etc/syslog-ng/","tmpfs",, From 0dce825785f062a15d634c73ea540c658f5fad23 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Jun 2017 02:32:32 -0400 Subject: [PATCH 137/201] Add testcases for simulator multiple --- .../autotest/testcase/simulator/change_ip.sh | 21 ------ .../testcase/simulator/clear_simulator | 20 +++++- .../testcase/simulator/config_simulator.sh | 58 +++++++++++++++ .../testcase/simulator/setup_simulator | 71 ++++++++++++++++++- 4 files changed, 147 insertions(+), 23 deletions(-) delete mode 100755 xCAT-test/autotest/testcase/simulator/change_ip.sh create mode 100755 xCAT-test/autotest/testcase/simulator/config_simulator.sh diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh deleted file mode 100755 index 59fb80b0a..000000000 --- a/xCAT-test/autotest/testcase/simulator/change_ip.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -flag=$1 -mnhn=$2 -cnhn=$3 - -if [ $flag = "-s" ]; then - cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` - echo $cnip > "/tmp/simulator" - mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` - chdef $cnhn bmc=$mnip -elif [ $flag = "-c" ]; then - cnip=`cat /tmp/simulator` - chdef $cnhn bmc=$cnip - process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'` - if [ $process ]; then - kill $process - fi - rm -rf "openbmc_simulator" -fi -exit $? diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 61e2207c9..1c3df64c9 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -1,5 +1,23 @@ start:clear_openbmc_simulator description:clear evironment -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -c $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_100 +description:clear evironment that simulate 100 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 100 +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_1000 +description:clear evironment that simulate 1000 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 1000 +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_5000 +description:clear evironment that simulate 5000 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 5000 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh new file mode 100755 index 000000000..6f9a1377f --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +flag=$1 +mnhn=$2 +cnhn=$3 +nodes=$4 + +mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` +if [ $nodes ]; then + nic=`ip -4 -o a | grep $mnip | awk -F ' ' '{print $2}'` + + if [ $nodes = "1000" ]; then + range=`echo $(echo 10.100.{1..10}.{1..100})` + elif [ $nodes = "5000" ]; then + range=`echo $(echo 10.100.{1..50}.{1..100})` + else + range=`echo $(echo 10.100.{1..10}.{1..10})` + fi +fi + +if [ $flag = "-s" ]; then + if [ $nodes ]; then + lsdef $cnhn -z > /tmp/$cnhn.stanza + rmdef $cnhn + + /root/openbmc_simulator/simulator -n $nic -r $range + + if [ $nodes = "1000" ]; then + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc + chdef simulator_test_[0-999] groups=$cnhn + elif [ $nodes = "5000" ]; then + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc + chdef simulator_test_[0-4999] groups=$cnhn + else + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/10)).((\$1)%10+1)|" bmcusername=root bmcpassword=0penBmc + chdef simulator_test_[0-99] groups=$cnhn + fi + else + cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` + echo $cnip > "/tmp/simulator" + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` + chdef $cnhn bmc=$mnip + /root/openbmc_simulator/simulator + fi +elif [ $flag = "-c" ]; then + if [ $nodes ]; then + /root/openbmc_simulator/simulator -c -n $nic -r $range + rmdef $cnhn + cat /tmp/$cnhn.stanza | mkdef -z + else + /root/openbmc_simulator/simulator -c + cnip=`cat /tmp/simulator` + chdef $cnhn bmc=$cnip + fi + + rm -rf /root/openbmc_simulator +fi +exit $? diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index 6a4bb71f6..e69f8c562 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -19,6 +19,75 @@ cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git check:rc==0 cmd:/root/openbmc_simulator/simulator & check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -s $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_100 +description:install dependent packaages, setup and start 100 openbmc simulator +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 100 +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_1000 +description:install dependent packaages, setup and start 1000 openbmc simulator +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 1000 +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_5000 +description:install dependent packaages, setup and start 5000 openbmc simulator +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 5000 check:rc==0 end From d80adecbc29d3dcdf63741f183056aa86b8da140 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 15 Jun 2017 05:43:58 -0400 Subject: [PATCH 138/201] add hardware control bundle for different hardware type --- xCAT-test/autotest/bundle/hdctrl_bmc.bundle | 5 ++++ .../autotest/bundle/hdctrl_general.bundle | 25 +++++++++++++++++++ .../bundle/hdctrl_openpower_ipmi.bundle | 10 ++++++++ .../bundle/hdctrl_openpower_openbmc.bundle | 10 ++++++++ .../autotest/bundle/hdctrl_ppc_hmc.bundle | 4 +++ 5 files changed, 54 insertions(+) create mode 100644 xCAT-test/autotest/bundle/hdctrl_bmc.bundle create mode 100644 xCAT-test/autotest/bundle/hdctrl_general.bundle create mode 100644 xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle create mode 100644 xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle create mode 100644 xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle diff --git a/xCAT-test/autotest/bundle/hdctrl_bmc.bundle b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle new file mode 100644 index 000000000..08ddf66c1 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle @@ -0,0 +1,5 @@ +#INCLUDE:hdctrl_general.bundle# +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_leds diff --git a/xCAT-test/autotest/bundle/hdctrl_general.bundle b/xCAT-test/autotest/bundle/hdctrl_general.bundle new file mode 100644 index 000000000..7ea993052 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_general.bundle @@ -0,0 +1,25 @@ +rpower_off +rpower_stat +rpower_status +rpower_state +rpower_boot +rpower_on +rpower_reset +rpower_noderange +rpower_noderange_nodeps +rpower_err_noderange +rinv_h +rinv_v +rinv_help +rinv_errorcommand +rinv_serial +rinv_model +rinv_firm +rinv_all +rvitals_h +rvitals_v +rvitals_errorcommand +rvitals_temp +rvitals_voltage +rvitals_all +rvitals_noderange_err diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle new file mode 100644 index 000000000..7ab405aab --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle @@ -0,0 +1,10 @@ +#INCLUDE:hdctrl_general.bundle# +rinv_deviceid +rinv_uuid +rinv_guid +rinv_vpd +rinv_mprom +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_leds diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle new file mode 100644 index 000000000..043bb245e --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle @@ -0,0 +1,10 @@ +#INCLUDE:hdctrl_general.bundle# +rinv_deviceid +rinv_uuid +rinv_vpd +rinv_cpu +rinv_dimm +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_leds diff --git a/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle new file mode 100644 index 000000000..e7ba1aa74 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle @@ -0,0 +1,4 @@ +#INCLUDE:hdctrl_general.bundle# +rinv_bus +rinv_config +rvitals_lcds From c92e8eca1aea1db6a9de99fada7befcc602ac6e3 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 15 Jun 2017 07:15:03 -0400 Subject: [PATCH 139/201] Refine test case: nodeset_cmdline, nodeset_runimage, nodeset_shell --- xCAT-test/autotest/testcase/genesis/cases0 | 6 ++--- .../autotest/testcase/genesis/genesistest.pl | 25 ++++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index 977261ad0..3b0037e5d 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -2,7 +2,7 @@ start:nodeset_shell description: verify could log in genesis shell cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s ;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN; cat /tmp/genesistestlog/*;exit 1;fi check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 @@ -12,7 +12,7 @@ start:nodeset_cmdline description:verify could run cmdline successfully cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -d +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -d;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN;cat /tmp/genesistestlog/*;exit 1;fi check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 @@ -22,7 +22,7 @@ start:nodeset_runimg description:verify runimg could work cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -i +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -i;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN;cat /tmp/genesistestlog/*;exit 1;fi check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 73c3bc3b4..cf64a2bc5 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -5,7 +5,6 @@ BEGIN $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; -use xCAT::Utils; use strict; use warnings; use Getopt::Long; @@ -71,7 +70,8 @@ if (!defined($noderange)) { print "$::USAGE"; exit 1; } -my $os = xCAT::Utils->osver("all"); +my $os = &get_os; +print "os is $os\n"; if ($check_genesis_file) { send_msg(2, "[$$]:Check genesis file..............."); &check_genesis_file(&get_arch); @@ -81,8 +81,9 @@ if ($check_genesis_file) { send_msg(2, "genesis file available"); } } -my $master=xCAT::TableUtils->get_site_Master(); +my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`; if (!$master) { $master=hostname(); } +print "master is $master\n"; #################################### ####nodesetshell test for genesis @@ -236,6 +237,7 @@ sub rungenesisimg { chmod 0755, "/install/my_image/runme.sh"; `tar -zcvf /tmp/my_image.tgz -C /install/my_image .`; copy("/tmp/my_image.tgz", "/install/my_image") or die "Copy failed: $!"; + print "master is $master\n"; `rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; if ($?) { send_msg(0, "rinstall noderange failed for runimg"); @@ -264,7 +266,7 @@ sub testxdsh { if (($value == 1) || ($value == 2) || ($value == 3)) { `xdsh $noderange -t 2 cat $checkfile |grep $checkstring`; if ($?) { - foreach (1 .. 1500) { + foreach (1 .. 15) { `xdsh $noderange -t 2 cat $checkfile | grep $checkstring`; last if ($? == 0); } @@ -311,6 +313,21 @@ sub clearenv { return 0; } #################################### +#get os +################################### +sub get_os { + my $os = "unknown"; + my $output = `cat /etc/*release* 2>&1`; + if ($output =~ /suse/i) { + $os = "sles"; + } elsif ($output =~ /Red Hat/i) { + $os = "redhat"; + } elsif ($output =~ /ubuntu/i) { + $os = "ubuntu"; + } + return $os; +} +#################################### #get arch ################################### sub get_arch { From 6cb1dbb82446fe4dedb770cd13213b50efd7dd51 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 15 Jun 2017 09:31:44 -0400 Subject: [PATCH 140/201] Refine test case: nodeset_cmdline, nodeset_runimage, nodeset_shell --- .../autotest/testcase/genesis/genesistest.pl | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index cf64a2bc5..d75ff6e7b 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -1,10 +1,5 @@ #!/usr/bin/env perl # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -BEGIN -{ - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; -} -use lib "$::XCATROOT/lib/perl"; use strict; use warnings; use Getopt::Long; @@ -71,7 +66,6 @@ if (!defined($noderange)) { exit 1; } my $os = &get_os; -print "os is $os\n"; if ($check_genesis_file) { send_msg(2, "[$$]:Check genesis file..............."); &check_genesis_file(&get_arch); @@ -171,7 +165,7 @@ sub check_genesis_file { sub rungenesiscmd { my $runcmd_script = "/tmp/cmdtest"; my $result = "/tmp/testresult"; - my $genesis_base_dir = "$::XCATROOT/share/xcat/netboot/genesis"; + my $genesis_base_dir = "/opt/xcat/share/xcat/netboot/genesis"; my $genesis_bin_dir; my $value = 0; my $arch = shift; @@ -211,7 +205,7 @@ sub rungenesiscmd { sub rungenesisimg { my $runimg_script = "/tmp/imgtest"; my $result = "/tmp/testresult"; - my $genesis_base_dir = "$::XCATROOT/share/xcat/netboot/genesis"; + my $genesis_base_dir = "/opt/xcat/share/xcat/netboot/genesis"; my $genesis_bin_dir; my $value = 0; mkdir("/install/my_image"); @@ -237,7 +231,6 @@ sub rungenesisimg { chmod 0755, "/install/my_image/runme.sh"; `tar -zcvf /tmp/my_image.tgz -C /install/my_image .`; copy("/tmp/my_image.tgz", "/install/my_image") or die "Copy failed: $!"; - print "master is $master\n"; `rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; if ($?) { send_msg(0, "rinstall noderange failed for runimg"); @@ -266,7 +259,7 @@ sub testxdsh { if (($value == 1) || ($value == 2) || ($value == 3)) { `xdsh $noderange -t 2 cat $checkfile |grep $checkstring`; if ($?) { - foreach (1 .. 15) { + foreach (1 .. 1500) { `xdsh $noderange -t 2 cat $checkfile | grep $checkstring`; last if ($? == 0); } @@ -285,7 +278,7 @@ sub clearenv { my $runmetar = "/install/my_image/my_image.tgz"; my $runmetar_tmp = "/tmp/my_image.tgz"; my $runmedir = "/install/my_image"; - my $genesis_base_dir = "$::XCATROOT/share/xcat/netboot/genesis"; + my $genesis_base_dir = "/opt/xcat/share/xcat/netboot/genesis"; if (-e "$runimg_script") { unlink("$runme"); unlink("$runmetar_tmp"); From 30b4929625c71d4186a681ec6da43f4748284157 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 15 Jun 2017 14:35:29 -0400 Subject: [PATCH 141/201] Fixes to rinstall/winstall man pages --- .../references/man8/makedns.8.rst | 2 +- .../references/man8/makeknownhosts.8.rst | 14 ++++--- .../references/man8/makenetworks.8.rst | 2 +- .../references/man8/makeroutes.8.rst | 2 +- .../references/man8/nodeset.8.rst | 4 +- .../references/man8/rinstall.8.rst | 23 ++++++----- .../references/man8/winstall.8.rst | 35 +++++++---------- .../references/man8/xcatconfig.8.rst | 12 +++--- .../references/man8/xcatsetup.8.rst | 2 +- xCAT-client/pods/man8/makedns.8.pod | 2 +- xCAT-client/pods/man8/makenetworks.8.pod | 2 +- xCAT-client/pods/man8/makeroutes.8.pod | 2 +- xCAT-client/pods/man8/nodeset.8.pod | 4 +- xCAT-client/pods/man8/rinstall.8.pod | 23 ++++++----- xCAT-client/pods/man8/winstall.8.pod | 38 +++++++++---------- xCAT-client/pods/man8/xcatconfig.8.pod | 12 +++--- xCAT-client/pods/man8/xcatsetup.8.pod | 2 +- xCAT-server/lib/xcat/plugins/rinstall.pm | 4 +- 18 files changed, 87 insertions(+), 98 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makedns.8.rst b/docs/source/guides/admin-guides/references/man8/makedns.8.rst index 9b558dccf..a97c1401a 100644 --- a/docs/source/guides/admin-guides/references/man8/makedns.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makedns.8.rst @@ -43,7 +43,7 @@ The \ **forwarders**\ value should be set to the IP address of one or more name An xCAT \ **network**\ definition must be defined for each network used in the cluster. The \ **net**\ and \ **mask**\ attributes will be used by the \ **makedns**\ command. -A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definiton corresponding to the node or in the \ **site**\ definition. +A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definition corresponding to the node or in the \ **site**\ definition. Only entries in /etc/hosts or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. diff --git a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst index 495704d9c..fe31b65ad 100644 --- a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -d | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -**\ **-remove | -d | -**\ **-delete**\ ] [\ **-V | -**\ **-verbose**\ ] \ **makeknownhosts**\ [\ **-h | -**\ **-help**\ ] @@ -53,12 +53,18 @@ OPTIONS -\ **-r| -d| -**\ **-remove**\ +\ **-d|-**\ **-delete**\ Only removes the entries for the nodes from the known_hosts file. +\ **-r|-**\ **-remove**\ + + Synonymous to \ **-d|-**\ **-delete**\ . + + + \ **-V|-**\ **-verbose**\ Verbose mode. @@ -97,10 +103,6 @@ EXAMPLES .. code-block:: perl - makeknownhosts node02 -r - - or - makeknownhosts node02 -d diff --git a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst index 4b0b7a11c..aa78cdc5b 100644 --- a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst @@ -35,7 +35,7 @@ The \ **makenetworks**\ command can be used to gather network information from Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the managment node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. You can use the "-d" option to display the network information without writing it to the database. diff --git a/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst b/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst index 9a0145393..1bb33dd5c 100644 --- a/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst @@ -35,7 +35,7 @@ DESCRIPTION *********** -The \ **makeroutes**\ command adds or deletes routes on the management node or any given nodes. The \ **noderange**\ specifies the nodes where the routes are to be added or removed. When the \ *noderange*\ is omitted, the action will be done on the management node. The \ **-r**\ option specifies the name of routes. The details of the routes are defined in the \ **routes**\ table which contians the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on \ **noderes.routenames**\ for the nodes or on \ **site.mnroutenames**\ for the management node will be used. +The \ **makeroutes**\ command adds or deletes routes on the management node or any given nodes. The \ **noderange**\ specifies the nodes where the routes are to be added or removed. When the \ *noderange*\ is omitted, the action will be done on the management node. The \ **-r**\ option specifies the name of routes. The details of the routes are defined in the \ **routes**\ table which contains the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on \ **noderes.routenames**\ for the nodes or on \ **site.mnroutenames**\ for the management node will be used. If you want the routes be automatically setup during node deployment, first put a list of route names to \ **noderes.routenames**\ and then add \ *setroute*\ script name to the \ **postscripts.postbootscripts**\ for the nodes. diff --git a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst index 23ec24e23..35edfcd45 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -53,7 +53,7 @@ Assume that /tftpboot is the root for tftpd (set in site(5)|site.5). \ **nodeset**\ is called by \ **rinstall**\ and \ **winstall**\ and is also called by the installation process remotely to set the boot state back to "boot". -A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. *************** @@ -114,7 +114,7 @@ A user can supply their own scripts to be run on the mn or on the service node ( \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. diff --git a/docs/source/guides/admin-guides/references/man8/rinstall.8.rst b/docs/source/guides/admin-guides/references/man8/rinstall.8.rst index 0e06cd9e6..f33d0144c 100644 --- a/docs/source/guides/admin-guides/references/man8/rinstall.8.rst +++ b/docs/source/guides/admin-guides/references/man8/rinstall.8.rst @@ -19,9 +19,9 @@ Name **************** -\ **rinstall**\ \ *noderange*\ \ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **rinstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ ] [\ **runimage=**\ \ *task*\ ] [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ \ *noderange*\ \ **osimage**\ =\ *imagename*\ | [\ **-O**\ ] \ *imagename*\ [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **rinstall**\ \ *noderange*\ [\ **osimage**\ =\ *imagename*\ | \ *imagename*\ ] [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] \ **rinstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -31,11 +31,11 @@ Name ******************* -\ **rinstall**\ is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +\ **rinstall**\ is a convenience command to begin OS provision on a noderange. -If \ **osimage**\ =\ *imagename*\ | \ **-O**\ \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. +If \ **osimage**\ =\ *imagename*\ | \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. -If -c is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes , see winstall(8)|winstall.8. +If \ **-c**\ is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes, see winstall(8)|winstall.8. *************** @@ -50,9 +50,9 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **osimage | osimage=**\ \ *imagename*\ |\ **-O**\ \ *imagename*\ +\ *imagename*\ | \ **osimage=**\ \ *imagename*\ - Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. + Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the \ *imagename*\ is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. @@ -62,7 +62,7 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **runimage**\ =\ *task*\ +\ **runimage=**\ \ *task*\ If you would like to run a task after deployment, you can define that task with this attribute. @@ -70,14 +70,13 @@ If -c is specified, it will then run rcons on the node. This is allowed only if \ **runcmd=bmcsetup**\ - This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC - for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. + This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. @@ -100,7 +99,7 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **-V | -**\ **-Verbose**\ +\ **-V | -**\ **-verbose**\ Verbose output. diff --git a/docs/source/guides/admin-guides/references/man8/winstall.8.rst b/docs/source/guides/admin-guides/references/man8/winstall.8.rst index cfe21170c..e939b5554 100644 --- a/docs/source/guides/admin-guides/references/man8/winstall.8.rst +++ b/docs/source/guides/admin-guides/references/man8/winstall.8.rst @@ -19,11 +19,11 @@ Name **************** -\ **rinstall**\ \ *noderange*\ \ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **winstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ ] [\ **runimage=**\ \ *task*\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ \ *noderange*\ \ **osimage**\ =\ *imagename*\ | [\ **-O**\ ] \ *imagename*\ [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **winstall**\ \ *noderange*\ [\ **osimage**\ =\ *imagename*\ | \ *imagename*\ ] [\ **-**\ **-ignorekernelchk**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] +\ **winstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] ******************* @@ -31,11 +31,11 @@ Name ******************* -\ **winstall**\ is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +\ **winstall**\ is a convenience command to begin OS provision on a noderange. -If \ **osimage**\ =\ *imagename*\ | \ **-O**\ \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. +If \ **osimage**\ =\ *imagename*\ | \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. -It will then run wcons on the nodes. +It will then run \ **wcons**\ on the noderange. *************** @@ -50,9 +50,9 @@ It will then run wcons on the nodes. -\ **osimage | osimage=**\ \ *imagename*\ |\ **-O**\ \ *imagename*\ +\ *imagename*\ | \ **osimage=**\ \ *imagename*\ - Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. + Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the \ *imagename*\ is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. @@ -62,7 +62,7 @@ It will then run wcons on the nodes. -\ **runimage**\ =\ *task*\ +\ **runimage=**\ \ *task*\ If you would like to run a task after deployment, you can define that task with this attribute. @@ -70,14 +70,13 @@ It will then run wcons on the nodes. \ **runcmd=bmcsetup**\ - This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC - for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. + This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. @@ -100,18 +99,12 @@ It will then run wcons on the nodes. -\ **-V | -**\ **-Verbose**\ +\ **-V | -**\ **-verbose**\ Verbose output. -\ **-c | -**\ **-console**\ - - Requests that rinstall runs rcons once the provision starts. This will only work if there is only one node in the noderange. See winstall(8)|winstall.8 for starting consoles on multiple nodes. - - - **************** \ **Examples**\ @@ -119,7 +112,7 @@ It will then run wcons on the nodes. -1. Provison nodes 1 through 20, using their current configuration. +1. Provision nodes 1 through 20, using their current configuration. .. code-block:: perl @@ -134,7 +127,7 @@ It will then run wcons on the nodes. .. code-block:: perl - winstall node1-node20 -O rhels6.4-ppc64-netboot-compute + winstall node1-node20 osimage=rhels6.4-ppc64-netboot-compute diff --git a/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst b/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst index 75d981311..85a089555 100644 --- a/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst +++ b/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst @@ -66,19 +66,19 @@ OPTIONS \ **-i|-**\ **-initialinstall**\ - The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the datebase, export directories, start syslog and other daemons as needed after the initial install of xCAT. + The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the database, export directories, start syslog and other daemons as needed after the initial install of xCAT. \ **-u|-**\ **-updateinstall**\ - The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, datebase, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. + The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, database, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. \ **-k|-**\ **-sshkeys**\ - This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distribute to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. + This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distributed to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. rspconfig will need to be run to distribute the key to the MM and HMCs. Any device, we need to ssh from the MN to the device will also have to be updated with the new ssh keys. @@ -91,7 +91,7 @@ OPTIONS \ **-c|-**\ **-credentials**\ - This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistribed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stop and started. + This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistributed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stopped and started. @@ -103,9 +103,9 @@ OPTIONS \ **-f|-**\ **-force**\ - The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinititialize the site table. This option should be used, if keys or credentials become corrupt or lost. + The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinitialize the site table. This option should be used, if keys or credentials become corrupt or lost. Additional action must be taken after using the force options. ssh keys must be redistributed to the nodes, site table attributes might need to be restored, makeconservercf needs to be rerun to pick up the new credentials and conserver stopped and started, rspconfig needs to be rerun to distribute the new keys to the MM and the HMCs. - A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. + A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. Redistribute credentials and ssh keys to the service nodes and ssh keys to the nodes by using the updatenode -k command. diff --git a/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst b/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst index 494551577..355cc6cb6 100644 --- a/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst +++ b/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst @@ -124,7 +124,7 @@ Configuration File The \ **config file**\ is organized in stanza format and supports the keywords in the sample file below. Comment lines -begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +begin with "#". Stanzas can be omitted if you do not want to define that type of object. The only hostname formats supported are those shown in this sample file, although you can change the base text and the numbers. For example, hmc1-hmc3 could be changed to hwmgmt01-hwmgmt12. The hostnames specified must sort correctly. I.e. use node01-node80, instead of node1-node80. diff --git a/xCAT-client/pods/man8/makedns.8.pod b/xCAT-client/pods/man8/makedns.8.pod index e74603548..8366b8c8e 100644 --- a/xCAT-client/pods/man8/makedns.8.pod +++ b/xCAT-client/pods/man8/makedns.8.pod @@ -24,7 +24,7 @@ The B value should be set to the IP address of one or more nameserve An xCAT B definition must be defined for each network used in the cluster. The B and B attributes will be used by the B command. -A network B and B values must be provided either in the B definiton corresponding to the node or in the B definition. +A network B and B values must be provided either in the B definition corresponding to the node or in the B definition. Only entries in /etc/hosts or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. diff --git a/xCAT-client/pods/man8/makenetworks.8.pod b/xCAT-client/pods/man8/makenetworks.8.pod index 963fdde9f..771ff4eeb 100644 --- a/xCAT-client/pods/man8/makenetworks.8.pod +++ b/xCAT-client/pods/man8/makenetworks.8.pod @@ -16,7 +16,7 @@ The B command can be used to gather network information from an xC Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the managment node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. You can use the "-d" option to display the network information without writing it to the database. diff --git a/xCAT-client/pods/man8/makeroutes.8.pod b/xCAT-client/pods/man8/makeroutes.8.pod index b20e161e0..77b315ec4 100644 --- a/xCAT-client/pods/man8/makeroutes.8.pod +++ b/xCAT-client/pods/man8/makeroutes.8.pod @@ -16,7 +16,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 DESCRIPTION -The B command adds or deletes routes on the management node or any given nodes. The B specifies the nodes where the routes are to be added or removed. When the I is omitted, the action will be done on the management node. The B<-r> option specifies the name of routes. The details of the routes are defined in the B table which contians the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on B for the nodes or on B for the management node will be used. +The B command adds or deletes routes on the management node or any given nodes. The B specifies the nodes where the routes are to be added or removed. When the I is omitted, the action will be done on the management node. The B<-r> option specifies the name of routes. The details of the routes are defined in the B table which contains the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on B for the nodes or on B for the management node will be used. If you want the routes be automatically setup during node deployment, first put a list of route names to B and then add I script name to the B for the nodes. diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index bc8e2fb46..15618d46d 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -34,7 +34,7 @@ B only sets the next boot state, but does not reboot. B is called by B and B and is also called by the installation process remotely to set the boot state back to "boot". -A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 B @@ -77,7 +77,7 @@ for basic remote access. This causes the IP, netmask, gateway, username, and pa =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B diff --git a/xCAT-client/pods/man8/rinstall.8.pod b/xCAT-client/pods/man8/rinstall.8.pod index f7060e929..6675b0ca3 100644 --- a/xCAT-client/pods/man8/rinstall.8.pod +++ b/xCAT-client/pods/man8/rinstall.8.pod @@ -4,19 +4,19 @@ B - Begin OS provision on a noderange =head1 B -B I B | B | B [B<-c>|B<--console>] [B<-V>|B<--verbose>] +B I [B | B | B] [BI] [B<-c>|B<--console>] [B<-V>|B<--verbose>] -B I B=I | [B<-O>] I [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] +B I [B=I | I] [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 B -B is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +B is a convenience command to begin OS provision on a noderange. -If B=I | B<-O> I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. +If B=I | I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. -If -c is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes , see L. +If B<-c> is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes, see L. =head1 B @@ -26,26 +26,25 @@ If -c is specified, it will then run rcons on the node. This is allowed only if Instruct network boot loader to be skipped, generally meaning boot to hard disk -=item B|BI|B<-O>I +=item I | BI -Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the is omitted, the os image name will be obtained from I for the node. +Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the I is omitted, the os image name will be obtained from I for the node. =item B<--ignorekernelchk> Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel. -=item B=I +=item BI If you would like to run a task after deployment, you can define that task with this attribute. =item B -This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC -for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. +This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B<-h>|B<--help> @@ -60,7 +59,7 @@ Display version. For BMC-based servers, to specify the next boot mode to be "UEFI Mode". -=item B<-V>|B<--Verbose> +=item B<-V>|B<--verbose> Verbose output. diff --git a/xCAT-client/pods/man8/winstall.8.pod b/xCAT-client/pods/man8/winstall.8.pod index e8f25bb3c..acc377761 100644 --- a/xCAT-client/pods/man8/winstall.8.pod +++ b/xCAT-client/pods/man8/winstall.8.pod @@ -4,19 +4,19 @@ B - Begin OS provision on a noderange =head1 B -B I B | B | B [B<-c>|B<--console>] [B<-V>|B<--verbose>] +B I [B | B | B] [BI] [B<-V>|B<--verbose>] -B I B=I | [B<-O>] I [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] +B I [B=I | I] [B<--ignorekernelchk>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] -B [B<-h>|B<--help>|B<-v>|B<--version>] +B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 B -B is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +B is a convenience command to begin OS provision on a noderange. -If B=I | B<-O> I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. - -It will then run wcons on the nodes. +If B=I | I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. + +It will then run B on the noderange. =head1 B @@ -26,26 +26,25 @@ It will then run wcons on the nodes. Instruct network boot loader to be skipped, generally meaning boot to hard disk -=item B|BI|B<-O>I +=item I | BI -Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the is omitted, the os image name will be obtained from I for the node. +Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the I is omitted, the os image name will be obtained from I for the node. =item B<--ignorekernelchk> Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel. -=item B=I +=item BI If you would like to run a task after deployment, you can define that task with this attribute. =item B -This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC -for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. +This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B<-h>|B<--help> @@ -60,31 +59,28 @@ Display version. For BMC-based servers, to specify the next boot mode to be "UEFI Mode". -=item B<-V>|B<--Verbose> +=item B<-V>|B<--verbose> Verbose output. -=item B<-c>|B<--console> - -Requests that rinstall runs rcons once the provision starts. This will only work if there is only one node in the noderange. See L for starting consoles on multiple nodes. - =back + =head1 B =over 2 =item 1. -Provison nodes 1 through 20, using their current configuration. +Provision nodes 1 through 20, using their current configuration. winstall node1-node20 =item 2. Provision nodes 1 through 20 with the osimage rhels6.4-ppc64-netboot-compute. - winstall node1-node20 -O rhels6.4-ppc64-netboot-compute + winstall node1-node20 osimage=rhels6.4-ppc64-netboot-compute -=back +=back =head1 B B diff --git a/xCAT-client/pods/man8/xcatconfig.8.pod b/xCAT-client/pods/man8/xcatconfig.8.pod index 7d7e73be7..3ad208093 100644 --- a/xCAT-client/pods/man8/xcatconfig.8.pod +++ b/xCAT-client/pods/man8/xcatconfig.8.pod @@ -38,15 +38,15 @@ Displays verbose messages. =item B<-i|--initialinstall> -The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the datebase, export directories, start syslog and other daemons as needed after the initial install of xCAT. +The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the database, export directories, start syslog and other daemons as needed after the initial install of xCAT. =item B<-u|--updateinstall> -The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, datebase, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. +The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, database, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. =item B<-k|--sshkeys> -This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distribute to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. +This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distributed to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. rspconfig will need to be run to distribute the key to the MM and HMCs. Any device, we need to ssh from the MN to the device will also have to be updated with the new ssh keys. =item B<-s|--sshnodehostkeys> @@ -55,7 +55,7 @@ This option will remove and regenerate the node host ssh keys. It should only b =item B<-c|--credentials> -This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistribed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stop and started. +This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistributed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stopped and started. =item B<-d|--database> @@ -63,9 +63,9 @@ This option will reinitialize the basic xCAT database table setup. It will not =item B<-f|--force> -The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinititialize the site table. This option should be used, if keys or credentials become corrupt or lost. +The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinitialize the site table. This option should be used, if keys or credentials become corrupt or lost. Additional action must be taken after using the force options. ssh keys must be redistributed to the nodes, site table attributes might need to be restored, makeconservercf needs to be rerun to pick up the new credentials and conserver stopped and started, rspconfig needs to be rerun to distribute the new keys to the MM and the HMCs. -A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. +A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. Redistribute credentials and ssh keys to the service nodes and ssh keys to the nodes by using the updatenode -k command. =item B<-m|--mgtnode> diff --git a/xCAT-client/pods/man8/xcatsetup.8.pod b/xCAT-client/pods/man8/xcatsetup.8.pod index 7ee96dd95..bea98a54c 100644 --- a/xCAT-client/pods/man8/xcatsetup.8.pod +++ b/xCAT-client/pods/man8/xcatsetup.8.pod @@ -85,7 +85,7 @@ The B command has only been implemented and tested for system p serve =head2 Configuration File The B is organized in stanza format and supports the keywords in the sample file below. Comment lines -begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +begin with "#". Stanzas can be omitted if you do not want to define that type of object. The only hostname formats supported are those shown in this sample file, although you can change the base text and the numbers. For example, hmc1-hmc3 could be changed to hwmgmt01-hwmgmt12. The hostnames specified must sort correctly. I.e. use node01-node80, instead of node1-node80. diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 906746b33..421b4d71e 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -622,8 +622,8 @@ sub usage { my $callback = shift; my $rsp = {}; $rsp->{data}->[0] = "Usage:"; - $rsp->{data}->[1] = " $command boot | shell | runcmd=bmcsetup [-c|--console] [-u|--uefimode] [-V|--verbose]"; - $rsp->{data}->[2] = " $command osimage= | -O [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]"; + $rsp->{data}->[1] = " $command [boot | shell | runcmd=bmcsetup] [runimage=] [-c|--console] [-u|--uefimode] [-V|--verbose]"; + $rsp->{data}->[2] = " $command [osimage= | ] [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]"; $rsp->{data}->[3] = " $command [-h|--help|-v|--version]"; xCAT::MsgUtils->message("I", $rsp, $callback); } From a246b048c57c95f3a5725c55afbc42166f2c9d58 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Jun 2017 21:23:53 -0400 Subject: [PATCH 142/201] modified depending on comments --- .../testcase/simulator/clear_simulator | 6 +- .../testcase/simulator/config_simulator.sh | 42 ++++++---- .../testcase/simulator/setup_simulator | 76 +------------------ 3 files changed, 33 insertions(+), 91 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 1c3df64c9..03c442fd9 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -6,18 +6,18 @@ end start:clear_openbmc_simulator_multiple_100 description:clear evironment that simulate 100 OpenBMCs -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 100 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 100 check:rc==0 end start:clear_openbmc_simulator_multiple_1000 description:clear evironment that simulate 1000 OpenBMCs -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 1000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 1000 check:rc==0 end start:clear_openbmc_simulator_multiple_5000 description:clear evironment that simulate 5000 OpenBMCs -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 5000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 5000 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh index 6f9a1377f..715d4cfd0 100755 --- a/xCAT-test/autotest/testcase/simulator/config_simulator.sh +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -1,9 +1,11 @@ #!/bin/bash -flag=$1 -mnhn=$2 -cnhn=$3 -nodes=$4 +flag=$1 # -s:setup simulator -c:clear simulator env +mnhn=$2 # MN hostname +cnhn=$3 # CN hostname +username=$4 # bmcusername +password=$5 # bmcpassword +nodes=$6 # number of IPs want to config mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` if [ $nodes ]; then @@ -14,27 +16,37 @@ if [ $nodes ]; then elif [ $nodes = "5000" ]; then range=`echo $(echo 10.100.{1..50}.{1..100})` else - range=`echo $(echo 10.100.{1..10}.{1..10})` + range=`echo $(echo 10.100.1.{1..100})` fi fi if [ $flag = "-s" ]; then + os=`cat /etc/*release*` + if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + echo "Install git Failed" + exit 1 + fi + elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + echo "Install git Failed" + exit 1 + fi + fi + + cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git + if [ $nodes ]; then lsdef $cnhn -z > /tmp/$cnhn.stanza rmdef $cnhn /root/openbmc_simulator/simulator -n $nic -r $range - if [ $nodes = "1000" ]; then - chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc - chdef simulator_test_[0-999] groups=$cnhn - elif [ $nodes = "5000" ]; then - chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc - chdef simulator_test_[0-4999] groups=$cnhn - else - chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/10)).((\$1)%10+1)|" bmcusername=root bmcpassword=0penBmc - chdef simulator_test_[0-99] groups=$cnhn - fi + node_end=$[nodes-1] + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=$username bmcpassword=$password + chdef simulator_test_[0-$node_end] groups=$cnhn # use CN hostname as group, so when run command against CN will rpower against all nodes added here else cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` echo $cnip > "/tmp/simulator" diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index e69f8c562..8ab412829 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -1,93 +1,23 @@ start:setup_openbmc_simulator description:install dependent packaages, setup and start openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/root/openbmc_simulator/simulator & -check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN check:rc==0 end start:setup_openbmc_simulator_multiple_100 description:install dependent packaages, setup and start 100 openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 100 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 100 check:rc==0 end start:setup_openbmc_simulator_multiple_1000 description:install dependent packaages, setup and start 1000 openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 1000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 1000 check:rc==0 end start:setup_openbmc_simulator_multiple_5000 description:install dependent packaages, setup and start 5000 openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 5000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 5000 check:rc==0 end From dbc0613d82dec25636c4463045f0c22378d112a7 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 15 Jun 2017 21:32:22 -0400 Subject: [PATCH 143/201] refine rpower cases to add more information in the cases. Fix bug 3270 --- xCAT-test/autotest/testcase/rpower/cases0 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index ee6974eac..c8ab300c9 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -1,4 +1,6 @@ start:rpower_off +description:This case is to test off option could remote power off nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done check:ouptut=~Running|on @@ -10,6 +12,8 @@ check:output=~Not Activated|off end start:rpower_stat +description:This case is to test stat option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -29,6 +33,8 @@ check:output=~Not Activated|off end start:rpower_boot +description:This case is to test boot option could power on the nodes if nodes in off state. Or could hard reset the nodes if they are on. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -41,7 +47,8 @@ check:output=~Running|on end start:rpower_status -description:checkout rpower node status could get node's stauts +description:This case is to test status option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN status|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN status @@ -54,7 +61,8 @@ check:output=~Running|on end start:rpower_state -description:checkout rpower node status could get node's stauts +description:This case is to test state option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN state|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN state @@ -67,6 +75,8 @@ check:output=~Running|on end start:rpower_on +description:This case is to test on option could remote power on nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -79,6 +89,8 @@ check:output=~Running|on end start:rpower_reset +description:This case is to test reset option could hard reset nodes when nodes are in on state. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -91,18 +103,24 @@ check:output=~Running|on end start:rpower_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN check:rc!=0 check:output=~Unsupported|Usage end start:rpower_noderange_nodeps +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN --nodeps check:rc!=0 check:output=~Unsupported|Usage end start:rpower_err_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute:N/A cmd:rpower testnode stat check:rc!=0 check:output=~Error From 201cbf15f7d3e7cbaeccd79b6584a095307d2b0c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 16 Jun 2017 01:48:56 -0400 Subject: [PATCH 144/201] modify rinv and rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases0 | 1 - xCAT-test/autotest/testcase/rvitals/openbmctest.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index 5cd9d942c..466b95bf2 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -99,7 +99,6 @@ cmd:chdef -p -t node -o $$CN groups="test" check:rc==0 cmd:rinv test all check:rc==1 -check:output=~testnode: Error check:output=~$$CN: SYSTEM cmd:chdef -m -t node -o $$CN groups="test" check:rc==0 diff --git a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh index 8584e79e4..c28e9fbfd 100755 --- a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh +++ b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh @@ -17,7 +17,7 @@ if [[ $1 ]]&&[[ $2 ]]&&[[ $3 ]];then if [[ $i == $2 ]];then node_number=1; else - echo no than more node checkeid + echo no than more node checked node_number=2; fi done From 3735a07bb91fea3ce8ec32aa47ec3fe5716d5f04 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 15 Jun 2017 04:06:11 -0400 Subject: [PATCH 145/201] add SIGN=0 option to skip repo sign in ubuntu build script --- build-ubunturepo | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 6e01caab8..42625d895 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -22,6 +22,8 @@ # When you are ready to release this build, use PROMOTE=1 without PREGA # BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in # prep for a release. +# GPGSIGN=0 - Do not sign the repo in the end of the build. The repo will be signed by default +# # LOG= - provide an LOG file option to redirect some output into log file # # For the dependency packages 1. All the xcat dependency deb packages should be uploaded to @@ -125,16 +127,20 @@ if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" fi -#sync the gpg key to the build machine local -gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux -mkdir -p $HOME/.gnupg -for key_name in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then - rm -f $HOME/.gnupg/$key_name - ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name - chmod 600 $HOME/.gnupg/$key_name - fi -done +if [ "$GPGSIGN" = "0" ];then + echo "GPGSIGN=$GPGSIGN specified, skip gnupg key downloading" +else + #sync the gpg key to the build machine local + gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux + mkdir -p $HOME/.gnupg + for key_name in pubring.gpg secring.gpg trustdb.gpg; do + if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then + rm -f $HOME/.gnupg/$key_name + ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name + chmod 600 $HOME/.gnupg/$key_name + fi + done +fi if [ "$c_flag" ] then @@ -323,9 +329,14 @@ Codename: $dist Architectures: $tmp_out_arch Components: main Description: Repository automatically genereted conf -SignWith: yes __EOF__ + + if [ "$GPGSIGN" = "0" ];then + echo "GPGSIGN=$GPGSIGN specified, the repo will not be signed" + else + echo "SignWith: yes" >> conf/distributions + fi done cat << __EOF__ > conf/options @@ -444,11 +455,16 @@ Codename: $dist Architectures: $tmp_out_arch Components: main Description: Repository automatically genereted conf -SignWith: yes __EOF__ done + if [ "$GPGSIGN" = "0" ];then + echo "GPGSIGN=$GPGSIGN specified, the repo will not be signed" + else + echo "SignWith: yes" >> conf/distributions + fi + cat << __EOF__ > conf/options verbose ask-passphrase From 9e0406b0e960511349f6d533ada42b7409993dd2 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 16 Jun 2017 02:15:04 -0400 Subject: [PATCH 146/201] update descriptions and rspconfig/rsetboot cases --- xCAT-test/autotest/bundle/hdctrl_bmc.bundle | 11 +++++++++++ xCAT-test/autotest/bundle/hdctrl_general.bundle | 1 + .../autotest/bundle/hdctrl_openpower_ipmi.bundle | 1 + .../autotest/bundle/hdctrl_openpower_openbmc.bundle | 11 +++++++++++ xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle | 1 + 5 files changed, 25 insertions(+) diff --git a/xCAT-test/autotest/bundle/hdctrl_bmc.bundle b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle index 08ddf66c1..b75dc41ce 100644 --- a/xCAT-test/autotest/bundle/hdctrl_bmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle @@ -1,5 +1,16 @@ +description:the cases in this bundle is to used to verify xCAT hardware control funtions on BMC managed servers. #INCLUDE:hdctrl_general.bundle# rvitals_wattage rvitals_fanspeed rvitals_power rvitals_leds +rsetboot_net_statcheck +rsetboot_cd_statcheck +rsetboot_default_statcheck +rsetboot_h +rsetboot_help +rsetboot_v +rsetboot_node_invalidnode +rsetboot_noderange_net +rsetboot_node_invalidaction +rsetboot_group_net diff --git a/xCAT-test/autotest/bundle/hdctrl_general.bundle b/xCAT-test/autotest/bundle/hdctrl_general.bundle index 7ea993052..84ed91f6f 100644 --- a/xCAT-test/autotest/bundle/hdctrl_general.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_general.bundle @@ -1,3 +1,4 @@ +description:the cases in this bundle is to verify xCAT hardware control functions. This is the basic bundle for all hardware types. rpower_off rpower_stat rpower_status diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle index 7ab405aab..c44ce9d54 100644 --- a/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle @@ -1,3 +1,4 @@ +description:the cases in this bundle is to verify xCAT hardware control functions on servers which are managed using IPMI. #INCLUDE:hdctrl_general.bundle# rinv_deviceid rinv_uuid diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle index 043bb245e..a271c5b6a 100644 --- a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle @@ -1,3 +1,4 @@ +description:the cases in this bundle is to used to verify xCAT hardware control funtions on openpower servers which are mananged using openbmc. #INCLUDE:hdctrl_general.bundle# rinv_deviceid rinv_uuid @@ -8,3 +9,13 @@ rvitals_wattage rvitals_fanspeed rvitals_power rvitals_leds +rsetboot_net_statcheck +rsetboot_cd_statcheck +rsetboot_default_statcheck +rsetboot_h +rsetboot_help +rsetboot_v +rsetboot_node_invalidnode +rsetboot_noderange_net +rsetboot_node_invalidaction +rsetboot_group_net diff --git a/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle index e7ba1aa74..2cf057542 100644 --- a/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle @@ -1,3 +1,4 @@ +description:the cases in this bundle is to used to verify xCAT hardware control funtions on HMC managed servers. #INCLUDE:hdctrl_general.bundle# rinv_bus rinv_config From a8ee4aaee8b59d03072f1d36c7d625255f112b19 Mon Sep 17 00:00:00 2001 From: XuWei Date: Fri, 16 Jun 2017 01:30:02 -0400 Subject: [PATCH 147/201] modified depending on comments --- .../testcase/simulator/config_simulator.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh index 715d4cfd0..80860227a 100755 --- a/xCAT-test/autotest/testcase/simulator/config_simulator.sh +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -7,17 +7,21 @@ username=$4 # bmcusername password=$5 # bmcpassword nodes=$6 # number of IPs want to config +if [ $nodes -gt 10000 ]; then + echo "Unsupported number of nodes: $nodes" + exit 1 +fi + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` if [ $nodes ]; then nic=`ip -4 -o a | grep $mnip | awk -F ' ' '{print $2}'` - if [ $nodes = "1000" ]; then - range=`echo $(echo 10.100.{1..10}.{1..100})` - elif [ $nodes = "5000" ]; then - range=`echo $(echo 10.100.{1..50}.{1..100})` - else - range=`echo $(echo 10.100.1.{1..100})` + ((a=$nodes/100)) + ((b=$nodes%100)) + if [ $b -eq 0 ]; then + b=100 fi + range=`for((i=1;i<=$a;i++)); do for((m=1;m<=$b;m++)); do echo -n "10.100.$i.$m ";done; done` fi if [ $flag = "-s" ]; then From 56e418d81aa3b3fa0e11f4fe20249e9d6d8b04c7 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 16 Jun 2017 04:05:04 -0400 Subject: [PATCH 148/201] add reventlog cases in hdctrl_general.bundle --- xCAT-test/autotest/bundle/hdctrl_general.bundle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/bundle/hdctrl_general.bundle b/xCAT-test/autotest/bundle/hdctrl_general.bundle index 84ed91f6f..e7020b1d6 100644 --- a/xCAT-test/autotest/bundle/hdctrl_general.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_general.bundle @@ -24,3 +24,7 @@ rvitals_temp rvitals_voltage rvitals_all rvitals_noderange_err +reventlog_null +reventlog_all +reventlog_clear +reventlog_numofentries From ce5ad6f52651b739c83c2cbbb8d2ccaeb4deeeb0 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 16 Jun 2017 04:38:33 -0400 Subject: [PATCH 149/201] Remove the commented out lines to not have the reviewer confusing --- xCAT-genesis-builder/buildrpm | 24 ------------------------ xCAT-genesis-builder/install | 4 ---- 2 files changed, 28 deletions(-) diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index 25a37c743..28f3985aa 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -135,30 +135,6 @@ if [ "$HOSTOS" = "mcp" ]; then elif [ $BUILDARCH = "ppc64" ]; then sed -i 's/ efibootmgr//' $DRACUTMODDIR/install sed -i 's/ dmidecode//' $DRACUTMODDIR/install - # Remove the libraries with special version number, starting from Fedora 26 Alpha ppc64 - # ========================================================== - #sed -i 's/\/lib\/libncurses.so.5.7/\/lib64\/libncurses.so.5.7/' $DRACUTMODDIR/install - #sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.13/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/libgcc_s.so.1/\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.7/' $DRACUTMODDIR/install - # following changes are required on Fedora 20 ppc64 - # sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install - # following changes are required on Fedora 26 Alpha ppc64 - #sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.25.so/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/libc.so.6/\/lib64\/libc.so.6/' $DRACUTMODDIR/install - # following changes are required on Fedora 23 ppc64 - #sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.18.so/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.25.so/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/libdl.so.2/\/lib64\/libdl.so.2/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/libm.so.6/\/lib64\/libm.so.6/' $DRACUTMODDIR/install - #sed -i 's/\/lib\/libpthread.so.0/\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install - #sed -i 's/\/lib64\/libncurses.so.5.7/\/lib64\/libncurses.so.6.0/' $DRACUTMODDIR/install - #sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.19/' $DRACUTMODDIR/install - #sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.23/' $DRACUTMODDIR/install - #sed -i 's/\/lib64\/libtinfo.so.5.7/\/lib64\/libtinfo.so.6.0/' $DRACUTMODDIR/install - #sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install - #sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install - # ========================================================== sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install fi diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 36ee6207b..e5dfbe0f0 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -11,10 +11,6 @@ dracut_install poweroff ntpq ntpd ntp-wait hwclock date /usr/share/terminfo/x/xt dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc dracut_install chmod /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install efibootmgr lldptool dmidecode #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si -#dracut_install dmidecode /usr/lib64/libstdc++.so.5 #broadcom firmware update links against old lib -#dracut_install /lib/libpthread.so.0 #32 bit lib because UXSPI will not ship a native 64 bit build -#dracut_install /lib/libncurses.so.5.7 /usr/lib/libstdc++.so.6.0.13 /lib/libgcc_s.so.1 /lib/libtinfo.so.5.7 -#dracut_install /lib64/libldap-2.4.so.2 /lib64/liblber-2.4.so.2 /usr/lib64/libsasl2.so.2 #uxspi has incurred these... dracut_install /usr/share/zoneinfo/posix/Zulu dracut_install /usr/share/zoneinfo/posix/GMT-0 dracut_install /usr/share/zoneinfo/posix/Europe/Istanbul From 5331626d9a6dc87bdbc6b1f8b2abb4f5c6959392 Mon Sep 17 00:00:00 2001 From: chenglch Date: Fri, 16 Jun 2017 16:51:05 +0800 Subject: [PATCH 150/201] Upgrade conserver to 8.2.1 version (#3252) This patch change the `sslauthority` to `sslcacertificatefile` to support the latest version of conserver. It also add scripts to update the `conserver.cf` and $HOME/.consolerc to make sure migration works correctly. implement: #3239 --- perl-xCAT/xCAT/Utils.pm | 63 +++++++++++++++++++++++ xCAT-client/bin/rcons | 20 +++++-- xCAT-server/lib/xcat/plugins/conserver.pm | 11 +++- xCAT-server/sbin/xcatconfig | 46 +++++++++++++++++ 4 files changed, 136 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 06b08ae68..1dde56d16 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -579,6 +579,69 @@ sub Version return $version; } +#------------------------------------------------------------------------------- + +=head3 get_conserver_version + Returns: + consever version number like 8.1.16, undef if error happens + Globals: + none + Error: + none + Example: + $version=xCAT::Utils->get_conserver_version(); + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub get_conserver_version +{ + my $cmd = "/usr/sbin/conserver -V"; + # output format: + # conserver: conserver.com version 8.2.1 + # conserver: default access type `r' + my @out = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0 || @out < 1) { + return undef; + } + my @parts = split(' ',$out[0]); + if (@parts < 4) { + return undef; + } + my @count = $parts[3] =~ /\./g; + if (@count < 2) { + return undef; + } + return $parts[3]; +} + +#------------------------------------------------------------------------------- + +=head3 calc_conserver_version + Arguments: + version in string format + Returns: + version number + Globals: + none + Error: + none + Example: + $version=xCAT::Utils->calc_conserver_version("8.2.1"); + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub calc_conserver_version +{ + my $ver_str = shift; + my @vers = split(/\./, $ver_str); + return ord($vers[2]) + ord($vers[1]) * 10000 + ord($vers[0]) * 100000000; +} + + #------------------------------------------------------------------------------- =head3 make_node_list_file diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 2fa148d6a..65d8d8000 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -127,12 +127,22 @@ elif [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then #NOTE: IPv6 is not good with the below if going by IP, needs more sophisticated #parsing CONSERVER=`echo $CONSERVER|cut -d: -f 1` - + CONSOLE_VER=`console -V | awk '/conserver.com version/ {print $4}'` #Detect console support of SSL, only fixup consolerc if encryption is detected if ! console -h 2>&1 | grep "encryption not compiled" > /dev/null; then # generate .consolerc if it does not exist or is empty if [ ! -s $HOME/.consolerc ]; then - cat > $HOME/.consolerc << EOF + if [ "$CONSOLE_VER" != "8.1.16" ]; then + cat > $HOME/.consolerc << EOF +config * { + port 782; + sslenabled yes; + sslcacertificatefile $HOME/.xcat/ca.pem; + sslcredentials $HOME/.xcat/client-cred.pem; +} +EOF + else + cat > $HOME/.consolerc << EOF config * { port 782; sslenabled yes; @@ -140,6 +150,7 @@ config * { sslcredentials $HOME/.xcat/client-cred.pem; } EOF + fi fi else # ssl is not enabled, comment out the ssl settings in .consolerc @@ -147,7 +158,10 @@ EOF sed -i 's/\Wssl/#ssl/1' $HOME/.consolerc fi fi - + # for migration, upgrade conserver + if [ "$CONSOLE_VER" != "8.1.16" ]; then + sed -i 's/sslauthority/sslcacertificatefile/1' $HOME/.consolerc + fi exec console $FORCE -M $CONSERVER $1 else if [[ "$FORCE" == "-s" ]]; then diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 24336d186..11c3f9b90 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -207,7 +207,16 @@ sub docfheaders { { push @newheaders, "config * {\n"; push @newheaders, " sslrequired yes;\n"; - push @newheaders, " sslauthority /etc/xcat/cert/ca.pem;\n"; + my $version = xCAT::Utils::get_conserver_version(); + if (!$version) { + xCAT::SvrUtils::sendmsg([ 1, "Failed to get conserver version" ], $cb); + return; + } + if (xCAT::Utils::calc_conserver_version($version) < xCAT::Utils::calc_conserver_version("8.1.19")) { + push @newheaders, " sslauthority /etc/xcat/cert/ca.pem;\n"; + } else { + push @newheaders, " sslcacertificatefile /etc/xcat/cert/ca.pem;\n"; + } push @newheaders, " sslcredentials /etc/xcat/cert/server-cred.pem;\n"; push @newheaders, "}\n"; } diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 4327ff09d..51a3f1469 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -464,6 +464,10 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL || $::genCredentials) } +if ($::UPDATEINSTALL) { + upgrade_conserver(); +} + # more config needed after xcatd start if ($::INITIALINSTALL || $::FORCE) { @@ -2338,3 +2342,45 @@ sub startnamedonboot } } } + +#----------------------------------------------------------------------------- + +=head3 upgrade_conserver + + Update conserver configuration files while upgrading xcat + +=cut + +#----------------------------------------------------------------------------- +sub upgrade_conserver +{ + my $version = xCAT::Utils::get_conserver_version(); + if (!$version) { + return; + } + if (xCAT::Utils::calc_conserver_version($version) < xCAT::Utils::calc_conserver_version("8.1.19")) { + return; + } + my $cmd = "/bin/cat /etc/conserver.cf | grep sslauthority"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + return; + } + $cmd = "sed -i 's/sslauthority/sslcacertificatefile/1' /etc/conserver.cf"; + xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) { + return; + } + #restart conserver daemon + if (xCAT::Utils->isAIX()) { + $cmd = "stopsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "startsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + } else { + $cmd = "/etc/init.d/conserver stop"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "/etc/init.d/conserver start"; + xCAT::Utils->runcmd($cmd, 0); + } +} From 9de8c1aad1819c41c1e5344224bfe71665bdf031 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Jun 2017 10:49:29 -0400 Subject: [PATCH 151/201] For serial and model options, only return the system level information --- xCAT-server/lib/xcat/plugins/openbmc.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 45a9395e2..906751c1f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -967,6 +967,13 @@ sub rinv_response { next; } + # SPECIAL CASE: If 'serial' or 'model' is specified, only return the system level information + if ($grep_string eq "serial" or $grep_string eq "model") { + if ($key_url ne "$openbmc_project_url/inventory/system") { + next; + } + } + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { $src = "$1 $2"; } else { From 7beacaa631a3e6efa7af960194f9652bb3c68f68 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Jun 2017 11:04:10 -0400 Subject: [PATCH 152/201] With mid June/2017 firmware, model number is moved from PartNumber -> Model --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index f78cbb687..9fe214b77 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1074,8 +1074,8 @@ sub bmcdiscovery_openbmc{ my $serial; if (defined($response->{data})) { - if (defined($response->{data}->{PartNumber}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{PartNumber}; + if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{Model}; $serial = $response->{data}->{SerialNumber}; } else { xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); From beb7d5af12304226dbe5cd518202e1b6239a745f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 16 Jun 2017 14:40:11 -0400 Subject: [PATCH 153/201] Check for update file existance and eliminate few lines --- xCAT-server/lib/xcat/plugins/openbmc.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 618e96200..3128b3f21 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -687,6 +687,11 @@ sub parse_command_status { # Filename ending on .tar was specified $filename = $update_file; $::UPLOAD_FILE = $update_file; # Save filename to upload + # Verify file exists and is readable + unless (-r $filename) { + xCAT::SvrUtils::sendmsg("Error accessing update file $filename", $callback); + return 1; + } if ($check_version) { # Display firmware version of the specified .tar file my $firmware_version_in_file = `$grep_cmd $version_tag $filename`; @@ -1452,16 +1457,14 @@ sub rflash_response { # If that happens, just call the curl commands for now. # TODO remove this block when proper request can be generated if ($::UPLOAD_FILE) { - my $request_url_login = "$http_protocol://" . $node_info{$node}{bmc} . "/login"; - my $request_url_logout = "$http_protocol://" . $node_info{$node}{bmc} . "/logout"; - my $request_url_upload = "$http_protocol://" . $node_info{$node}{bmc} . "/upload/image/"; + my $request_url = "$http_protocol://" . $node_info{$node}{bmc}; my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; my $content_logout = '{ "data": [ ] }'; # curl commands - my $curl_login_cmd = "curl -c cjar -k -H 'Content-Type: application/json' -X POST $request_url_login -d '" . $content_login . "'"; - my $curl_logout_cmd = "curl -b cjar -k -H 'Content-Type: application/json' -X POST $request_url_logout -d '" . $content_logout . "'"; - my $curl_upload_cmd = "curl -b cjar -k -H 'Content-Type: application/octet-stream' -X PUT -T $::UPLOAD_FILE $request_url_upload"; + my $curl_login_cmd = "curl -c cjar -k -H 'Content-Type: application/json' -X POST $request_url/login -d '" . $content_login . "'"; + my $curl_logout_cmd = "curl -b cjar -k -H 'Content-Type: application/json' -X POST $request_url/logout -d '" . $content_logout . "'"; + my $curl_upload_cmd = "curl -b cjar -k -H 'Content-Type: application/octet-stream' -X PUT -T $::UPLOAD_FILE $request_url/upload/image/"; # Try to login my $curl_login_result = `$curl_login_cmd`; From 0a3104a981aaac7e0896dc89f4ad7e1471a02e87 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 16 Jun 2017 15:21:27 -0400 Subject: [PATCH 154/201] check community string in the switches table --- xCAT-server/share/xcat/scripts/configBNT | 27 +++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configBNT b/xCAT-server/share/xcat/scripts/configBNT index 3b31b975b..c58c1c1f9 100755 --- a/xCAT-server/share/xcat/scripts/configBNT +++ b/xCAT-server/share/xcat/scripts/configBNT @@ -72,6 +72,12 @@ my $switchhash; my $passwdtab; my @passwd_ent; +#set community string for switch +my $community = "public"; +my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); +my $tmp = $snmpcs[0]; +if (defined($tmp)) { $community = $tmp } + if ($::SWITCH) { my @filternodes = xCAT::NodeRange::noderange( $::SWITCH ); if (nodesmissed) { @@ -80,7 +86,7 @@ if ($::SWITCH) { } # check switch attributes $switchestab = xCAT::Table->new('switches'); - $switchhash = $switchestab->getNodesAttribs(\@filternodes,['switchtype','sshusername','sshpassword','protocol']); + $switchhash = $switchestab->getNodesAttribs(\@filternodes,['switchtype','sshusername','sshpassword','protocol','password','snmpversion']); # get switch username and password from passwd $passwdtab = xCAT::Table->new('passwd'); @@ -98,6 +104,9 @@ if ($::SWITCH) { $switchhash->{$fsw}->[0]->{sshpassword} = $passwd_ent[0]->{password}; } } + if (!defined($switchhash->{$fsw}->[0]->{password})) { + $switchhash->{$fsw}->[0]->{password} = $community; + } push @nodes, $fsw; } else { xCAT::MsgUtils->message("E","The $fsw is not BNT switch, will not config"); @@ -117,12 +126,6 @@ if ($::SWITCH) { my $mactab = xCAT::Table->new("mac"); my $machash = $mactab->getNodesAttribs(\@nodes,['mac']); -#set community string for switch -my $community = "public"; -my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); -my $tmp = $snmpcs[0]; -if (defined($tmp)) { $community = $tmp } - my $switches = join(",",@nodes); my $cmd; my $vlan; @@ -330,12 +333,20 @@ sub config_snmp { my $username; my $passwd; my $protocol; + my $snmppass; + my $snmpversion; my $login_cmd; $username = $switchhash->{$switch}->[0]->{sshusername}; $passwd = $switchhash->{$switch}->[0]->{sshpassword}; $protocol = $switchhash->{$switch}->[0]->{protocol}; + if ($switchhash->{$switch}->[0]->{snmpversion} =~ /3/) { + $snmppass=$community; + } else { + $snmppass = $switchhash->{$switch}->[0]->{password}; + } + if ($protocol =~ /telnet/) { $login_cmd = "telnet $switch\r"; } else { @@ -343,7 +354,7 @@ sub config_snmp { } #get hostname on the switch in case hostname is different - my $ccmd = "snmpwalk -Os -v1 -c $community $switch 1.3.6.1.2.1.1.5"; + my $ccmd = "snmpwalk -Os -v1 -c $snmppass $switch 1.3.6.1.2.1.1.5"; my $result = xCAT::Utils->runcmd($ccmd, 0); my ($desc,$switchhost) = split /: /, $result; if (!$switchhost) { From 978ed4ab6978b1c95acc69789950aad388cab158 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 19 Jun 2017 04:53:46 -0400 Subject: [PATCH 155/201] add missed cases for hardware control commands. Fix bug 3269 --- xCAT-test/autotest/testcase/rinv/cases2 | 26 ++++++++++++ xCAT-test/autotest/testcase/rpower/cases0 | 49 ++++++++++++++--------- 2 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 xCAT-test/autotest/testcase/rinv/cases2 diff --git a/xCAT-test/autotest/testcase/rinv/cases2 b/xCAT-test/autotest/testcase/rinv/cases2 new file mode 100644 index 000000000..0588d179c --- /dev/null +++ b/xCAT-test/autotest/testcase/rinv/cases2 @@ -0,0 +1,26 @@ +start:rinv_mprom +hcp:ipmi +arch:x86_64 +cmd:rinv $$CN mprom +check:rc==0 +check:output=~BMC Firmware:\s*\w+.\w+ +end + +start:rinv_guid +hcp:ipmi +arch:x86_64 +cmd:rinv $$CN guid +check:rc==0 +check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ +end + +start:rinv_dimm +hcp:ipmi +arch:x86_64 +cmd:rinv $$CN dimm +check:rc==0 +check:output=~DIMM 1 :\s*\w+ +check:output=~DIMM 1 Manufacture Date:\s*\w+ +check:output=~DIMM 1 Manufacture Location:\s*\d+ +check:output=~DIMM 1 Model:\s*\w+-\w+ +end diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index c8ab300c9..23b0d1905 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -1,6 +1,4 @@ start:rpower_off -description:This case is to test off option could remote power off nodes -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done check:ouptut=~Running|on @@ -12,8 +10,6 @@ check:output=~Not Activated|off end start:rpower_stat -description:This case is to test stat option could show the power status of nodes -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -33,8 +29,6 @@ check:output=~Not Activated|off end start:rpower_boot -description:This case is to test boot option could power on the nodes if nodes in off state. Or could hard reset the nodes if they are on. -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -47,8 +41,7 @@ check:output=~Running|on end start:rpower_status -description:This case is to test status option could show the power status of nodes -Attribute: $$CN-The operation object of rpower command +description:checkout rpower node status could get node's stauts cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN status|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN status @@ -61,8 +54,7 @@ check:output=~Running|on end start:rpower_state -description:This case is to test state option could show the power status of nodes -Attribute: $$CN-The operation object of rpower command +description:checkout rpower node status could get node's stauts cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN state|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN state @@ -75,8 +67,6 @@ check:output=~Running|on end start:rpower_on -description:This case is to test on option could remote power on nodes -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -89,8 +79,6 @@ check:output=~Running|on end start:rpower_reset -description:This case is to test reset option could hard reset nodes when nodes are in on state. -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -103,25 +91,46 @@ check:output=~Running|on end start:rpower_noderange -description:This case is to test rpower could process error usage and return help information. -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN check:rc!=0 check:output=~Unsupported|Usage end start:rpower_noderange_nodeps -description:This case is to test rpower could process error usage and return help information. -Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN --nodeps check:rc!=0 check:output=~Unsupported|Usage end start:rpower_err_noderange -description:This case is to test rpower could process error usage and return help information. -Attribute:N/A cmd:rpower testnode stat check:rc!=0 check:output=~Error end + +start:rpower_softoff +description:This case is to test softoff option could remote shutdown nodes +Attribute: $$CN-The operation object of rpower command +cmd:rpower $$CN on +cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +check:ouptut=~Running|on +cmd:rpower $$CN softoff +check:rc==0 +cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$CN stat +check:output=~Not Activated|off +end + +start:rpower_onstandby +description:This case is to test onstandby option could bring server to standby state +Attribute: $$CN-The operation object of rpower command +arch:ppc64 +cmd:rpower $$CN off +check:rc==0 +cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$CN stat +check:output=~Not Activated|off +cmd:rpower $$CN onstandby +cmd:a=0;while ! `rpower $$CN stat|grep "standby\|Standby" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +check:ouptut=~standby|Standby +end From d445a91c7405b0e3ee997b31ae6f96fbd1c391f5 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 19 Jun 2017 05:03:20 -0400 Subject: [PATCH 156/201] update the description --- xCAT-test/autotest/testcase/rinv/cases2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-test/autotest/testcase/rinv/cases2 b/xCAT-test/autotest/testcase/rinv/cases2 index 0588d179c..388ae6ce5 100644 --- a/xCAT-test/autotest/testcase/rinv/cases2 +++ b/xCAT-test/autotest/testcase/rinv/cases2 @@ -1,4 +1,5 @@ start:rinv_mprom +description:this case is to test mprom option for rinv on x86_64 servers. hcp:ipmi arch:x86_64 cmd:rinv $$CN mprom @@ -7,6 +8,7 @@ check:output=~BMC Firmware:\s*\w+.\w+ end start:rinv_guid +description:this case is to test guid option for rinv on x86_64 servers. hcp:ipmi arch:x86_64 cmd:rinv $$CN guid @@ -15,6 +17,7 @@ check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ end start:rinv_dimm +description:this case is to test dimm option for rinv on x86_64 servers. hcp:ipmi arch:x86_64 cmd:rinv $$CN dimm From df1a5aeb522c0297a8c47a17b1caa6934b73904b Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 19 Jun 2017 10:32:30 -0400 Subject: [PATCH 157/201] Change to only display the active firmware instead of any firmware that is listed and add in the software id into the output so that sorting would keep the various software information together. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 30 +++++++++++++++---------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 64bfbb99c..9bbed2852 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1036,25 +1036,31 @@ sub rinv_response { # Handle printing out all posssible Software values in a generic format: # node: Software: () # + my $sw_id = (split(/\//, $key_url))[-1]; if (defined($content{Version}) and $content{Version}) { my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; # - # The space below between "SOFTWARE:" and $content{Version} is intentional - # to cause the sorting of this line before any additional info lines + # For 'rinv firm', only print Active software. 'rflash list' will handle others # - $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; - push (@sorted_output, $content_info); - - if ($content{ExtendedVersion} ne "") { - # ExtendedVersion is going to be a comma separated list of additional software - my @versions = split(',', $content{ExtendedVersion}); - foreach my $ver (@versions) { - $content_info = "$purpose_value SOFTWARE: -- additional info: $ver"; - push (@sorted_output, $content_info); + if ($activation_value =~ "Active") { + # + # The space below between "SOFTWARE:" and $content{Version} is intentional + # to cause the sorting of this line before any additional info lines + # + $content_info = "$purpose_value SOFTWARE[$sw_id]: $content{Version} ($activation_value)"; + push (@sorted_output, $content_info); + + if (defined($content{ExtendedVersion}) and $content{ExtendedVersion} ne "") { + # ExtendedVersion is going to be a comma separated list of additional software + my @versions = split(',', $content{ExtendedVersion}); + foreach my $ver (@versions) { + $content_info = "$purpose_value SOFTWARE[$sw_id]: -- additional info: $ver"; + push (@sorted_output, $content_info); + } } + next; } - next; } } else { if (! defined $content{Present}) { From cbf7c3b00749acf3ddfc525ede5c1025a6531e41 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 19 Jun 2017 10:52:20 -0400 Subject: [PATCH 158/201] update the doc for steps on checking packages that changed in xcat-dep --- docs/source/guides/install-guides/yum/update_xcat.rst | 4 ++-- docs/source/guides/install-guides/zypper/update_xcat.rst | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/source/guides/install-guides/yum/update_xcat.rst b/docs/source/guides/install-guides/yum/update_xcat.rst index fc01d99ad..fbbbe4762 100644 --- a/docs/source/guides/install-guides/yum/update_xcat.rst +++ b/docs/source/guides/install-guides/yum/update_xcat.rst @@ -6,5 +6,5 @@ If at a later date you want to update xCAT, first, update the software repositor yum clean metadata # or, yum clean all yum update '*xCAT*' - - + # To check and update the packages provided by xcat-dep: + yum update '*xcat*' diff --git a/docs/source/guides/install-guides/zypper/update_xcat.rst b/docs/source/guides/install-guides/zypper/update_xcat.rst index c18bb5b3c..3da2a2bb2 100644 --- a/docs/source/guides/install-guides/zypper/update_xcat.rst +++ b/docs/source/guides/install-guides/zypper/update_xcat.rst @@ -6,4 +6,5 @@ If at a later date you want to update xCAT, first, update the software repositor zypper refresh zypper update "*xCAT*" - + # To check and update the packages provided by xcat-dep: + zypper update "*xcat*" From 4cdad73b8f2d710f537660f38d754a8d50d79cbc Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 19 Jun 2017 10:59:53 -0400 Subject: [PATCH 159/201] Better error message for missing file --- 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 3128b3f21..284f9d4a5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -689,7 +689,7 @@ sub parse_command_status { $::UPLOAD_FILE = $update_file; # Save filename to upload # Verify file exists and is readable unless (-r $filename) { - xCAT::SvrUtils::sendmsg("Error accessing update file $filename", $callback); + xCAT::SvrUtils::sendmsg([1,"Cannot access $filename"], $callback); return 1; } if ($check_version) { From e5e93255071556d6fe828dfed82efdd5ee082f83 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 19 Jun 2017 14:59:25 -0400 Subject: [PATCH 160/201] Change the dhcpinterface documentation to avoid confusion about xcatmn --- .../manage_clusters/ppc64le/configure/networks.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst index 3bacd82b5..7d10ecd29 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst @@ -45,6 +45,10 @@ Configure DHCP to listen on different network interfaces [**Optional**] To set "eth1" and "eth3" on the management node and "bond0" on all nodes in the nodegroup="service", set ``dhcpinterfaces`` using: :: + chdef -t site dhcpinterfaces="eth1,eth3;service|bond0" + + or, to explicitly identify the management node with hostname ``xcatmn``: :: + chdef -t site dhcpinterfaces="xcatmn|eth1,eth3;service|bond0" **noboot** From a6696f7fde0e4243f07911842082c0f957767fe6 Mon Sep 17 00:00:00 2001 From: chenglch Date: Tue, 20 Jun 2017 10:12:54 +0800 Subject: [PATCH 161/201] Fix the calculation error for conserver version number This patch fix the error while calculating the version number. Use int instead of ord to convert string to integer. fix-issue: #3286 --- perl-xCAT/xCAT/Utils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 1dde56d16..ea107f482 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -638,7 +638,7 @@ sub calc_conserver_version { my $ver_str = shift; my @vers = split(/\./, $ver_str); - return ord($vers[2]) + ord($vers[1]) * 10000 + ord($vers[0]) * 100000000; + return int($vers[2]) + int($vers[1]) * 10000 + int($vers[0]) * 100000000; } From 74942a8f20763e139a13a746ed135407ad288b5a Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 19 Jun 2017 22:23:40 -0400 Subject: [PATCH 162/201] update for an error checkin --- xCAT-test/autotest/testcase/rpower/cases0 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 23b0d1905..09f619fe0 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -1,4 +1,6 @@ start:rpower_off +description:This case is to test off option could remote power off nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done check:ouptut=~Running|on @@ -10,6 +12,8 @@ check:output=~Not Activated|off end start:rpower_stat +description:This case is to test stat option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -29,6 +33,8 @@ check:output=~Not Activated|off end start:rpower_boot +description:This case is to test boot option could power on the nodes if nodes in off state. Or could hard reset the nodes if they are on. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -41,7 +47,8 @@ check:output=~Running|on end start:rpower_status -description:checkout rpower node status could get node's stauts +description:This case is to test status option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN status|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN status @@ -54,7 +61,8 @@ check:output=~Running|on end start:rpower_state -description:checkout rpower node status could get node's stauts +description:This case is to test state option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN state|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN state @@ -67,6 +75,8 @@ check:output=~Running|on end start:rpower_on +description:This case is to test on option could remote power on nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -79,6 +89,8 @@ check:output=~Running|on end start:rpower_reset +description:This case is to test reset option could hard reset nodes when nodes are in on state. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -91,18 +103,24 @@ check:output=~Running|on end start:rpower_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN check:rc!=0 check:output=~Unsupported|Usage end start:rpower_noderange_nodeps +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN --nodeps check:rc!=0 check:output=~Unsupported|Usage end start:rpower_err_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute:N/A cmd:rpower testnode stat check:rc!=0 check:output=~Error From 32060a54cc2a58b63bcb48c9e4d880fe134bfbc2 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 19 Jun 2017 23:23:00 -0400 Subject: [PATCH 163/201] update rpower cases for hdctrl_ppc_hmc.bundle and rinv cases for hdctrl_bmc.bundle --- xCAT-test/autotest/bundle/hdctrl_bmc.bundle | 3 +++ xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle | 2 ++ 2 files changed, 5 insertions(+) diff --git a/xCAT-test/autotest/bundle/hdctrl_bmc.bundle b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle index b75dc41ce..e8fcfd2fa 100644 --- a/xCAT-test/autotest/bundle/hdctrl_bmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle @@ -1,5 +1,8 @@ description:the cases in this bundle is to used to verify xCAT hardware control funtions on BMC managed servers. #INCLUDE:hdctrl_general.bundle# +rinv_mprom +rinv_guid +rinv_dimm rvitals_wattage rvitals_fanspeed rvitals_power diff --git a/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle index 2cf057542..51a886de1 100644 --- a/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle @@ -1,5 +1,7 @@ description:the cases in this bundle is to used to verify xCAT hardware control funtions on HMC managed servers. #INCLUDE:hdctrl_general.bundle# +rpower_softoff +rpower_onstandby rinv_bus rinv_config rvitals_lcds From f3ea0a27296b6fbc7d6dc0a2f87a35edd07f9924 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 20 Jun 2017 02:53:12 -0400 Subject: [PATCH 164/201] When start simulator failed, will exit not mkdef nodes --- xCAT-test/autotest/testcase/simulator/config_simulator.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh index 80860227a..fc4013fdd 100755 --- a/xCAT-test/autotest/testcase/simulator/config_simulator.sh +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -47,6 +47,10 @@ if [ $flag = "-s" ]; then rmdef $cnhn /root/openbmc_simulator/simulator -n $nic -r $range + if [ $? != 0 ]; then + echo "Start simulator Failed" + exit 1 + fi node_end=$[nodes-1] chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=$username bmcpassword=$password From 6720675b21440e30d56f7b4e491352f4587c6617 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Tue, 20 Jun 2017 17:08:51 +0800 Subject: [PATCH 165/201] revert to old udevadm code (#3294) --- xCAT-server/share/xcat/install/scripts/getinstdisk | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 311a7294d..fcc517565 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -141,19 +141,8 @@ if [ -z "$install_disk" ]; then disk_wwn=$(echo $output_for_wwn | $utolcmd) output_for_path=$(IFS= ;echo $disk_info | grep DEVPATH | cut -d "=" -f2) disk_path=$(echo $output_for_path | $utolcmd) - - # Work around the issue Pegas running on Power9 installation hang in anaconda - # with "TypeError: argument of type 'NoneType' is not iterable", - # after running of "udevadm info --attribute-walk --name=/dev/sda" in %pre section of kickstart - cpu_model=$(awk '/model/ { print $NF }' /proc/cpuinfo) - p9_bool=$(grep POWER9 /proc/cpuinfo|head -n 1|awk '{print $3}') - anaconda --version >/dev/null 2>&1 - if [ $? -eq 0 ] && [ "$cpu_model" = "0000000000000000" ] && [ "$p9_bool" = "POWER9" ]; then - disk_driver="" - else - disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'| + disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'| \head -n 1| sed -e 's/[^"]*"//' -e 's/"//' | $utolcmd) - fi echo "[get_install_disk]The disk $disk information: " echo "[get_install_disk] disk_wwn=$disk_wwn" From 1340f398e0b28e857516fa93cd4b9f5a4a753079 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 20 Jun 2017 08:50:35 -0400 Subject: [PATCH 166/201] Refine test case: nodeset_cmdline, nodeset_runimage, nodeset_shell --- xCAT-test/autotest/testcase/genesis/cases0 | 9 ++++++--- xCAT-test/autotest/testcase/genesis/genesistest.pl | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index 3b0037e5d..f9fb966ea 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -2,28 +2,31 @@ start:nodeset_shell description: verify could log in genesis shell cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s ;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN; cat /tmp/genesistestlog/*;exit 1;fi +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 +cmd:cat /tmp/genesistestlog/* end start:nodeset_cmdline description:verify could run cmdline successfully cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -d;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN;cat /tmp/genesistestlog/*;exit 1;fi +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -d check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 +cmd:cat /tmp/genesistestlog/* end start:nodeset_runimg description:verify runimg could work cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -i;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN;cat /tmp/genesistestlog/*;exit 1;fi +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -i check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 +cmd:cat /tmp/genesistestlog/* end diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index d75ff6e7b..1c3c20fe6 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -195,7 +195,7 @@ sub rungenesiscmd { } `rinstall $noderange "runcmd=cmdtest,shell"`; if ($?) { - send_msg(0, "rinstall noderange shell failed for runcmd test"); + send_msg(0, "nodeset noderange shell failed for runcmd test"); } return $value; } @@ -257,10 +257,12 @@ sub testxdsh { $checkfile = "/proc/cmdline"; } if (($value == 1) || ($value == 2) || ($value == 3)) { - `xdsh $noderange -t 2 cat $checkfile |grep $checkstring`; + `xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring `; if ($?) { - foreach (1 .. 1500) { - `xdsh $noderange -t 2 cat $checkfile | grep $checkstring`; + foreach (1 .. 10) { + `sleep 300`; + send_msg(1,"try to run xdsh to check the results again"); + `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; last if ($? == 0); } } From d8e2303b050b278b0a11d4639567b64964b0896f Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 20 Jun 2017 09:21:22 -0400 Subject: [PATCH 167/201] Refine test case: nodeset_cmdline, nodeset_runimage, nodeset_shell --- xCAT-test/autotest/testcase/genesis/genesistest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 1c3c20fe6..75d88398f 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -195,7 +195,7 @@ sub rungenesiscmd { } `rinstall $noderange "runcmd=cmdtest,shell"`; if ($?) { - send_msg(0, "nodeset noderange shell failed for runcmd test"); + send_msg(0, "rinstall noderange shell failed for runcmd test"); } return $value; } From 3f43f44c7e44428b10ef071b9637f3558dc66bd9 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 20 Jun 2017 15:58:16 -0400 Subject: [PATCH 168/201] Update code to print a warning message if we get a response error. Currently there is nothing printed back so we can't tell if an error has occurred. Allow for some debug output if XCATBYPASS=1 --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 9fe214b77..f1fb34b32 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -46,6 +46,7 @@ my $bmc_user; my $bmc_pass; my $openbmc_user; my $openbmc_pass; +my $openbmc_port = 2200; #------------------------------------------------------- @@ -584,9 +585,9 @@ sub scan_process { # Set child process default, if not the function runcmd may return error $SIG{CHLD} = 'DEFAULT'; - my $nmap_cmd = "nmap ${$live_ip}[$i] -p 2200 -Pn"; + my $nmap_cmd = "nmap ${$live_ip}[$i] -p $openbmc_port -Pn"; my $nmap_output = xCAT::Utils->runcmd($nmap_cmd, -1); - if ($nmap_output =~ /2200\/tcp (\w+)/) { + if ($nmap_output =~ /$openbmc_port\/tcp (\w+)/) { my $port_stat = $1; if ($port_stat eq "open") { bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command); @@ -1048,6 +1049,7 @@ sub bmcdiscovery_openbmc{ my $request_command = shift; my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); + print "$ip: Detected openbmc, attempting to obtain system information...\n"; my $http_protocol="https"; my $openbmc_project_url = "xyz/openbmc_project"; my $login_endpoint = "login"; @@ -1068,7 +1070,10 @@ sub bmcdiscovery_openbmc{ $url = "$http_protocol://$ip/$openbmc_project_url/$system_endpoint"; my $req = HTTP::Request->new('GET', $url, $header); my $req_output = $brower->request($req); - return if ($req_output->is_error); + if ($req_output->is_error) { + xCAT::MsgUtils->message("W", { data => ["$ip: Could not obtain system information from BMC. Verify firmware levels are up-to-date."] }, $::CALLBACK); + return; + } my $response = decode_json $req_output->content; my $mtm; my $serial; From 0ab98f9273c0095d5a16c2d001192155824be47d Mon Sep 17 00:00:00 2001 From: zet809 Date: Wed, 21 Jun 2017 10:24:05 +0800 Subject: [PATCH 169/201] To replace pull request 3061: use rpm inside chroot to query dracut version (#3293) --- xCAT-server/share/xcat/netboot/sles/genimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 84897d2ed..f3e80aaa8 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -615,7 +615,7 @@ if ((-d "$rootimg_dir/usr/share/dracut") or (-d "$rootimg_dir/usr/lib/dracut")) $dracutmode = 1; # get dracut version - $dracutver = `rpm --root $rootimg_dir -qi dracut | grep Version | awk -F' ' '{print \$3}' `; + $dracutver = `chroot $rootimg_dir rpm -qi dracut | awk '/Version/{print $3}' `; chomp($dracutver); if ($dracutver =~ /^\d\d\d$/) { if ($dracutver >= "033") { From d038c61851d675ce20591470220ccb372d9a1b46 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 21 Jun 2017 05:02:53 -0400 Subject: [PATCH 170/201] Refine test case: nodeset_cmdline, nodeset_runimage, nodeset_shell --- xCAT-test/autotest/testcase/genesis/genesistest.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 75d88398f..f7b376049 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -77,6 +77,7 @@ if ($check_genesis_file) { } my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`; if (!$master) { $master=hostname(); } +chomp($master); print "master is $master\n"; #################################### @@ -260,7 +261,7 @@ sub testxdsh { `xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring `; if ($?) { foreach (1 .. 10) { - `sleep 300`; + sleep 300; send_msg(1,"try to run xdsh to check the results again"); `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; last if ($? == 0); From 5f1a506cfbf497c425f5d452d4aad180d23c4169 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 21 Jun 2017 02:00:28 -0400 Subject: [PATCH 171/201] update rspconfig cases in bundle file hdctrl_openpower_openbmc.bundle --- xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle index a271c5b6a..42e3d05a2 100644 --- a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle @@ -19,3 +19,11 @@ rsetboot_node_invalidnode rsetboot_noderange_net rsetboot_node_invalidaction rsetboot_group_net +rspconfig_ip +rspconfig_ip_invalid +rspconfig_ip_null +rspconfig_netmask +rspconfig_netmask_invalid +rspconfig_gateway +rspconfig_gateway_invalid +rspconfig_node_invalid From e5dd79d55eb169e79f455a75200ee20dcdd0aaf5 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 21 Jun 2017 14:56:38 +0800 Subject: [PATCH 172/201] add nodeset_errorcommand testcase for issue :3175 (#3300) --- xCAT-test/autotest/testcase/nodeset/cases0 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 6972152d3..d43f6ae66 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -196,4 +196,11 @@ cmd:noderm testnode1 cmd:rmdef -t osimage -o "__GETNODEATTR($$CN,os)__-x86_64-install-compute" cmd:cp -f /etc/hosts.xcattestbak /etc/hosts end - +start:nodeset_errorcommand +description:This testcase is to very nodeset osimage errorcommand could give right output +Attribute: $$CN-The operation object of nodeset command +cmd:nodeset $$CN osimage= __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==1 +check:output=~Error: Invalid argument: +check:output=~Usage: nodeset +end From 17faabe04e6a9264dfaf9f911cd358044bd49977 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 21 Jun 2017 03:57:51 -0400 Subject: [PATCH 173/201] fix issue 3289: Changing site table attributes using chdef does not return the correct message --- perl-xCAT/xCAT/DBobjUtils.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 4faa725b8..880160f42 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -780,6 +780,7 @@ sub setobjdefs $montable->commit; $monsettable->commit; + $objhash{$objname}{updated} = 1; next; } #if ($type eq 'monitoring') @@ -870,6 +871,9 @@ sub setobjdefs } } + unless ($ret) { + $objhash{$objname}{updated} = 1; + } $thistable->commit; From dad84e8820990f32af0bd2dea020a3f8c3f1355b Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 21 Jun 2017 04:35:47 -0400 Subject: [PATCH 174/201] update confignetwork cases according to comments --- .../autotest/testcase/confignetwork/cases0 | 82 +++++++++++-------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 46d93588e..76fbce5f3 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -1,5 +1,5 @@ start: confignetwork_s_installnic_diskful -description: this case is to test confignetwork -s could config installnic successfully in diskful provision. +description: this case is to test confignetwork -s could configure installnic successfully in diskful provision. cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 @@ -16,16 +16,12 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:sleep 10 +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:copycds $$ISO check:rc==0 cmd:chdef $$CN postscripts="confignetwork -s" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done @@ -44,7 +40,7 @@ check:rc==0 end start:confignetwork_s_installnic_diskless -description: this case is to test confignetwork -s could config installnic successfully in diskless provision. +description: this case is to test confignetwork -s could configure installnic successfully in diskless provision. cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:chdef -t node -o $$CN postbootscripts="confignetwork -s" @@ -74,7 +70,7 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:sleep 900 +cmd:sleep 180 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -86,7 +82,7 @@ cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{pr check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output!~dhcp -cmd:chdef -m -t node $$CN postscripts="confignetwork -s" +cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" check:rc==0 cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi end @@ -126,7 +122,7 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:sleep 900 +cmd:sleep 180 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -142,18 +138,23 @@ cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; check:rc==0 check:output=~100.1.0.100 check:output!~dhcp -cmd:chdef -m -t node $$CN postscripts="confignetwork -s" +cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" check:rc==0 cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi +cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 end start:confignetwork_secondarynic_updatenode -description: this case is to test confignetwork could config secondarynic successfully with updatenode. +description: this case is to test confignetwork could configure secondarynic successfully with updatenode. cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 -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 mtu=1501 +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 "Red Hat" /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 +check:rc==0 +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 mtu=1496 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 check:rc==0 @@ -161,20 +162,28 @@ cmd:chdef -t node -o $$CN postscripts="confignetwork" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -check:output=~MTU=1501 +check:output=~MTU=1496 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 end start: confignetwork_secondarynic_nicaliases_updatenode description: this case is to test confignetwork could config secondarynic nicaliases successfully with updatenode. cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 +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 "Red Hat" /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 +check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak 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 @@ -202,18 +211,26 @@ check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 end start:confignetwork_secondarynic_nicextraparams_updatenode -description: this case is to test confignetwork could config secondarynic nicextraparams successfully with updatenode. +description: this case is to test confignetwork could configure secondarynic nicextraparams successfully with updatenode. cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 +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 "Red Hat" /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 +check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak 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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" check:rc==0 cmd:makehosts $$CN check:rc==0 @@ -227,6 +244,7 @@ check:output=~11.1.0.100 check:output!~dhcp cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 +check:output=~CONNECTED_MODE=yes check:output!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 @@ -235,6 +253,10 @@ check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 end start:confignetwork_secondarynic_nicnetworks_updatenode_false @@ -312,8 +334,6 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 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:chtab node=$$CN nics.disable=0 -check:rc==0 end start:confignetwork_disable_set_to_1 @@ -336,8 +356,6 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 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:chtab node=$$CN nics.disable=0 -check:rc==0 end start:confignetwork_niccustomscripts @@ -350,7 +368,7 @@ cmd:chmod a+x /tmp/script1 check:rc==0 cmd:cp /tmp/script1 /install/postscripts check:rc==0 -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 mut=1501 +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 mut=1496 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 niccustomscripts.$$SECONDNIC=script1 check:rc==0 @@ -360,7 +378,7 @@ cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -check:output=~MTU=1501 +check:output=~MTU=1496 check:output!~dhcp cmd:xdsh $$CN "cat /tmp/confignetwork_niccustomscript" check:rc==0 @@ -378,6 +396,10 @@ start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode description:this case is to verify if confignetwork could config serveral nics' multiple value at the same time. cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 +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 "Red Hat" /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 +check:rc==0 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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -426,6 +448,10 @@ check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 end start:confignetwork_help @@ -436,11 +462,3 @@ check:rc==0 cmd:confignetworks --help check:rc==0 #TODO help information is printed -end - - - - - - - From 1531f136c83c34a0a97c5bdcb6bfd8cc85f7105b Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 21 Jun 2017 05:36:44 -0400 Subject: [PATCH 175/201] update confignetwork cases according to comments --- xCAT-test/autotest/testcase/confignetwork/cases0 | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 76fbce5f3..1b36ff610 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -158,8 +158,6 @@ cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtif 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 check:rc==0 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -267,8 +265,6 @@ cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtif check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC= check:rc==0 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 #TODO check the error message @@ -285,8 +281,6 @@ cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtif check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 check:rc==0 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 #TODO check the error message @@ -303,8 +297,6 @@ cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtif check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 check:rc==0 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 #TODO check the error message @@ -324,8 +316,6 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:chtab node=$$CN nics.disable=yes check:rc==0 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -346,8 +336,6 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:chtab node=$$CN nics.disable=1 check:rc==0 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -372,8 +360,6 @@ cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtif 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 niccustomscripts.$$SECONDNIC=script1 check:rc==0 -cmd:chdef -t node -o $$CN postscripts=confignetwork -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -421,8 +407,6 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 check:output=~$$CN-$$THIRDNIC-1 check:output=~$$CN-$$THIRDNIC-2 -cmd:chdef -t node -o $$CN postscripts="confignetwork" -check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi From b8c402c86a23ce0203bcc8da8712f89ebd4eb305 Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 21 Jun 2017 04:45:23 -0500 Subject: [PATCH 176/201] Revert "add GPGSIGN =0 option to skip repo sign in ubuntu build script" (#3303) --- build-ubunturepo | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 42625d895..6e01caab8 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -22,8 +22,6 @@ # When you are ready to release this build, use PROMOTE=1 without PREGA # BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in # prep for a release. -# GPGSIGN=0 - Do not sign the repo in the end of the build. The repo will be signed by default -# # LOG= - provide an LOG file option to redirect some output into log file # # For the dependency packages 1. All the xcat dependency deb packages should be uploaded to @@ -127,20 +125,16 @@ if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" fi -if [ "$GPGSIGN" = "0" ];then - echo "GPGSIGN=$GPGSIGN specified, skip gnupg key downloading" -else - #sync the gpg key to the build machine local - gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux - mkdir -p $HOME/.gnupg - for key_name in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then - rm -f $HOME/.gnupg/$key_name - ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name - chmod 600 $HOME/.gnupg/$key_name - fi - done -fi +#sync the gpg key to the build machine local +gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux +mkdir -p $HOME/.gnupg +for key_name in pubring.gpg secring.gpg trustdb.gpg; do + if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then + rm -f $HOME/.gnupg/$key_name + ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name + chmod 600 $HOME/.gnupg/$key_name + fi +done if [ "$c_flag" ] then @@ -329,14 +323,9 @@ Codename: $dist Architectures: $tmp_out_arch Components: main Description: Repository automatically genereted conf +SignWith: yes __EOF__ - - if [ "$GPGSIGN" = "0" ];then - echo "GPGSIGN=$GPGSIGN specified, the repo will not be signed" - else - echo "SignWith: yes" >> conf/distributions - fi done cat << __EOF__ > conf/options @@ -455,16 +444,11 @@ Codename: $dist Architectures: $tmp_out_arch Components: main Description: Repository automatically genereted conf +SignWith: yes __EOF__ done - if [ "$GPGSIGN" = "0" ];then - echo "GPGSIGN=$GPGSIGN specified, the repo will not be signed" - else - echo "SignWith: yes" >> conf/distributions - fi - cat << __EOF__ > conf/options verbose ask-passphrase From 3c75e9cfae2ce5f868593743fa5079943f0893e1 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Jun 2017 13:23:54 -0400 Subject: [PATCH 177/201] Fix man page and usage for MPA rinv command --- .../admin-guides/references/man1/rinv.1.rst | 19 +++++++++---------- perl-xCAT/xCAT/Usage.pm | 6 ++---- xCAT-client/pods/man1/rinv.1.pod | 16 +++++++--------- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index f7202fae2..214b06e13 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -25,7 +25,7 @@ BMC/MPA specific: ================= -\ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | asset | vpd | deviceid | guid | firm | dimm | mprom | all**\ ] OpenPOWER (IPMI) server specific: @@ -126,12 +126,6 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amou -\ **pci**\ - - Retrieves PCI bus information. - - - \ **bus**\ List all buses for each I/O slot. @@ -140,8 +134,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amou \ **config**\ - Retrieves number of processors, speed, total memory, and DIMM - locations. + Retrieves number of processors, speed, total memory, and DIMM locations. @@ -177,7 +170,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amou \ **asset**\ - Retrieves asset tag. Usually it's the MAC address of eth0. + Retrieves asset tag. Usually it's the MAC address of eth0. @@ -199,6 +192,12 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amou +\ **dimm**\ + + Retrieves dual in-line memory module information. + + + \ **deviceid**\ Retrieves device identification. Usually device, manufacturing and product IDs. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index a2c1c5864..b733daca9 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -95,14 +95,12 @@ my %usage = ( Common: rinv [all|model|serial] [-V|--verbose] rinv [-h|--help|-v|--version] - BMC specific: - rinv [mprom|deviceid|uuid|guid|vpd|dimm|all] + BMC/MPA specific: + rinv [model|serial|asset|vpd|deviceid|guid|firm|dimm|mprom|all] OpenPOWER (IPMI) server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] OpenPOWER (OpenBMC) server specific: rinv [model|serial|firm|cpu|dimm|all] - MPA specific: - rinv [firm|bios|diag|mprom|sprom|mparom|mac|mtm] PPC specific(with HMC): rinv [all|bus|config|serial|model|firm] PPC specific(using Direct FSP Management): diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index e6fda9914..090194df1 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -8,7 +8,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] =head2 BMC/MPA specific: -B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B|B] =head2 OpenPOWER (IPMI) server specific: @@ -40,7 +40,6 @@ B I [B<-t>] B I - =head2 zVM specific: B I [B|B] @@ -78,18 +77,13 @@ Calling B for VMware will display the UUID/GUID, number of CPUs, amount of =over 7 -=item B - -Retrieves PCI bus information. - =item B List all buses for each I/O slot. =item B -Retrieves number of processors, speed, total memory, and DIMM -locations. +Retrieves number of processors, speed, total memory, and DIMM locations. =item B @@ -113,7 +107,7 @@ To output the raw information of deconfigured resources for CEC. =item B -Retrieves asset tag. Usually it's the MAC address of eth0. +Retrieves asset tag. Usually it's the MAC address of eth0. =item B @@ -127,6 +121,10 @@ Diagnostics information of firmware. Retrieves mprom firmware level. +=item B + +Retrieves dual in-line memory module information. + =item B Retrieves device identification. Usually device, manufacturing and product IDs. From 0624deb5471245b90241dc28a7e6ce133f4be6a2 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 21 Jun 2017 22:52:01 -0400 Subject: [PATCH 178/201] correct typo in PR#3293 --- xCAT-server/share/xcat/netboot/sles/genimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index f3e80aaa8..0f914415e 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -615,7 +615,7 @@ if ((-d "$rootimg_dir/usr/share/dracut") or (-d "$rootimg_dir/usr/lib/dracut")) $dracutmode = 1; # get dracut version - $dracutver = `chroot $rootimg_dir rpm -qi dracut | awk '/Version/{print $3}' `; + $dracutver = `chroot $rootimg_dir rpm -qi dracut | awk '/Version/{print \$3}' `; chomp($dracutver); if ($dracutver =~ /^\d\d\d$/) { if ($dracutver >= "033") { From d97db29102fd893986f6ec9cbfa96124a10b161e Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 21 Jun 2017 22:59:38 -0400 Subject: [PATCH 179/201] Add a case confignetwork_s_installnic_secondarynic_updatenode --- xCAT-test/autotest/testcase/confignetwork/cases0 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 1b36ff610..cf7a707a3 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -362,20 +362,15 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~11.1.0.100 -check:output=~MTU=1496 -check:output!~dhcp cmd:xdsh $$CN "cat /tmp/confignetwork_niccustomscript" check:rc==0 check:output=~hello cmd:xdsh $$CN "rm -rf /tmp/confignetwork_niccustomscript" check:rc==0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 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:rm -rf /tmp/script1 /install/postscripts/script1 end start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode @@ -440,9 +435,9 @@ end start:confignetwork_help description:this case is to verify if help information is provided -cmd:confignetworks -h +cmd:confignetwork -h check:rc==0 #TODO help information is printed -cmd:confignetworks --help +cmd:confignetwork --help check:rc==0 #TODO help information is printed From dde6ccdde89a472422e38720ac6d77d7fc223ed1 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 21 Jun 2017 23:02:58 -0400 Subject: [PATCH 180/201] update according to comments --- .../autotest/testcase/confignetwork/cases0 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index cf7a707a3..dcdf442f3 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -146,6 +146,38 @@ cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC check:rc==0 end +start:confignetwork_s_installnic_secondarynic_updatenode +description: this case is to test confignetwork -s could configure installnic and secondarynic successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +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 "Red Hat" /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/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi +check:rc==0 +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 mtu=1496 +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 +check:rc==0 +cmd:updatenode $$CN -P "confignetwork -s" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output=~MTU=1496 +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +check:rc==0 +end + start:confignetwork_secondarynic_updatenode description: this case is to test confignetwork could configure secondarynic successfully with updatenode. cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi From b7236100397863768e42216bfdad38360487e820 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 22 Jun 2017 14:03:48 +0800 Subject: [PATCH 181/201] Add test cases for command nodeset for grub2/petitboot/yaboot (#3155) * Add test cases for command nodeset for grub2/petitboot/yaboot * Revise nodeset test cases and add more negative verifications * Revise nodeset test cases by add more verifications with makedhcp and getent * Temporary remove all dhcp lease checking from nodeset test cases, since it is rely on DNS service * Minor tweaks while doing unit tests --- xCAT-test/autotest/testcase/nodeset/cases0 | 167 +++++++++++++++++++-- 1 file changed, 155 insertions(+), 12 deletions(-) diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index d43f6ae66..84546a788 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -27,7 +27,6 @@ cmd:rmdef -t osimage -o "rhels7.5-ppc64-install-compute" cmd:noderm testnode1 end - start:nodeset_check_yaboot_yes os:rhels cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 @@ -173,29 +172,173 @@ check:output=~Warning: testnode1: petitboot might be invalid|testnode1 could not cmd:noderm testnode1 end -start:nodeset_addkcmdline -description: This case is to verify when netboot=xnba, addkcmdline is correctly supported. -cmd:mkdef -t node -o testnode1 arch=x86_64 cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm monserver=10.1.1.1 nameservers=10.1.1.1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 -os=__GETNODEATTR($$CN,os)__ +start:nodeset_xnba +description: Verify when xnba is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/xcat/xnba/nodes/testnode1 /tftpboot/xcat/xnba/nodes/testnode1.elilo +cmd:mkdef -t node -o testnode1 arch=x86_64 cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm profile=compute os=rhels6.99 +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.xcattestbak +cmd:echo "10.1.1.200 testnode1" >> /etc/hosts +check:rc==0 +cmd:chdef testnode1 netboot=xnba addkcmdline=debug +check:rc==0 +cmd:mkdef "rhels6.99-x86_64-install-compute" -u profile=compute provmethod=install osvers=rhels6.99 osarch=x86_64 +cmd:mkdir -p /install/rhels6.99/x86_64/images/pxeboot +cmd:echo blah >/install/rhels6.99/x86_64/images/pxeboot/vmlinuz +cmd:echo blah >/install/rhels6.99/x86_64/images/pxeboot/initrd.img +cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute +check:rc==0 +cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1 +check:rc==0 +cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1.elilo +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= +check:rc==0 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels6.99-x86_64-install-compute" +cmd:rm -rf /install/rhels6.99 +end + +start:nodeset_grub2 +description: Verify when grub2 is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/boot/grub2/{testnode1,grub.cfg-{01-e6-d4-d2-3a-ad-06,0[aA]0101[cC]8}} +cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc profile=compute os=rhels7.99 check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.xcattestbak cmd:echo "10.1.1.200 testnode1" >> /etc/hosts cmd:makedns -n check:rc==0 -cmd:chdef testnode1 netboot=xnba addkcmdline=rd.break=pre-pivot +cmd:chdef testnode1 netboot=grub2 addkcmdline=debug check:rc==0 -cmd: mkdef "__GETNODEATTR($$CN,os)__-x86_64-install-compute" -u profile=compute provmethod=install osvers=__GETNODEATTR($$CN,os)__ +cmd:mkdef "rhels7.99-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels7.99 osarch=ppc64 +cmd:mkdir -p /install/rhels7.99/ppc64/ppc/ppc64 +cmd:echo blah >/install/rhels7.99/ppc64/ppc/ppc64/vmlinuz +cmd:echo blah >/install/rhels7.99/ppc64/ppc/ppc64/initrd.img +cmd:nodeset testnode1 osimage=rhels7.99-ppc64-install-compute check:rc==0 -cmd:nodeset testnode1 osimage=__GETNODEATTR($$CN,os)__-x86_64-install-compute +cmd:grep "debug" /tftpboot/boot/grub2/testnode1 check:rc==0 -cmd:grep "rd.break=pre-pivot" /tftpboot/xcat/xnba/nodes/testnode1 +cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-01-e6-d4-d2-3a-ad-06 check:rc==0 -cmd:grep "rd.break=pre-pivot" /tftpboot/xcat/xnba/nodes/testnode1.elilo +cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-0[aA]0101[cC]8 +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/boot/grub2/testnode1 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:noderm testnode1 -cmd:rmdef -t osimage -o "__GETNODEATTR($$CN,os)__-x86_64-install-compute" cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels7.99-ppc64-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels7.99-ppc64-install-compute" +cmd:rm -rf /install/rhels7.99 end + +start:nodeset_petitboot +description: Verify when petitboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/petitboot/testnode1 +cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99 +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.xcattestbak +cmd:echo "10.1.1.200 testnode1" >> /etc/hosts +cmd:makedns -n +check:rc==0 +cmd:chdef testnode1 netboot=petitboot addkcmdline=debug +check:rc==0 +cmd:mkdef "rhels7.99-ppc64le-install-compute" -u profile=compute provmethod=install osvers=rhels7.99 osarch=ppc64le +cmd:mkdir -p /install/rhels7.99/ppc64le +cmd:mkdir -p /install/rhels7.99/ppc64le/ppc/ppc64le +cmd:echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/vmlinuz +cmd:echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/initrd.img +cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute +check:rc==0 +cmd:grep "debug" /tftpboot/petitboot/testnode1 +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/petitboot/testnode1 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= +check:rc==0 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute" +cmd:rm -rf /install/rhels7.99 +end + +start:nodeset_yaboot +description: Verify when yaboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06 +cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc profile=compute os=rhels6.99 +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.xcattestbak +cmd:echo "10.1.1.200 testnode1" >> /etc/hosts +cmd:makedns -n +check:rc==0 +cmd:chdef testnode1 netboot=yaboot addkcmdline=debug +check:rc==0 +cmd:mkdef "rhels6.99-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels6.99 osarch=ppc64 +cmd:mkdir -p /install/rhels6.99/ppc64/ppc/{chrp,ppc64} +cmd:echo blah >/install/rhels6.99/ppc64/ppc/ppc64/vmlinuz +cmd:echo blah >/install/rhels6.99/ppc64/ppc/ppc64/initrd.img +cmd:echo blah >/install/rhels6.99/ppc64/ppc/chrp/yaboot +cmd:nodeset testnode1 osimage=rhels6.99-ppc64-install-compute +check:rc==0 +cmd:grep "debug" /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06 +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= +check:rc==0 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels6.99-ppc64-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels6.99-ppc64-install-compute" +cmd:rm -rf /install/rhels6.99 +end + start:nodeset_errorcommand description:This testcase is to very nodeset osimage errorcommand could give right output Attribute: $$CN-The operation object of nodeset command From 9f09aacb534ec83215ced7e125570e5a203ba286 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 22 Jun 2017 02:25:33 -0400 Subject: [PATCH 182/201] update installnic files location and MTU --- xCAT-test/autotest/testcase/confignetwork/cases0 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index dcdf442f3..a1ce6239c 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -31,7 +31,7 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output!~dhcp @@ -78,7 +78,7 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output!~dhcp @@ -154,7 +154,7 @@ 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 "Red Hat" /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/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 -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 mtu=1496 +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 check:rc==0 @@ -162,7 +162,6 @@ cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -check:output=~MTU=1496 cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ @@ -194,6 +193,7 @@ cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep MTU /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~MTU=1496 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 @@ -228,10 +228,10 @@ check:output=~aliases1-1 check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 check:output!~dhcp -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 check:output!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 From 736725de210336aa20ea809f976ddc71f8c2e7fd Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 22 Jun 2017 04:52:23 -0400 Subject: [PATCH 183/201] fix 3242 --- xCAT-test/autotest/testcase/confignics/cases0 | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index a730ff864..9f3589d5f 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -149,45 +149,47 @@ start:confignics_config_multiple_port_withnicaliases_multiple_value description:confignics cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 -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 mtu=1501 +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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1|aliases1-2" +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1 aliases1-1-1|aliases1-2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC|-$$SECONDNIC-1" check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="13_1_0_0-255_255_0_0|14_1_0_0-255_255_0_0" nicaliases.$$THIRDNIC="aliases2-1|aliases2-2" +cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="13_1_0_0-255_255_0_0|14_1_0_0-255_255_0_0" nicaliases.$$THIRDNIC="aliases2-1|aliases2-2" nichostnamesuffixes.$$THIRDNIC="-$$THIRDNIC|-$$THIRDNIC-1" check:rc==0 cmd:makehosts $$CN check:rc==0 -#cmd:cat /etc/hosts -#check:output=~aliases1-1 -#check:output=~aliases1-2 -#check:output=~aliases2-1 -#check:output=~aliases2-2 +cmd:cat /etc/hosts +check:output=~aliases1-1 +check:output=~aliases1-2 +check:output=~aliases2-1 +check:output=~aliases2-2 cmd:updatenode $$CN -P confignics check:rc==0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~11.1.0.100 check:output!~dhcp -output=~MTU=1501 -cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi +cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1; fi check:output=~12.1.0.100 check:output!~dhcp cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~13.1.0.100 check:output!~dhcp -output=~MTU=1503 -cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi +cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1; fi check:output=~14.1.0.100 check:output!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 +cmd:ip addr del 11.1.0.100/16 dev $$SECONDNIC +cmd:ip addr del 12.1.0.100/16 dev $$SECONDNIC +cmd:ip addr del 13.1.0.100/16 dev $$THIRDNIC +cmd:ip addr del 14.1.0.100/16 dev $$THIRDNIC cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC:1; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi From 0c74811424a4201447ea9cc7e53e73a57aed8c82 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 22 Jun 2017 05:17:35 -0400 Subject: [PATCH 184/201] polished --- xCAT-test/autotest/testcase/confignics/cases0 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index 9f3589d5f..0765fc90f 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -186,10 +186,6 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 -cmd:ip addr del 11.1.0.100/16 dev $$SECONDNIC -cmd:ip addr del 12.1.0.100/16 dev $$SECONDNIC -cmd:ip addr del 13.1.0.100/16 dev $$THIRDNIC -cmd:ip addr del 14.1.0.100/16 dev $$THIRDNIC cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC:1; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi From 4456b5210558de2963b22627e14e20dfd416d822 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 22 Jun 2017 05:27:02 -0400 Subject: [PATCH 185/201] polished --- xCAT-test/autotest/testcase/confignics/cases0 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index 0765fc90f..c00b7676d 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -149,13 +149,13 @@ start:confignics_config_multiple_port_withnicaliases_multiple_value description:confignics cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 -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 +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:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1 aliases1-1-1|aliases1-2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC|-$$SECONDNIC-1" check:rc==0 @@ -186,6 +186,10 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 13.1.0.100/16 dev $$THIRDNIC" +cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC:1; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi From 6ed46ff77f32042ccb45bc61c058e10f51a6678c Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 22 Jun 2017 05:04:55 -0500 Subject: [PATCH 186/201] support service node pool (#3268) --- xCAT-server/lib/xcat/plugins/dhcp.pm | 6 ++-- xCAT-server/lib/xcat/plugins/grub2.pm | 41 ++++++++++++++++-------- xCAT-server/lib/xcat/plugins/networks.pm | 3 +- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 291a9b370..c30eceffd 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -502,7 +502,7 @@ sub addnode if ($nrhash) { $nrent = $nrhash->{$node}->[0]; - if ($nrent and $nrent->{tftpserver}) + if ($nrent and $nrent->{tftpserver} and $nrent->{tftpserver} ne '') { #check the value of inet_ntoa(inet_aton("")),if the hostname cannot be resolved, #the value of inet_ntoa() will be "undef", which will cause fatal error @@ -531,9 +531,7 @@ sub addnode my $node_server = undef; if ($nrent->{xcatmaster}) { $node_server = $nrent->{xcatmaster}; - } elsif ($nrent->{servicenode}) { - $node_server = $nrent->{servicenode}; - } + } unless ($node_server) { my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($node); unless ($nxtsrvd[0]) { $nxtsrv = $nxtsrvd[1]; } diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 14fa9702a..f6600d22c 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -218,21 +218,36 @@ sub setstate { } elsif (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'xcatmaster'}) { $tftpserver = $nrhash{$node}->[0]->{'xcatmaster'}; } else { - my @master = xCAT::TableUtils->get_site_attribute("master"); - $tftpserver = $master[0]; - } - my $serverip; - if (defined($tftpserverip{$tftpserver})) { - $serverip = $tftpserverip{$tftpserver}; - } else { - $serverip = xCAT::NetworkUtils->getipaddr($tftpserver); - unless ($serverip) { - syslog("local1|err", "xCAT unable to resolve $tftpserver"); - return; - } - $tftpserverip{$tftpserver} = $serverip; + $tftpserver = ""; } + my $serverip; + + if($tftpserver eq ""){ + my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($node); + unless ($nxtsrvd[0]) { + $serverip = $nxtsrvd[1]; + } else { + $callback->({ error => [ $nxtsrvd[1] ], errorcode => [1] }); + return; + } + }else{ + if (defined($tftpserverip{$tftpserver})) { + $serverip = $tftpserverip{$tftpserver}; + } else { + $serverip = xCAT::NetworkUtils->getipaddr($tftpserver); + unless ($serverip) { + syslog("local1|err", "xCAT unable to resolve $tftpserver"); + return; + } + $tftpserverip{$tftpserver} = $serverip; + } + } + + unless($serverip){ + $callback->({ error => ["Unable to determine the tftpserver for $node"], errorcode => [1] }); + return; + } my $grub2protocol = "tftp"; if (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'} && ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) { diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 49f318854..cbbea2188 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -549,6 +549,7 @@ sub donets } } + my $tent=$nethash{$netname}; unless ($tent and $tent->{tftpserver}) { my $netdev = $ent[7]; @@ -577,7 +578,7 @@ sub donets push @{ $rsp->{data} }, " tftpserver=$ipaddr"; } else { if (!$foundmatch) { - $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { tftpserver => $ipaddr }); + $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { tftpserver => "" }); } } last; From eba16f3dd84b5acc1bbc7601482761d009fecc6c Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 22 Jun 2017 20:39:27 -0400 Subject: [PATCH 187/201] Found out that for Witherspoon machines, if the host has not been booted there is no system information returned, so check for the boxelder bmc for a model/serial combination to use --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index f1fb34b32..5fb0f8009 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1054,6 +1054,7 @@ sub bmcdiscovery_openbmc{ my $openbmc_project_url = "xyz/openbmc_project"; my $login_endpoint = "login"; my $system_endpoint = "inventory/system"; + my $motherboard_boxelder_endpoint = "$system_endpoint/chassis/motherboard/boxelder/bmc"; my $node_data = $ip; my $brower = LWP::UserAgent->new( ssl_opts => { SSL_verify_mode => 0x00, verify_hostname => 0 }, ); @@ -1067,12 +1068,19 @@ sub bmcdiscovery_openbmc{ my $login_response = $brower->request($login_request); if ($login_response->is_success) { + # attempt to find the system serial/model $url = "$http_protocol://$ip/$openbmc_project_url/$system_endpoint"; my $req = HTTP::Request->new('GET', $url, $header); my $req_output = $brower->request($req); if ($req_output->is_error) { - xCAT::MsgUtils->message("W", { data => ["$ip: Could not obtain system information from BMC. Verify firmware levels are up-to-date."] }, $::CALLBACK); - return; + # If the host system has not yet been powered on, check the boxelder bmc info for model/serial + $url = "$http_protocol://$ip/$openbmc_project_url/$motherboard_boxelder_endpoint"; + $req = HTTP::Request->new('GET', $url, $header); + $req_output = $brower->request($req); + if ($req_output->is_error) { + xCAT::MsgUtils->message("W", { data => ["$ip: Could not obtain system information from BMC."] }, $::CALLBACK); + return; + } } my $response = decode_json $req_output->content; my $mtm; From 8e90e30bac13413997764fc927665a30b4951062 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 21 Jun 2017 12:39:53 -0400 Subject: [PATCH 188/201] Add verbose option to be parsed by rinv [openbmc] --- xCAT-server/lib/xcat/plugins/openbmc.pm | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index cf9b9cc60..1fca69eb0 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -29,6 +29,7 @@ use xCAT::SvrUtils; use xCAT::GlobalDef; use xCAT_monitoring::monitorctrl; +$::VERBOSE = 0; # String constants for rpower states $::POWER_STATE_OFF="off"; $::POWER_STATE_ON="on"; @@ -409,16 +410,27 @@ sub parse_args { my $extrargs = shift; my $noderange = shift; my $check = undef; - + if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig|rflash/) { return ([ 1, "No option specified for $command" ]); } - if (scalar(@ARGV) > 1 and ($command =~ /rpower|rinv|rsetboot|rvitals/)) { + my $subcommand = undef; + if (scalar(@ARGV) > 2 and ($command =~ /rpower|rinv|rsetboot|rvitals/)) { return ([ 1, "Only one option is supported at the same time" ]); + } elsif (scalar(@ARGV) == 2) { + # Check if one is calling for Verbose output + foreach (@ARGV) { + if ($_ =~ /V|verbose/) { + $::VERBOSE=1; + } else { + $subcommand = $_ + } + } + } else { + $subcommand = $ARGV[0] } - my $subcommand = $ARGV[0]; if ($command eq "rpower") { unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); @@ -526,6 +538,14 @@ sub parse_command_status { $next_status{LOGIN_REQUEST} = "LOGIN_RESPONSE"; + my $verbose = undef; + unless (GetOptions( + 'V|verbose' => \$verbose, + )) { + xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback); + return 1; + } + if ($command eq "rpower") { $subcommand = $ARGV[0]; From b658a17af30ddc67c18bc64c7985fddee5e40ade Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 21 Jun 2017 13:23:24 -0400 Subject: [PATCH 189/201] Change the output of firm [openbmc] to more closely match the output of OPAL P8 machines when displaying the firmware. Use the ID to sort, but remove it when printing out the messages to the user --- xCAT-server/lib/xcat/plugins/openbmc.pm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 1fca69eb0..3c30b1407 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1083,30 +1083,27 @@ sub rinv_response { if ($grep_string eq "firm") { # This handles the data from the /xyz/openbmc_project/Software endpoint. - # - # Handle printing out all posssible Software values in a generic format: - # node: Software: () - # my $sw_id = (split(/\//, $key_url))[-1]; if (defined($content{Version}) and $content{Version}) { my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); + $purpose_value = "[$sw_id]$purpose_value"; my $activation_value = (split(/\./, $content{Activation}))[-1]; # - # For 'rinv firm', only print Active software. 'rflash list' will handle others + # For 'rinv firm', only print Active software, unless verbose is specified # - if ($activation_value =~ "Active") { + if ($activation_value =~ "Active" or $::VERBOSE) { # - # The space below between "SOFTWARE:" and $content{Version} is intentional + # The space below between "Firmware Product Version:" and $content{Version} is intentional # to cause the sorting of this line before any additional info lines # - $content_info = "$purpose_value SOFTWARE[$sw_id]: $content{Version} ($activation_value)"; + $content_info = "$purpose_value Firmware Product: $content{Version} ($activation_value)"; push (@sorted_output, $content_info); if (defined($content{ExtendedVersion}) and $content{ExtendedVersion} ne "") { # ExtendedVersion is going to be a comma separated list of additional software my @versions = split(',', $content{ExtendedVersion}); foreach my $ver (@versions) { - $content_info = "$purpose_value SOFTWARE[$sw_id]: -- additional info: $ver"; + $content_info = "$purpose_value Firmware Product: -- additional info: $ver"; push (@sorted_output, $content_info); } } @@ -1149,7 +1146,14 @@ sub rinv_response { # sort alpha, then numeric my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; - xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + foreach (@sorted_output) { + # + # The firmware output requires the ID to be part of the string to sort correctly. + # Remove this ID from the output to the user + # + $_ =~ s/\[.*?\]//; + xCAT::SvrUtils::sendmsg("$_", $callback, $node); + } } else { xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } From 27607d7495382713bc2f57a14ad16613fc4fee6a Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 22 Jun 2017 20:55:52 -0400 Subject: [PATCH 190/201] Add verbose option to rinv for OpenBMC supported machines --- .../source/guides/admin-guides/references/man1/rinv.1.rst | 8 +++++++- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rinv.1.pod | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 214b06e13..045866ae0 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -39,7 +39,7 @@ OpenPOWER (OpenBMC) server specific: ==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | firm | cpu | dimm | all**\ ] [\ **-V | -**\ **-verbose**\ ] PPC (with HMC) specific: @@ -234,6 +234,12 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amou +\ **-V | -**\ **-verbose**\ + + Not supported for all managed machines. Prints verbose output. + + + \ **-t**\ Set the values in the vm table to what vCenter has for the indicated nodes. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index b733daca9..b0348dd53 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -100,7 +100,7 @@ my %usage = ( OpenPOWER (IPMI) server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] OpenPOWER (OpenBMC) server specific: - rinv [model|serial|firm|cpu|dimm|all] + rinv [model|serial|firm|cpu|dimm|all] [-V|--verbose] PPC specific(with HMC): rinv [all|bus|config|serial|model|firm] PPC specific(using Direct FSP Management): diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 090194df1..5b3e92665 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -16,7 +16,7 @@ B I [B|B|B|B|B|B|B I [B|B|B|B|B|B] +B I [B|B|B|B|B|B] [B<-V>|B<--verbose>] =head2 PPC (with HMC) specific: @@ -149,6 +149,10 @@ Print help. Print version. +=item B<-V>|B<--verbose> + +Not supported for all managed machines. Prints verbose output. + =item B<-t> Set the values in the vm table to what vCenter has for the indicated nodes. From c7aff42ca27605fdbd652db79183e67508a1e5a6 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 22 Jun 2017 21:00:43 -0400 Subject: [PATCH 191/201] Modify the description for verbose option in rinv --- docs/source/guides/admin-guides/references/man1/rinv.1.rst | 2 +- xCAT-client/pods/man1/rinv.1.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 045866ae0..d760fc576 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -236,7 +236,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amou \ **-V | -**\ **-verbose**\ - Not supported for all managed machines. Prints verbose output. + Prints verbose output, if available. diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 5b3e92665..52ed22ccc 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -151,7 +151,7 @@ Print version. =item B<-V>|B<--verbose> -Not supported for all managed machines. Prints verbose output. +Prints verbose output, if available. =item B<-t> From 65d882b9901f6b4346a610c05c6c68b847fc6bee Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 24 May 2017 04:40:43 -0400 Subject: [PATCH 192/201] add cumulus discover script --- perl-xCAT/xCAT/GlobalDef.pm | 4 + perl-xCAT/xCAT/data/switchinfo.pm | 45 ++++++ xCAT-server/lib/xcat/plugins/nodediscover.pm | 26 +++- .../lib/xcat/plugins/switchdiscover.pm | 49 +----- xCAT/postscripts/configinterface | 5 + xCAT/postscripts/cumulusztp | 145 ++++++++++++++++-- xCAT/postscripts/documulusdiscovery | 132 ++++++++++++++++ xCAT/postscripts/enablesnmp | 5 + xCAT/postscripts/getmypostscript.cumulus | 58 +++++++ 9 files changed, 410 insertions(+), 59 deletions(-) create mode 100644 perl-xCAT/xCAT/data/switchinfo.pm create mode 100755 xCAT/postscripts/documulusdiscovery create mode 100755 xCAT/postscripts/getmypostscript.cumulus diff --git a/perl-xCAT/xCAT/GlobalDef.pm b/perl-xCAT/xCAT/GlobalDef.pm index b953a5168..b9b99ea20 100644 --- a/perl-xCAT/xCAT/GlobalDef.pm +++ b/perl-xCAT/xCAT/GlobalDef.pm @@ -51,7 +51,9 @@ $::STATUS_BOOTED = "booted"; $::STATUS_POWERING_ON = "powering-on"; $::STATUS_POWERING_OFF = "powering-off"; $::STATUS_DISCOVERING = "discovering"; +$::STATUS_DISCOVERED = "discovered"; $::STATUS_CONFIGURING = "configuring"; +$::STATUS_CONFIGURED = "configured"; $::STATUS_STANDING_BY = "standingby"; $::STATUS_SHELL = "shell"; $::STATUS_DEFINED = "defined"; @@ -69,7 +71,9 @@ $::STATUS_BMCREADY = "bmcready"; $::STATUS_POWERING_ON => 1, $::STATUS_POWERING_OFF => 1, $::STATUS_DISCOVERING => 1, + $::STATUS_DISCOVERED => 1, $::STATUS_CONFIGURING => 1, + $::STATUS_CONFIGURED => 1, $::STATUS_STANDING_BY => 1, $::STATUS_SHELL => 1, $::STATUS_DEFINED => 1, diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm new file mode 100644 index 000000000..79c36abfa --- /dev/null +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -0,0 +1,45 @@ +# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html + +#This module includes some glocal table to look up the switch type via mac and vendor + +package xCAT::data::switchinfo; + +require Exporter; +@ISA = qw(Exporter); +@EXPORT = qw(); +@EXPORT_OK = qw(global_mac_identity global_switch_type); + +use strict; + +#the hash to look up switch type with MAC +our %global_mac_identity = ( + "a8:97:dc" => "BNT G8052 switch", + "6c:ae:8b" => "BNT G8264-T switch", + "fc:cf:62" => "BNT G8124 switch", + "7c:fe:90" => "Mellanox IB switch", + "cc:37:ab" => "Edgecore Networks Switch", + "8c:ea:1b" => "Edgecore Networks Switch" +); + +#the hash to lookup switch type with vendor +our %global_switch_type = ( + Juniper => "Juniper", + juniper => "Juniper", + Cisco => "Cisco", + cisco => "Cisco", + BNT => "BNT", + Blade => "BNT", + G8052 => "BNT", + RackSwitch => "BNT", + Mellanox => "Mellanox", + mellanox => "Mellanox", + MLNX => "Mellanox", + MELLAN => "Mellanox", + Cumulus => "onie", + cumulus => "onie", + Edgecore => "onie" +); + + + +1; diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index d9b9ada43..7188d8cc2 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -4,10 +4,8 @@ package xCAT_plugin::nodediscover; use xCAT::Table; use IO::Socket; use strict; - use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use Data::Dumper; use POSIX "WNOHANG"; use Storable qw(freeze thaw); use IO::Select; @@ -15,7 +13,7 @@ use IO::Handle; use xCAT::Utils; use Sys::Syslog; use Text::Balanced qw(extract_bracketed); - +use xCAT::data::switchinfo; use xCAT::DiscoveryUtils; @@ -175,6 +173,7 @@ sub process_request { } } + # save inventory info into the hwinv table if (defined($request->{cpucount}) or defined($request->{cputype}) or defined($request->{memory}) or defined($request->{disksize})) { my $basicdata; @@ -232,15 +231,32 @@ sub process_request { if ($rent and $rent->{'netboot'}) { $currboot = $rent->{'netboot'}; } + if ($request->{arch}->[0] =~ /x86/ and $currboot !~ /pxe/ and $currboot !~ /xnba/) { $nrtab->setNodeAttribs($node, { netboot => 'xnba' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) { $nrtab->setNodeAttribs($node, { netboot => 'petitboot' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /yaboot/) { $nrtab->setNodeAttribs($node, { netboot => 'yaboot' }); + } elsif($request->{arch}->[0] =~ /armv7l/ and $currboot !~ /onie/) { + #for onie switch, the netboot should be "onie" + $nrtab->setNodeAttribs($node, { netboot => 'onie' }); } } + if(defined $request->{nodetype} and $request->{nodetype}->[0] = 'switch' and $request->{_xcat_clientmac}->[0]){ + #for onie switch, lookup and set the switchtype via mac of mgt interface + my $switchestab = xCAT::Table->new('switches'); + if ($switchestab) { + my $switchtype=$xCAT::data::switchinfo::global_mac_identity{substr(lc($request->{_xcat_clientmac}->[0]),0,8)}; + if(defined $switchtype){ + $switchestab->setNodeAttribs($node,{ switchtype => $switchtype }); + } + $switchestab->close(); + } + } + + my $macstring = ""; if (defined($request->{mac})) { my $mactab = xCAT::Table->new("mac", -create => 1); @@ -252,9 +268,11 @@ sub process_request { my $forcenic = 0; #-1 is force skip, 0 is use default behavior, 1 is force to be declared even if hosttag is skipped to do so foreach (@{ $request->{mac} }) { @ifinfo = split /\|/; + if ($ifinfo[1] eq 'usb0') { #skip usb nic next; } + $bydriverindex{ $ifinfo[0] } += 1; if (scalar @discoverynics) { $forcenic = -1; #$forcenic defaults to explicitly skip nic @@ -295,7 +313,7 @@ sub process_request { push @hostnames_to_update, $hosttag; } } - print Dumper($hosttag) . "\n"; + #print Dumper($hosttag) . "\n"; if ($hosttag) { $usednames{$hosttag} = 1; unless ($usednames_for_net{$netn}) { diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 168cf6ea8..70970480d 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -21,6 +21,7 @@ no strict; use Data::Dumper; use Socket; use Expect; +use xCAT::data::switchinfo; #global variables for this module my $community; @@ -33,42 +34,6 @@ my %global_scan_type = ( snmp => "snmp_scan" ); -my %global_mac_identity = ( - "a8:97:dc" => "BNT G8052 switch", - "6c:ae:8b" => "BNT G8264-T switch", - "fc:cf:62" => "BNT G8124 switch", - "7c:fe:90" => "Mellanox switch", - "e4:1d:2d" => "Mellanox switch", - "24:8a:07" => "Mellanox switch", - "00:25:8b" => "Mellanox switch", - "00:02:c9" => "Mellanox switch", - "f4:52:14" => "Mellanox switch", - "ec:0d:9a" => "Mellanox switch", - "cc:37:ab" => "Edgecore Networks Switch", - "a8:2b:b5" => "Edgecore Networks Switch", - "70:72:cf" => "Edgecore Networks Switch", - "8c:ea:1b" => "Edgecore Networks Switch" -); - -my %global_switch_type = ( - Juniper => "Juniper", - juniper => "Juniper", - Cisco => "Cisco", - cisco => "Cisco", - BNT => "BNT", - Blade => "BNT", - G8052 => "BNT", - RackSwitch => "BNT", - Mellanox => "Mellanox", - mellanox => "Mellanox", - MLNX => "Mellanox", - MELLAN => "Mellanox", - Cumulus => "onie", - cumulus => "onie", - Edgecore => "onie" -); - - #------------------------------------------------------------------------------- =head1 xCAT_plugin:switchdiscover @@ -748,16 +713,16 @@ sub nmap_scan { } my $vendor = $addr->{vendor}; if ($vendor) { - my $search_string = join '|', keys(%global_switch_type); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); if ($vendor =~ /($search_string)/) { $found = 1; } } if ( ($found == 0) && ($type eq "mac") ) { - my $search_string = join '|', keys(%global_mac_identity); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_mac_identity); if ($mac =~ /($search_string)/i) { my $key = $1; - $vendor = $global_mac_identity{lc $key}; + $vendor = $xCAT::data::switchinfo::global_mac_identity{lc $key}; $found = 1; } @@ -851,7 +816,7 @@ sub nmap_osguess { last; } } - my $search_string = join '|', keys(%global_switch_type); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); if ($line =~ /Running/) { if ($line =~ /($search_string)/){ $vendor = $1; @@ -1180,10 +1145,10 @@ sub get_switchtype { my $vendor = shift; my $key = "Not support"; - my $search_string = join '|', keys(%global_switch_type); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); if ($vendor =~ /($search_string)/) { $key = $1; - return $global_switch_type{$key}; + return $xCAT::data::switchinfo::global_switch_type{$key}; } else { return $key; } diff --git a/xCAT/postscripts/configinterface b/xCAT/postscripts/configinterface index 40deeb269..53d9c720a 100755 --- a/xCAT/postscripts/configinterface +++ b/xCAT/postscripts/configinterface @@ -9,6 +9,11 @@ fi xcat_intf="/etc/network/interfaces.d/xCAT.intf" +if [ -f $xcat_intf ] && grep -w '#This is sample interface file provided by xCAT' $xcat_intf ; then + echo "The switch data ports and default brige have been configured. Do nothing..." + exit 0 +fi + echo "#This is sample interface file provided by xCAT" > $xcat_intf echo "# bridge-vlan-aware: set to yes to indicate that the bridge is VLAN-aware. " >> $xcat_intf echo "# bridge-access: declares the access port. " >> $xcat_intf diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp index 311cdfdf1..d1403edeb 100755 --- a/xCAT/postscripts/cumulusztp +++ b/xCAT/postscripts/cumulusztp @@ -1,4 +1,7 @@ #!/bin/bash +#this script will be invoked by ZTP(zero touch provision) process in the onie switch +#this script finish the discovery and configuration after the switch is pluged in the cluster and powered on + function error() { echo -e "\e[0;33mERROR: The Zero Touch Provisioning script failed while running the command $BASH_COMMAND at line $BASH_LINENO.\e[0m" >&2 exit 1 @@ -7,28 +10,144 @@ function error() { # Log all output from this script exec >/var/log/autoprovision 2>&1 -trap error ERR +#trap error ERR #Add Debian Repositories -echo "deb http://http.us.debian.org/debian jessie main" >> /etc/apt/sources.list -echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list +#since in most cases, the switch has no internet access, skip this step +#echo "deb http://http.us.debian.org/debian jessie main" >> /etc/apt/sources.list +#echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list #get ip address for server node server_ip=`grep cumulus-provision-url /var/lib/dhcp/dhclient.eth0.leases | tail -1 | awk -F/ '{print $3}'` - + +#download /install/postscripts from MN +max_retries=5 +retry=0 +rc=1 # this is a fail return +downloaded=0 +while [ 0 -eq 0 ]; do + + if [ -e "/xcatpost" ]; then + rm -rf "/xcatpost" + fi + + export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server_ip/install/postscripts/ -P /xcatpost 2> /tmp/wget.log + rc=$? + if [ $rc -eq 0 ]; then + # return from wget was 0 but some OS do not return errors, so we + # have additional checks for + # failed: Connection httpd not running + # 404: Not Found - if directory does not exist + grep -i -E "... failed: Connection refused.$" /tmp/wget.log + rc1=$? + grep -i -E "ERROR 404: Not Found.$" /tmp/wget.log + rc2=$? + # check to see no errors at all, grep returns 1 + if [ $rc1 -eq 1 ] && [ $rc2 -eq 1 ]; then + logger -s -t "xcat.cumulusztp" -p local4.info "download_postscripts return successfully " + downloaded=1 + break + fi + fi + + retry=$(($retry+1)) + logger -s -t "xcat.cumulusztp" -p local4.info "download_postscripts retry $retry" + if [ $retry -eq $max_retries ]; then + + break + fi + + SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*20)}') + sleep $SLI +done + +if [ "$downloaded" = "0" ];then + logger -s -t "xcat.cumulusztp" -p local4.err "download_postscripts failed" + ztp -R + exit 1 +fi + +chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` + +cd /xcatpost +rc=0 + +./documulusdiscovery +rc=$? +if [ "$rc" != "0" ];then + ztp -R + exit 1 +fi + +logger -s -t "xcat.cumulusztp" -p local4.info "switch discovered!" + +#restart mgt interface to apply the specified IP address +ifdown eth0;ifup eth0 + +retry=0 +while true; do + #check whether the network access between MN/CN and the node is ready + ping $server_ip -c 1 >/dev/null && break + retry=$[ $retry + 1 ] + if [ $retry -eq 90 ];then + #timeout, complain and exit + logger -s -t "xcat.cumulusztp" -p local4.err " the network between the node and $server_ip is not ready, please check[retry=$retry]..." "/var/log/xcat/xcat.log" + ztp -R + exit 1 + fi + + #sleep sometime before the next scan + sleep 2 +done + #push root ssh keys, config passwordless -echo "CumulusLinux!" | sudo -S mkdir -p /root/.ssh -echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /root/.ssh/authorized_keys http://$server_ip/install/postscripts/_ssh/authorized_keys - +mkdir -p /root/.ssh +mv _ssh/authorized_keys /root/.ssh/authorized_keys + #enable and config snmpd -echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /home/cumulus/enablesnmp http://$server_ip/install/postscripts/enablesnmp -sudo chmod +x /home/cumulus/enablesnmp -sudo /home/cumulus/enablesnmp +./enablesnmp +rc=$? +if [ "$rc" != "0" ];then + logger -s -t "xcat.cumulusztp" -p local4.err "enablesnmp: failed to enable SNMP" + echo "enablesnmp: failed to enable SNMP" +else + logger -s -t "xcat.cumulusztp" -p local4.info "SNMP enabled!" +fi #config base interface -echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /home/cumulus/configinterface http://$server_ip/install/postscripts/configinterface -sudo chmod +x /home/cumulus/configinterface -sudo /home/cumulus/configinterface +./configinterface +rc=$? +if [ "$rc" != "0" ];then + echo "configinterface: failed to config switch data ports" +else + logger -s -t "xcat.cumulusztp" -p local4.info "data ports enabled!" +fi + +#obtain myposctscript from MN +./getmypostscript.cumulus $server_ip:3001 +rc=$? +if [ "$rc" != "0" ]; then + logger -s -t "xcat.cumulusztp" -p local4.info "failed to get mypostscript" + echo "failed to get mypostscript" + ztp -R + exit 1 +fi + +#config static ip address for mgt interface +echo './confignics -s' >> ./mypostscript +chmod +x ./mypostscript +./mypostscript +rc=$? +if [ "$rc" != "0" ]; then + logger -s -t "xcat.cumulusztp" -p local4.info "failed to set static ip address for mgt interface" + echo "failed to set static ip address for mgt interface" + ztp -R + exit 1 +fi + + +#report status +echo "installstatus configured" | socat STDIN TCP:$server_ip:3002,sourceport=301,reuseaddr,retry=5 # CUMULUS-AUTOPROVISIONING exit 0 diff --git a/xCAT/postscripts/documulusdiscovery b/xCAT/postscripts/documulusdiscovery new file mode 100755 index 000000000..a6f8bae60 --- /dev/null +++ b/xCAT/postscripts/documulusdiscovery @@ -0,0 +1,132 @@ +#!/bin/bash +#this script grabs the switch information, then composes a "findme" request and sends it to MN +#so that the switch can be discovered + +# TODO: Figure out the master based on the DHCP packet +XCATMASTER=$(cat /var/lib/dhcp/dhclient.eth0.leases |grep cumulus-provision-url|tail -1|awk -F/ '{print $3}') +XCATPORT=3001 +log_label="xcat.documulusdiscovery" + +#helper script for socat, write the received message to /tmp/helper.socat.sh +cat > /tmp/helper.socat.sh << 'EOF' +read strin +echo $strin > /tmp/result.socat.out +EOF + +[ -f "/tmp/helper.socat.sh" ] && chmod 777 /tmp/helper.socat.sh + +#listen to the 3001 port for any response from xcatd on MN +#the message in the response will be written to /tmp/result.socat.out +socat TCP4-LISTEN:3001,reuseaddr EXEC:"/tmp/helper.socat.sh" & + +#generate key pairs for the SSL connection between switch and xcatd on MN +mkdir -p /etc/xcat +mkdir -p /etc/pki/tls + +if [ ! -f /etc/xcat/privkey.pem ]; then +echo "[ req ] +distinguished_name = nodedn + +[ nodedn ]" > /etc/pki/tls/openssl.cnf + logger -s -t $log_label -p local4.info "Generating private key..." + openssl genrsa -out /etc/xcat/privkey.pem 1024 >& /dev/null + logger -s -t $log_label -p local4.info "Done" +fi + +PUBKEY=`openssl rsa -in /etc/xcat/privkey.pem -pubout 2> /dev/null|grep -v "PUBLIC KEY"` +PUBKEY=`echo $PUBKEY|sed -e 's/ //g'` +export PUBKEY + +logger -s -t $log_label -p local4.info "Beginning switch discovery process..." + +#grab the switch information +dmidweinfo=$(/usr/sbin/dmidecode 2>/dev/null) +PRODUCTNAME=$(echo "$dmidweinfo"|grep "Product Name"|cut -d: -f2|sed -e 's/^\s*//' -e 's/\s*$//') +MTM=$PRODUCTNAME +ARCH=$(uname -m) +SERIAL=$(echo "$dmidweinfo"|grep "Serial Number"|cut -d: -f2|sed -e 's/^\s*//' -e 's/\s*$//') + +#compose the findme request +echo '' > /tmp/discopacket +echo "findme" >> /tmp/discopacket +echo "1" >> /tmp/discopacket +echo "switch" >> /tmp/discopacket +echo "$ARCH" >> /tmp/discopacket +#echo "$MTM" >> /tmp/discopacket +echo "$MTM" >> /tmp/discopacket +echo "$SERIAL" >> /tmp/discopacket + +MAC_OF_FIRST_UP_NIC=$(ip addr show eth0|grep "link/ether"|awk -F' ' '{print $2}') +MAC=$MAC_OF_FIRST_UP_NIC +ADDRESS=$(ip address show dev eth0|grep "inet "|grep global|awk '{print $2}') +DRIVER=$(grep DRIVER /sys/class/net/eth0/device/uevent|awk -F= '{print $2}') +echo "$DRIVER|eth0|$MAC|$ADDRESS" >> /tmp/discopacket + +UUID=`echo $MTM-$SERIAL-$MAC_OF_FIRST_UP_NIC| tr /A-Z/ /a-z/` +echo "$UUID" >> /tmp/discopacket + +echo "$PUBKEY" >> /tmp/discopacket +echo "" >> /tmp/discopacket +echo "" >> /tmp/discopacket +echo "" >> /tmp/discopacket +openssl dgst -sha512 -out /tmp/discopacket.sha512 -sign /etc/xcat/privkey.pem /tmp/discopacket +openssl enc -e -a -in /tmp/discopacket.sha512 > /tmp/discopacket.b64sig +cat /tmp/discopacket |while read line; do + if [ "$line" = "" ]; then + cat /tmp/discopacket.b64sig >> /tmp/discopacket.new + fi + echo $line >> /tmp/discopacket.new +done +mv /tmp/discopacket.new /tmp/discopacket +logger -s -t $log_label -p local4.info "Discovery packet file is ready." +rm -f /tmp/discopacket.gz +gzip -9 /tmp/discopacket + + + +if [ -z "$XCATMASTER" ] || [ -z "$XCATPORT" ]; then + logger -s -t $log_label -p local4.err "Failed to get xcatd connection information, exit..." + rm -rf /tmp/result.socat.out + rm -rf /tmp/helper.socat.sh + exit 1 +fi + + +#send the find me request ot xcatd on MN +MAX_RETRY=10 +RETRY=0 +DISCOVERED=0 + +while [ $RETRY -lt $MAX_RETRY ]; do + logger -s -t $log_label -p local4.info "Sending the discovery packet to xCAT ($XCATMASTER:$XCATPORT) [ RETRY= $RETRY ] ..." + (cat /tmp/discopacket.gz | socat STDIN UDP:$XCATMASTER:$XCATPORT,sourceport=301 ) & + + WAITRETRY=0 + while [ $WAITRETRY -lt 100 ]; do + if [ -f "/tmp/result.socat.out" ] && grep "restart" /tmp/result.socat.out; then + DISCOVERED=1 + break; + fi + sleep 1 + ((WAITRETRY=WAITRETRY+1)) + done + + if [ "$DISCOVERED" = "1" ]; then + break + fi + + sleep 2 + ((RETRY=RETRY+1)) +done + +rm -rf /tmp/result.socat.out +rm -rf /tmp/helper.socat.sh + +if [ "$DISCOVERED" = "0" ] ; then + logger -s -t $log_label -p local4.info "Failed to discover me, exit..." + exit 1 +elif [ "$DISCOVERED" = "1" ]; then + echo "installstatus discovered" | socat STDIN TCP:$XCATMASTER:3002,sourceport=301,reuseaddr,retry=5 +fi + +exit 0 diff --git a/xCAT/postscripts/enablesnmp b/xCAT/postscripts/enablesnmp index 2d4f2fd96..6f5661346 100755 --- a/xCAT/postscripts/enablesnmp +++ b/xCAT/postscripts/enablesnmp @@ -6,7 +6,12 @@ if ! cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2 echo "This script is only supported on Cumulus OS in ONIE switch" exit 2 fi + snmp_conf="/etc/snmp/snmpd.conf" +if [ -f "$snmp_conf" ] && grep -w '#xCAT customized snmpd configuration' $snmp_conf;then + echo "The snmp has already been configured. Do nothing..." + exit 0 +fi [ -f "$snmp_conf" ] || exit -1 diff --git a/xCAT/postscripts/getmypostscript.cumulus b/xCAT/postscripts/getmypostscript.cumulus new file mode 100755 index 000000000..54a54d1d0 --- /dev/null +++ b/xCAT/postscripts/getmypostscript.cumulus @@ -0,0 +1,58 @@ +#!/bin/bash +#this script send getpostscript request to xcatd on MN and generate /xcatpost/mypostscript +#which includes the glocal environment variables to run postscripts + +if [ -z "$XCATDEST" ]; then + XCATDEST=$1 +fi + +#compose getpostscript request +echo " +getpostscript +" > /tmp/req.xml + + + +if [ -f /tmp/resp.xml ]; then + #remove any existing response file + rm /tmp/resp.xml; +fi + + +#communicate with xcatd on MN with getpostscript request +#the response will be saved in /tmp/resp.xml +while [ ! -f /tmp/resp.xml ] || grep error /tmp/resp.xml; do + if [ -f /tmp/resp.xml ]; then + timer=60 + while [ $timer -gt 0 ]; do + echo -en "Retrying in $timer seconds \r" >&2 + sleep 1 + timer=$(($timer-1)); + done + fi + #echo " " >&2 + if [ -f /etc/xcat/cert.pem -a -f /etc/xcat/certkey.pem ]; then #use client cert if available + cat /tmp/req.xml | /usr/bin/openssl s_client -key /etc/xcat/certkey.pem -cert /etc/xcat/cert.pem -connect $XCATDEST -quiet 2> /dev/null > /tmp/resp.xml + else + cat /tmp/req.xml | /usr/bin/openssl s_client -connect $XCATDEST -quiet 2>/dev/null > /tmp/resp.xml + fi +done + +if [ -f /tmp/resp.xml ] && grep '' /tmp/resp.xml >/dev/null 2>&1 ;then + echo "Success to obtain mypostscript!" +else + echo "Failed to obtain mypostscript!" + exit 1 +fi + +#parse the script from the xml-formated resposne +cat /tmp/resp.xml | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' | sed -e 's/<//g' -e 's/&/\&/g' -e 's/"/"/g' -e "s/'/'/g" > /xcatpost/mypostscript + +#the script specified in the "postscripts" and "postbootscripts" are currently not supported +#will be supported if there is requrement on this +sed -i -e "/# postscripts-start-here/,$ d" /xcatpost/mypostscript + +rm -f /tmp/req.xml +rm -f /tmp/resp.xml +exit 0 + From 32b467d635a3fe175405edc6c0cd4225638aef57 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 22 Jun 2017 22:29:20 -0400 Subject: [PATCH 193/201] Our p9 boxes do not have any VPD information, so in order to force the code to return a generated discovered definition, blank out the mtm string if XCAT_DEV_WITHERSPOON=TRUE --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 5fb0f8009..63da7ea97 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -83,6 +83,11 @@ sub process_request $::CALLBACK = $callback; #$::args = $request->{arg}; + if (ref($request->{environment}) eq 'ARRAY' and ref($request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}) eq 'ARRAY') { + $::XCAT_DEV_WITHERSPOON = $request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}->[0]; + } else { + $::XCAT_DEV_WITHERSPOON = $request->{environment}->{XCAT_DEV_WITHERSPOON}; + } unless (defined($request->{arg})) { bmcdiscovery_usage(); @@ -1089,6 +1094,10 @@ sub bmcdiscovery_openbmc{ if (defined($response->{data})) { if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { $mtm = $response->{data}->{Model}; + if (defined($::XCAT_DEV_WITHERSPOON) && ($::XCAT_DEV_WITHERSPOON eq "TRUE")) { + print "XCAT_DEV_WITHERSPOON=TRUE, forcing MTM to blank string (ORIG MTM=$mtm)\n"; + $mtm = ""; + } $serial = $response->{data}->{SerialNumber}; } else { xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); From bc46643b739302708a402986e876fa5aedf8b6ab Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 22 Jun 2017 23:08:15 -0400 Subject: [PATCH 194/201] Print the XCAT_DEV_WITHERSPOON bypass message out to the user --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 63da7ea97..fdf03b3b7 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1095,7 +1095,7 @@ sub bmcdiscovery_openbmc{ if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { $mtm = $response->{data}->{Model}; if (defined($::XCAT_DEV_WITHERSPOON) && ($::XCAT_DEV_WITHERSPOON eq "TRUE")) { - print "XCAT_DEV_WITHERSPOON=TRUE, forcing MTM to blank string (ORIG MTM=$mtm)\n"; + xCAT::MsgUtils->message("I", { data => ["XCAT_DEV_WITHERSPOON=TRUE, forcing MTM to empty string for $ip (Original MTM=$mtm)"] }, $::CALLBACK); $mtm = ""; } $serial = $response->{data}->{SerialNumber}; From d5290be6642849784b637bfba441375581eb4d05 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 22 Jun 2017 23:41:06 -0400 Subject: [PATCH 195/201] update according to comments --- .../autotest/testcase/confignetwork/cases0 | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index a1ce6239c..9267030af 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -31,7 +31,7 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +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 "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output!~dhcp @@ -78,7 +78,7 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +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 "Red Hat" /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!~dhcp @@ -130,17 +130,18 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +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 "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output!~dhcp -cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep 100.1.0.100 /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 100.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 100.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~100.1.0.100 check:output!~dhcp cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" check:rc==0 cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi +cmd:xdsh $$CN "ip addr del 100.1.0.100/16 dev $$SECONDNIC" cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 @@ -162,11 +163,12 @@ cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +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 "Red Hat" /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!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi @@ -195,6 +197,7 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/ne check:output=~11.1.0.100 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep MTU /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~MTU=1496 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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 @@ -219,23 +222,25 @@ cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtif check:rc==0 cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1|aliases1-2" +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1 aliases1-1-1|aliases1-2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC|-$$SECONDNIC-1" check:rc==0 cmd:makehosts $$CN check:rc==0 cmd:cat /etc/hosts -check:output=~aliases1-1 +check:output=~aliases1-1 aliases1-1-1 check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 check:output!~dhcp -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 check:output!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi @@ -269,10 +274,10 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /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=~11.1.0.100 check:output!~dhcp -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 check:output=~CONNECTED_MODE=yes check:output!~dhcp @@ -280,6 +285,8 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; 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:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" cmd:if [ -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 @@ -349,7 +356,7 @@ check:rc==0 cmd:chtab node=$$CN nics.disable=yes check:rc==0 cmd:updatenode $$CN -P confignetwork -check:rc==0 +check:rc==1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 @@ -369,7 +376,7 @@ check:rc==0 cmd:chtab node=$$CN nics.disable=1 check:rc==0 cmd:updatenode $$CN -P confignetwork -check:rc==0 +check:rc==1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 @@ -438,16 +445,12 @@ cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -check:output!~dhcp cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 -check:output!~dhcp cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~13.1.0.100 -check:output!~dhcp cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi check:output=~14.1.0.100 -check:output!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 @@ -456,6 +459,10 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifc check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 13.1.0.100/16 dev $$THIRDNIC" +cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" 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 @@ -464,12 +471,3 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" check:rc==0 end - -start:confignetwork_help -description:this case is to verify if help information is provided -cmd:confignetwork -h -check:rc==0 -#TODO help information is printed -cmd:confignetwork --help -check:rc==0 -#TODO help information is printed From 0e879470def003a08f5827f198e597141028c216 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 23 Jun 2017 00:05:47 -0400 Subject: [PATCH 196/201] update the return code --- xCAT-test/autotest/testcase/confignetwork/cases0 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 9267030af..7800598c2 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -337,7 +337,7 @@ check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 check:rc==0 cmd:updatenode $$CN -P confignetwork -check:rc!=0 +check:rc==0 #TODO check the error message cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 @@ -356,7 +356,7 @@ check:rc==0 cmd:chtab node=$$CN nics.disable=yes check:rc==0 cmd:updatenode $$CN -P confignetwork -check:rc==1 +check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 @@ -376,7 +376,7 @@ check:rc==0 cmd:chtab node=$$CN nics.disable=1 check:rc==0 cmd:updatenode $$CN -P confignetwork -check:rc==1 +check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 From 62d503797525ced1e6e368a30d5e2e0c884dd813 Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 22 Jun 2017 03:47:57 -0400 Subject: [PATCH 197/201] Format the ouput of getadapter result This patch format the result of getadapter command and update the man page to notice that `getadapter` will boot into genesis. Fix-issue: #3046 --- .../references/man1/getadapter.1.rst | 30 ++++++++++++++-- xCAT-client/pods/man1/getadapter.1.pod | 29 +++++++++++----- xCAT-server/lib/xcat/plugins/getadapter.pm | 34 ++++++++++++------- 3 files changed, 69 insertions(+), 24 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst index 982fcd4c3..316f4bcea 100644 --- a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst @@ -31,7 +31,7 @@ DESCRIPTION Traditionally, network interfaces in Linux are enumerated as eth[0123...], but these names do not necessarily correspond to actual labels on the chassis. \ **getadapter**\ help customer to get predictable network device name and some other network adapter information before provision or network configuration. -\ **getadapter**\ use genesis to collect network adapters information, so that mean it need to restart the target node. +\ **Since getadpter uses genesis to collect network adapters information, the target node will be restarted.**\ \ **getadapter**\ For each node within the , follows below scheme: @@ -41,16 +41,42 @@ If user hopes to scan the adapter information for the node but these information \ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. -Below are the possible information can be collect up to now: + +****************************** +\ **Collected information:**\ +****************************** + + + \ **name**\ : the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7 + + + \ **pci**\ : the pci location + + + \ **mac**\ : the MAC address + + + \ **candidatename**\ : All the names which satisfy predictable network device naming scheme. \ *(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)*\ + + + \ **vender**\ : the vender of network device + + + \ **model**\ : the model of network device + + + \ **linkstate**\ : the link state of network device + + ******* OPTIONS ******* diff --git a/xCAT-client/pods/man1/getadapter.1.pod b/xCAT-client/pods/man1/getadapter.1.pod index d9e43c6e9..0bdb93c42 100644 --- a/xCAT-client/pods/man1/getadapter.1.pod +++ b/xCAT-client/pods/man1/getadapter.1.pod @@ -12,7 +12,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>|B<-V>] Traditionally, network interfaces in Linux are enumerated as eth[0123...], but these names do not necessarily correspond to actual labels on the chassis. B help customer to get predictable network device name and some other network adapter information before provision or network configuration. -B use genesis to collect network adapters information, so that mean it need to restart the target node. +B B For each node within the , follows below scheme: @@ -22,14 +22,25 @@ If user hopes to scan the adapter information for the node but these information B tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. -Below are the possible information can be collect up to now: -B: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7 -B: the pci location -B: the MAC address -B: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)> -B: the vender of network device -B: the model of network device -B: the link state of network device +=head1 B + +=over 2 + +=item B: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7 + +=item B: the pci location + +=item B: the MAC address + +=item B: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)> + +=item B: the vender of network device + +=item B: the model of network device + +=item B: the link state of network device + +=back =head1 OPTIONS diff --git a/xCAT-server/lib/xcat/plugins/getadapter.pm b/xCAT-server/lib/xcat/plugins/getadapter.pm index 19edc1817..3cdbe5bff 100644 --- a/xCAT-server/lib/xcat/plugins/getadapter.pm +++ b/xCAT-server/lib/xcat/plugins/getadapter.pm @@ -122,8 +122,8 @@ sub route_request { my $command = $request->{command}->[0]; my $ret = xCAT::State->REQUEST_ERROR; - if (scalar(@{ $request->{node} }) == 0) { - return $ret; + if (!$request->{node}) { + return xCAT::State->REQUEST_WAIT; } my $build_request_message_func = sub { @@ -404,7 +404,7 @@ sub update_adapter_result { $interface_exists = 0; if (exists($msg->{nic}->[$i]->{interface})) { - $output .= $msg->{nic}->[$i]->{interface}; + $output .= $msg->{nic}->[$i]->{interface}."!"; if ($has_nic) { $data .= "," . $msg->{nic}->[$i]->{interface} . "!"; } @@ -414,38 +414,46 @@ sub update_adapter_result { $interface_exists = 1; $has_nic = 1; } + my @nic_attrs = (); + my @output_attrs = (); if (exists($msg->{nic}->[$i]->{mac})) { - $output .= "!mac=" . $msg->{nic}->[$i]->{mac}; + push(@output_attrs, "mac=" . $msg->{nic}->[$i]->{mac}); if ($interface_exists) { - $data .= " mac=" . $msg->{nic}->[$i]->{mac}; + push(@nic_attrs, "mac=" . $msg->{nic}->[$i]->{mac}); } } if (exists($msg->{nic}->[$i]->{pcilocation})) { - $output .= "|pci=" . $msg->{nic}->[$i]->{pcilocation}; + push(@output_attrs, "pci=" . $msg->{nic}->[$i]->{pcilocation}); if ($interface_exists) { - $data .= "pci=" . $msg->{nic}->[$i]->{pcilocation}; + push(@nic_attrs, "pci=" . $msg->{nic}->[$i]->{pcilocation}); } } if (exists($msg->{nic}->[$i]->{predictablename})) { - $output .= "|candidatename=" . $msg->{nic}->[$i]->{predictablename}; + push(@output_attrs, "candidatename=" . $msg->{nic}->[$i]->{predictablename}); } if (exists($msg->{nic}->[$i]->{vendor})) { - $output .= "|vendor=" . $msg->{nic}->[$i]->{vendor}; + $msg->{nic}->[$i]->{vendor} =~ s/^\s+|\s+$//g; + push(@output_attrs, "vendor=" . $msg->{nic}->[$i]->{vendor}); } if (exists($msg->{nic}->[$i]->{model})) { - $output .= "|model=" . $msg->{nic}->[$i]->{model}; + $msg->{nic}->[$i]->{model} =~ s/^\s+|\s+$//g; + push(@output_attrs, "model=" . $msg->{nic}->[$i]->{model}); } if (exists($msg->{nic}->[$i]->{linkstate})) { - $output .= "|linkstate=" . $msg->{nic}->[$i]->{linkstate}; + push(@output_attrs, "linkstate=" . (split(' ', $msg->{nic}->[$i]->{linkstate}))[0]); if ($interface_exists) { - $data .= " linkstate=" . $msg->{nic}->[$i]->{linkstate}; + push(@nic_attrs, "linkstate=". (split(' ', $msg->{nic}->[$i]->{linkstate}))[0]); } } + if (@nic_attrs) { + $data .= join(" ", @nic_attrs); + } + $output .= join("|", @output_attrs); $output .= "\n"; } $callback->({ data => "$output" }); if (!$has_nic) { - $callback->({ data => "$node: nics talbe will not be updated as not any ". + $callback->({ data => "$node: nics table will not be updated as not any ". "useful information could be found with udevadm command." }); return 0; } From 5cd9b632a18faabb540f722fba86488019afe629 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 23 Jun 2017 14:45:13 +0800 Subject: [PATCH 198/201] refine new confignetwork framework to use configeth (#3302) * new confignetwork framework to use configeth, it will be finally to replace confignics. * updated based on comments --- xCAT/postscripts/configeth | 43 +++---- xCAT/postscripts/confignetwork | 218 ++++++++++++++++++++++++++++----- 2 files changed, 209 insertions(+), 52 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 51631a977..fd53c5dc9 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -6,6 +6,7 @@ if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then str_dir_name=`dirname $0` . $str_dir_name/xcatlib.sh + . $str_dir_name/nicutils.sh fi function configipv4(){ @@ -354,16 +355,16 @@ fi logger -t xcat -p local4.err "configeth: os type: $str_os_type" -echo "configeth on $NODE: os type: $str_os_type" +log_info "configeth on $NODE: os type: $str_os_type" if [ "$1" = "-r" ];then if [ $# -ne 2 ];then logger -t xcat -p local4.err "configeth: remove nic, but the nic name is missed" - echo "configeth on $NODE: remove nic, but the nic name is missed" + log_error "configeth on $NODE: remove nic, but the nic name is missed" exit 1 fi str_nic_name=$2 logger -t xcat -p local4.err "configeth: remove nic $str_nic_name" - echo "configeth on $NODE: remove nic $str_nic_name" + log_info "configeth on $NODE: remove nic $str_nic_name" if [ "$str_os_type" = "aix" ];then old_ifs=$IFS @@ -392,7 +393,7 @@ if [ "$1" = "-r" ];then fi done logger -t xcat -p local4.err "configeth run command: chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down" - echo "configeth on $NODE run command: chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down" + log_info "configeth on $NODE run command: chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down" chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down else #shut down the nic if it is on @@ -412,7 +413,7 @@ if [ "$1" = "-r" ];then elif [ "$1" = "-s" ];then if [ $# -lt 2 ];then logger -t xcat -p local4.err "configeth: config install nic, but the nic name is missed" - echo "configeth on $NODE: config install nic, but the nic name is missed" + log_error "configeth on $NODE: config install nic, but the nic name is missed" exit 1 fi str_inst_nic=$2 @@ -423,8 +424,8 @@ elif [ "$1" = "-s" ];then if [ "$str_os_type" = "aix" ];then logger -t xcat -p local4.err "configeth: aix does not support -s flag" - echo "configeth on $NODE: aix does not support -s flag" - exit 0 + log_error "configeth on $NODE: aix does not support -s flag" + exit 1 elif [ -f "/etc/debian_version" ];then str_lease_file="/var/lib/dhcp/dhclient."$str_inst_nic".leases" if [ -e "$str_lease_file" ];then @@ -502,7 +503,7 @@ elif [ "$1" = "-s" ];then if [ -z "$str_inst_ip" -o -z "$str_inst_mask" ];then logger -t xcat -p local4.err "configeth: config install nic, can not find the information from lease file, return." - echo "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." + log_info "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." exit 0 fi @@ -648,7 +649,7 @@ fi #3. on linux modify the configuration files if [ $# -ne 3 ];then logger -t xcat -p local4.err "configeth: paramters error currently is $@" - echo "configeth on $NODE: paramters error currently is $@" + log_error "configeth on $NODE: paramters error currently is $@" exit 1 fi str_nic_name=$1 @@ -706,7 +707,7 @@ while [ $num_index -le $NETWORKS_LINES ];do done logger -t xcat -p local4.err "configeth: new configuration" -echo "configeth on $NODE: new configuration" +log_info "configeth on $NODE: new configuration" num_index=0 str_ipv6_gateway='' while [ $num_index -lt ${#array_nic_ips[*]} ];do @@ -715,7 +716,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do str_netname=${array_nic_networks[$num_index]} if [ ! $str_netname ];then logger -t xcat -p local4.err "configeth: Network name is not defined on $str_nic_name for $str_ip." - echo "configeth on $NODE: Network name is not defined on $str_nic_name for $str_ip." + log_error "configeth on $NODE: Network name is not defined on $str_nic_name for $str_ip." num_index=$((num_index+1)) continue fi @@ -724,7 +725,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do str_line=${array_nic_network_config[$num_index]} if [ ! $str_line ];then logger -t xcat -p local4.err "configeth: Network object $str_netname is not defined." - echo "configeth on $NODE: Network object $str_netname is not defined." + log_error "configeth on $NODE: Network object $str_netname is not defined." num_index=$((num_index+1)) continue fi @@ -737,7 +738,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do if [ ! $str_subnet -o ! $str_netmask ];then logger -t xcat -p local4.err "configeth: subnet or netmask is not defined in network object $str_netname." - echo "configeth on $NODE: subnet or netmask is not defined in network object $str_netname." + log_error "configeth on $NODE: subnet or netmask is not defined in network object $str_netname." num_index=$((num_index+1)) continue fi @@ -768,7 +769,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do str_ip_mask_pair=$str_ip_mask_pair"${str_ip}_${str_netmask} " else logger -t xcat -p local4.err "configeth: the ipaddress( $str_ip ) for $str_nic_name is invalid." - echo "configeth on $NODE: the ipaddress( $str_ip ) for $str_nic_name is invalid." + log_error "configeth on $NODE: the ipaddress( $str_ip ) for $str_nic_name is invalid." fi num_index=$((num_index+1)) done @@ -788,7 +789,7 @@ if [ "$str_os_type" = "aix" ];then else chdev -l $str_nic_name -a netaddr='' -a netmask='' logger -t xcat -p local4.err "configeth: delete undefined ip address $str_old_ip" - echo "configeth on $NODE: delete undefined ip address $str_old_ip" + log_error "configeth on $NODE: delete undefined ip address $str_old_ip" fi fi @@ -856,7 +857,7 @@ if [ "$str_os_type" = "aix" ];then str_ip_status=$(hashget hash_new_config $str_new_ip) if [ "$str_ip_status" = "new" ];then logger -t xcat -p local4.err "configeth: add $str_new_ip for $str_nic_name temporary." - echo "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." + log_info "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." add_ip_temporary $str_new_ip $str_nic_name fi done @@ -891,7 +892,7 @@ else else bool_modify_flag=1 logger -t xcat -p local4.err "configeth: delete $str_old_ip for $str_nic_name temporary." - echo "configeth on $NODE: delete $str_old_ip for $str_nic_name temporary." + log_info "configeth on $NODE: delete $str_old_ip for $str_nic_name temporary." str_old_ip=`echo $str_old_ip | tr '_' '/'` ip addr del $str_old_ip dev $str_nic_name fi @@ -929,7 +930,7 @@ else bool_modify_flag=1 if [ $bool_restart_flag -eq 0 ];then logger -t xcat -p local4.err "configeth: add $str_new_ip for $str_nic_name temporary." - echo "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." + log_info "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." add_ip_temporary $str_new_ip $str_nic_name fi fi @@ -940,7 +941,7 @@ else ip -6 route | grep default | grep $str_ipv6_gateway if [ $? -ne 0 ];then logger -t xcat -p local4.err "configeth: the default ipv6 route changes to $str_ipv6_gateway." - echo "configeth on $NODE: the default ipv6 route changes to $str_ipv6_gateway." + log_info "configeth on $NODE: the default ipv6 route changes to $str_ipv6_gateway." ip -6 route del default ip -6 route add default $str_ipv6_gateway dev $str_dev_name fi @@ -963,7 +964,7 @@ else done fi logger -t xcat -p local4.err "configeth: $str_nic_name changed, modify the configuration files" - echo "configeth on $NODE: $str_nic_name changed, modify the configuration files" + log_info "configeth on $NODE: $str_nic_name changed, modify the configuration files" num_ipv4_index=0 num_ipv6_index=0 num_index=0 @@ -1020,7 +1021,7 @@ else done else logger -t xcat -p local4.err "configeth: $str_nic_name no changed, return directly." - echo "configeth on $NODE: $str_nic_name no changed, return directly." + log_warn "configeth on $NODE: $str_nic_name no changed, return directly." fi #restart the nic diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 80ef76c1a..bb0a90cec 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -1,12 +1,16 @@ -#!/bin/bash +#!/bin/bash #------------------------------------------------------------------------------- # confignetwork -# Used on Redhat only. Configure bond/vlan/linux bridge/ on the nodes +# Configure Ethernet nic/bond/vlan/bridge/ on the nodes +# Configure Ethernet nic support redhat sles and ubuntu OS, confignetwork use configeth to realize this work. +# Configure bond/vlan/bridge support redhat only. # # You can configure nicdevices,nictypes,nicips,nicnetworks in nics table -# Then you can run the following commands on MN: +# 1. If you want to configure install nic and other nics, you can run the following command on MN: +# updatenode noderange "confignetwork -s" +# 2. If you want to configure nics except install nic, you can run the following command on MN: # updatenode noderange confignetwork -# confignetwork can be used in postscript too. +# 3. confignetwork can be used in postscripts or postbootscripts too. # ############################################################################ @@ -18,13 +22,12 @@ if [ x"$str_os_type" = "xLinux" ];then . $str_dir_name/nicutils.sh else log_error "Does NOT support non-Linux Operating System." - exit -1 + exit 1 fi - ###################################################################### # -# OS support +# OS support checking # Check OS version and get the directory of network configuration file # ##################################################################### @@ -39,18 +42,78 @@ if [ -f "/etc/redhat-release" ];then elif [ -f "/etc/SuSE-release" -o -n "$str_temp" ];then is_sles=1 nwdir="/etc/sysconfig/network" - log_error "Only supports RHEL" - exit -1 elif [ -f "/etc/debian_version" ];then nwdir="/etc/network/interfaces.d" is_debian=1 - log_error "Only supports RHEL" - exit -1 else - log_error "Only supports RHEL" - exit -1 + log_error "Only supports Linux" + exit 1 fi +###################################################################### +# +# get network configuration file content +# +#################################################################### +function get_nic_cfg_file_content { + cfg_dev=$1 + cfg_file='' + if [ $is_redhat -eq 1 ] || [ $is_sles -eq 1 ]; then + cfg_file="$nwdir/ifcfg-${cfg_dev}" + elif [ $is_debian -eq 1 ]; then + cfg_file="$nwdir/${cfg_dev}" + fi + + if [ -f $cfg_file ]; then + echo "['${cfg_file}']" >&2 + cat ${cfg_file}| $sed -e 's/^/ >> /g' | log_lines info + else + log_error "Can not find $cfg_file." + errorcode=1 + fi +} + +###################################################################### +# +# Parser input arguments +# +##################################################################### +boot_install_nic=0 +for arg in "$@" +do + if [ "$arg" = "-s" ];then + boot_install_nic=1 + fi + #TODO: IB support is TBD +done +if [ "$SETINSTALLNIC" = "1" ] || [ "$SETINSTALLNIC" = "yes" ]; then + bool_install_nic=1 +fi + +###################################################################### +# +# Preparation for installnic +# +##################################################################### +function get_installnic { + + tmp_installnic="mac" + [ $INSTALLNIC ] && tmp_installnic=$INSTALLNIC + + instnic='' + if [ "$tmp_installnic" = "mac" ];then + if [ -n "$MACADDRESS" ]; then + instnic=`ip -o link | grep -i "$MACADDRESS" | awk '{print $2;}' | sed s/://` + else + errorcode=1 + fi + elif [ `echo $tmp_installnic | grep -E "e(n|th|m)[0-9a-zA-Z]+"` ];then + instnic=$tmp_installnic + else + errorcode=1 + fi + echo $instnic +} ####################################################################################### # @@ -120,6 +183,19 @@ function find_nic_type { echo $(hashget "nictypes" $nic) } +################################################################ +# +# find nic custom scripts +# +# input : nic +# +# output : niccustomscripts from nics table +# +############################################################### +function find_nic_custom_scripts { + [ $1 ] && echo $(hashget "niccustomscripts" "$1") +} + ################################################################ # @@ -231,14 +307,29 @@ function sort_nics_device_order { while [ $num1 -lt $max1 ]; do alonenic=`echo "$alone_nics"|sed -n "${num1}p"|sed "s/ //g"` + #make sure alonenic does not have base device echo "$nics_list"| grep "$alonenic" >/dev/null if [ $? -ne 0 ]; then - echo $alonenic + #pre-check nicips nictype nicnetworks for alone nic + #nicips nictype and nicnetworks should be configured in nics table for alone nic + alonenicips=`find_nic_ips $alonenic` + alonenictype=`find_nic_type $alonenic` + alonenicnetwork=`query_nicnetworks_net $alonenic` + if [ -n "$alonenicips" ] && [ -n "$alonenictype" ] && [ -n "$alonenicnetwork" ]; then + #if alone nic configure nicips, it is valid + echo $alonenic + else + errorcode=1 + echo "Error: nicips,nictype and nicnetwork should be configured in nics table for $alonenic." + ((num1+=1)) + continue + fi fi ((num1+=1)) done - # - if [ -n "$nics_list" ]; then + + if [ -n "$nics_list" ]; then + if [ $is_redhat -eq 1 ]; then num=1 max=`echo "$nics_list"|wc -l` ((max+=1)) @@ -302,6 +393,9 @@ function sort_nics_device_order { fi ((num+=1)) done + else + log_error "Error: only support configure bond/vlan/bridge on redhat." + fi fi new_order=$eth_slot" "$bond_slot" "$vlan_slot new_order_list="" @@ -336,6 +430,36 @@ function configure_nicdevice { ((max+=1)) while [ $num -lt $max ]; do + nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` + #If install nic is configured, skip to reconfigure it + if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 ]; then + log_warn "install nic $nic_dev has been configured, skip to reconfigure it." + ((num+=1)) + continue + fi + #processing custom scripts for nic + customcmd=`find_nic_custom_scripts $nic_dev` + customscript=`echo $customcmd|awk '{print $1}'` + if [ -n "$customscript" ]; then + if [ -f "/install/postscript/$customscript" ]; then + #if there is no custom script in /install/postscript,exit this loop + log_error "/install/postscript/$customscript does not exist." + errorcode=1 + ((num+=1)) + continue + fi + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + log_info "processing custom scripts:\"$customcmd\" for interface $nic_dev" + $customcmd + if [ $? -ne 0 ]; then + errorcode=1 + fi + + #if custom script is finished, go to configure next nic/nic_pair + ((num+=1)) + continue + fi + #get base nic and its type base_nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $2}'` if [ -n "$base_nic_dev" ]; then if echo "$base_nic_dev"|grep "@" >/dev/null; then @@ -347,17 +471,23 @@ function configure_nicdevice { base_nic_type=`find_nic_type "$base_temp_nic" | $utolcmd` fi - nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` nic_dev_type=`find_nic_type "$nic_dev" | $utolcmd` echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" + #configure standalone ethernet nic if [ x"$nic_dev_type" = "xethernet" ]; then - - ipaddr=`find_nic_ips $nic_dev|awk -F"|" '{print $1}'` - if [ -n "$ipaddr" ]; then - create_ethernet_interface ifname=$nic_dev _ipaddr=$ipaddr + xcatnet=`query_nicnetworks_net $nic_dev` + ipaddrs=`find_nic_ips $nic_dev` + if [ -n "$ipaddrs" ]; then + log_info "configure $nic_dev" + log_info "call: configeth $nic_dev $ipaddrs $xcatnet" + configeth $nic_dev $ipaddrs $xcatnet + if [ $? -ne 0 ]; then + errorcode=1 + fi + get_nic_cfg_file_content $nic_dev else log_warn "There is no ip for $nic_dev." ((noip+=1)) @@ -367,6 +497,7 @@ function configure_nicdevice { log_error "There is no any ip configured for any nic. Check nicips in nics table first." errorcode=1 fi + #configure bridge #linux bridge type is bridge #openvswitch bridge type is bridge_ovs @@ -387,6 +518,8 @@ function configure_nicdevice { #configure bond elif [ x"$nic_dev_type" = "xbond" ]; then create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond + elif [ x"$nic_dev_type" = "xinfiniband" ]; then + log_error "confignetwork does not support configure IB. " else log_error "Error : please check nictypes for $nic_pair." errorcode=1 @@ -424,10 +557,30 @@ function enable_network_service { ############################################################################ errorcode=0 - #nictypes should support capital letters, for example, Ethernet and ethernet utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" +#get for installnic +installnic='' +installnic=`get_installnic` +instnic_conf=0 +if [ $boot_install_nic -eq 1 ];then + if [ -n "$installnic" ]; then + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + log_info "configure the install nic $installnic. " + instnic_conf=1 + configeth -s $installnic |log_lines info + if [ $? -ne 0 ]; then + errorcode=1 + fi + get_nic_cfg_file_content $installnic + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + else + log_error "Can not determine proper install nic." + errorcode=1 + fi +fi + #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` @@ -440,6 +593,8 @@ parser_nic_attribute "$NICTYPES" "nictypes" #make hash for nicips parser_nic_attribute "$NICIPS" "nicips" +#make hash for niccustomscripts +parser_nic_attribute "$NICCUSTOMSCRIPTS" "niccustomscripts" #get nic and its device pair, for example #eth0.6 eth0 @@ -449,26 +604,27 @@ parser_nic_attribute "$NICIPS" "nicips" new_nicdevice=`find_nic_and_device_list $str_all_nics|sort -g -k1 -g -k2|uniq` if [ -z "$new_nicdevice" ]; then log_info "There is no nic device to configure." - exit + exit $errorcode fi -#enable network service -enable_network_service - #sort nics device pair based on nicdevice type sorted_nicdevice_list=`sort_nics_device_order "$new_nicdevice"` #If there is invalid nics pair, errorcode is 1 invalid_nicdevice_pair=`echo "$sorted_nicdevice_list" | grep "Error"` if [ $? -eq 0 ]; then -log_error $invalid_nicdevice_pair -errorcode=1 + echo "$invalid_nicdevice_pair"|log_lines error + errorcode=1 fi #delete invalid nics device pair based on Error -valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d'` -log_info "All valid nics and device list:" -echo "$valid_sorted_nicdevice_list" |log_lines info +valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d'` +if [ -n "$valid_sorted_nicdevice_list" ]; then + log_info "All valid nics and device list:" + echo "$valid_sorted_nicdevice_list" |log_lines info +fi +#enable network service +enable_network_service #config nics and ifcfg files configure_nicdevice "$valid_sorted_nicdevice_list" From f5126227ceaf0d4cd03769261b3acb9e5c22208d Mon Sep 17 00:00:00 2001 From: yangsong Date: Fri, 23 Jun 2017 03:18:03 -0500 Subject: [PATCH 199/201] refine the PR 3268:support service node pool (#3323) Fix the issue that grub2 config file is wrong when node.tftpserver="" --- xCAT-server/lib/xcat/plugins/anaconda.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 5b61b8326..fb2a7cd19 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -607,7 +607,7 @@ sub mknetboot $xcatmaster = '!myipfn!'; #allow service nodes to dynamically nominate themselves as a good contact point, this is of limited use in the event that xcat is not the dhcp/tftp server } - if ($ient and $ient->{tftpserver}) + if ($ient and $ient->{tftpserver} and $ient->{tftpserver} ne '') { $imgsrv = $ient->{tftpserver}; } From 4176017b1716ba285ea364948235be3d4361dbf8 Mon Sep 17 00:00:00 2001 From: XuWei Date: Sun, 25 Jun 2017 23:06:54 -0400 Subject: [PATCH 200/201] Fix issue 3327, check environment of request type in openbmc and bmcdiscover --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 2 ++ xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index fdf03b3b7..c7b3ae80c 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -85,6 +85,8 @@ sub process_request #$::args = $request->{arg}; if (ref($request->{environment}) eq 'ARRAY' and ref($request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}) eq 'ARRAY') { $::XCAT_DEV_WITHERSPOON = $request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}->[0]; + } elsif (ref($request->{environment}) eq 'ARRAY') { + $::XCAT_DEV_WITHERSPOON = $request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}; } else { $::XCAT_DEV_WITHERSPOON = $request->{environment}->{XCAT_DEV_WITHERSPOON}; } diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 3c30b1407..ec95782b5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -283,6 +283,8 @@ sub preprocess_request { if (ref($request->{environment}) eq 'ARRAY' and ref($request->{environment}->[0]->{XCAT_OPENBMC_DEVEL}) eq 'ARRAY') { $::OPENBMC_DEVEL = $request->{environment}->[0]->{XCAT_OPENBMC_DEVEL}->[0]; + } elsif (ref($request->{environment}) eq 'ARRAY') { + $::OPENBMC_DEVEL = $request->{environment}->[0]->{XCAT_OPENBMC_DEVEL}; } else { $::OPENBMC_DEVEL = $request->{environment}->{XCAT_OPENBMC_DEVEL}; } From b2d434a22fb71b5bf7095922e93e1d1202a87c4a Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 26 Jun 2017 02:01:47 -0400 Subject: [PATCH 201/201] fix sles11.4 testcase failure --- xCAT-test/autotest/testcase/confignics/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index c00b7676d..b6f5e92e0 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -173,7 +173,7 @@ check:rc==0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~11.1.0.100 check:output!~dhcp -cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1; fi +cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~12.1.0.100 check:output!~dhcp cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi