From b9fe54cffdc66ed49a0e86a6bee1cd6aac85f2ac Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 30 Mar 2016 07:09:05 -0400 Subject: [PATCH 01/52] add docker test case --- xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle | 13 + .../autotest/testcase/dockercommand/cases0 | 264 ++++++++++++++++++ .../ubuntu_full_installation_vm_docker | 54 ++++ 3 files changed, 331 insertions(+) create mode 100644 xCAT-test/autotest/testcase/dockercommand/cases0 create mode 100644 xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker diff --git a/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle b/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle index 9a4fc47a9..4b67d0bc1 100644 --- a/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle +++ b/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle @@ -241,3 +241,16 @@ switchdiscover_range_x switchdiscover_range_z switchdiscover_range_z_V nodeset_check_warninginfo +rpower_stop +rpower_start +rpower_state +rpower_restart +rpower_pause +rpower_unpause +mkdocker_h +mkdocker_command +rmdocker_h +rmdocker_command +rmdocker_f_command +lsdocker_h_command +lsdocker_l_command diff --git a/xCAT-test/autotest/testcase/dockercommand/cases0 b/xCAT-test/autotest/testcase/dockercommand/cases0 new file mode 100644 index 000000000..a5e19c4db --- /dev/null +++ b/xCAT-test/autotest/testcase/dockercommand/cases0 @@ -0,0 +1,264 @@ +start:rpower_stop +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN stop +check:rc==0 +check:ouptut=~container already stoped +cmd:rpower $$DOCKERCN restart +check:ouptut=~success +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~running +cmd:rpower $$DOCKERCN stop +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~exited +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:rpower_start +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~created +cmd:rpower $$DOCKERCN start +check:rc==0 +check:output=~success +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~running +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_state +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~created +cmd:rpower $$DOCKERCN restart +check:rc==0 +check:output=~success +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~running +cmd:rpower $$DOCKERCN stop +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~exited +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_restart +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~created +cmd:rpower $$DOCKERCN restart +check:rc==0 +check:output=~success +cmd:sleep 6 +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:sleep 6 +cmd:rpower $$DOCKERCN restart +check:rc==0 +check:output=~success +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_pause +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN pause +check:rc!=0 +check:output=~ Cannot pause container $$DOCKERCN +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rpower $$DOCKERCN pause +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~paused +cmd:rpower $$DOCKERCN unpause +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_unpause +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rpower $$DOCKERCN pause +check:ouptut=~paused +cmd:rpower $$DOCKERCN unpause +check:rc==0 +check:output=~success +cmd:sleep 6 +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:sleep 6 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:mkdocker_h +cmd:mkdocker -h +check:rc==0 +check:output=~Usage: mkdocker +end +start:mkdocker_command +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:lsdocker $$DOCKERCN +check:rc==0 +check:output=~$$DOCKERIMAGE +check:output=~$$DOCKERCOMMAND +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~$$DOCKERCN: created +cmd:rpower $$DOCKERCN start +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:xdsh $$DOCKERHOST "docker ps -l" +check:output=~$$DOCKERCN +check:rc==0 +cmd:ping $$DOCKERCN -c 3 +check:output=~64 bytes from $$DOCKERCN +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:rmdocker_h +cmd:rmdocker -h +check:rc==0 +check:output=~Usage: rmdocker +end +start:rmdocker_command +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:lsdocker $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN +check:rc==0 +cmd:lsdocker -l $$DOCKERCN +check:rc!=0 +check:output=~ Error: No such container +cmd:makehosts -d $$DOCKERCN +check:rc==0 +end +start:rmdocker_f_command +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:lsdocker $$DOCKERCN +check:rc==0 +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rmdocker $$DOCKERCN +chec:rc!=0 +check:output=~Stop the container before attempting removal or use -f +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:lsdocker_h_command +cmd:lsdocker -h +check:rc==0 +check:output=~Usage: lsdocker +end +start:lsdocker_l_command +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:lsdocker -l $$DOCKERCN +check:rc==0 +check:output=~$$DOCKERCN +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker new file mode 100644 index 000000000..3e7df1837 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -0,0 +1,54 @@ +start:Full_installation_flat_docker +os:Linux +cmd:copycds $$ISO +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,arch)__" != "ppc64" ]];then chdef -t node -o $$DOCKERHOST vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$DOCKERHOST -f -p && mkvm $$DOCKERHOST -s 40G; fi +check:rc==0 +cmd:makehosts $$DOCKERHOST +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:sleep 60 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:makeconservercf $$DOCKERHOST +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$DOCKERHOST +check:output=~$$DOCKERHOST +cmd: mkdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost -u profile=compute provmethod=install +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'` ; chdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost otherpkgdir="https://apt.dockerproject.org/repo ubuntu-trusty main,http://cz.archive.ubuntu.com/ubuntu trusty main" otherpkglist="/install/custom/ubuntu$ver/ubuntu"$ver"_docker.pkglist" osdistroname="__GETNODEATTR($$DOCKERHOST,os)__ ";fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'` ; mkdir -p /install/custom/ubuntu$ver/ ; chdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost otherpkglist="/install/custom/ubuntu$ver/ubuntu"$ver"_docker.pkglist" pkglist="/install/custom/ubuntu$ver/ubuntu$ver.pkglist";fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'` ;for i in openssh-server ntp gawk nfs-common snmpd bridge-utils; do cat /install/custom/ubuntu$ver/ubuntu$ver.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /install/custom/ubuntu$ver/ubuntu$ver.pkglist; fi done;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu14.04" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'`; for i in docker-engine;do cat /install/custom/ubuntu$ver/ubuntu"$ver"\_docker.pkglist |grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /install/custom/ubuntu$ver/ubuntu"$ver"\_docker.pkglist;fi done;fi +check:rc==0 +cmd: chdef $$DOCKERHOST -p postbootscripts="setupdockerhost mynet0=$$MYNET0VALUE@$$DOCKERHOSIP:$$NICNAME" +check:rc==0 +cmd:nodeset $$DOCKERHOST osimage=__GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost +check:rc==0 +cmd:rpower $$DOCKERHOST boot +check:rc==0 +cmd:sleep 40 +cmd:lsdef -l $$DOCKERHOST | grep status +cmd:sleep 3600 +check:rc==0 +cmd:ping $$DOCKERHOST -c 3 +check:output=~64 bytes from $$DOCKERHOST +check:rc==0 +cmd:lsdef -l $$DOCKERHOST | grep status +check:output=~booted +cmd:xdsh $$DOCKERHOST date +check:rc==0 +cmd:xdsh $$DOCKERHOST "docker -v" +check:output=~Docker version +check:rc==0 +cmd:xdsh $$DOCKERHOST "docker pull $$DOCKERIMAGE" +check:rc==0 +cmd:rmdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost +check:rc==0 +end From c0b0b5951cbd756890f934847af3a3ccdc099461 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 31 Mar 2016 02:40:16 -0400 Subject: [PATCH 02/52] add description for testcases --- xCAT-test/autotest/testcase/dockercommand/cases0 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xCAT-test/autotest/testcase/dockercommand/cases0 b/xCAT-test/autotest/testcase/dockercommand/cases0 index a5e19c4db..85ff74ce9 100644 --- a/xCAT-test/autotest/testcase/dockercommand/cases0 +++ b/xCAT-test/autotest/testcase/dockercommand/cases0 @@ -1,4 +1,5 @@ start:rpower_stop +description:stop a created docker instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -25,6 +26,7 @@ cmd:rmdef $$DOCKERCN check:rc==0 end start:rpower_start +description:start a created docker instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -49,6 +51,7 @@ check:rc==0 end start:rpower_state +description:get state of the instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -80,6 +83,7 @@ check:rc==0 end start:rpower_restart +description:restart a created docker instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -109,6 +113,7 @@ check:rc==0 end start:rpower_pause +decription:pause all processes in the instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -135,6 +140,7 @@ check:rc==0 end start:rpower_unpause +description:unpause all processes in the instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -160,11 +166,13 @@ cmd:rmdef $$DOCKERCN check:rc==0 end start:mkdocker_h +description:output usage for mkdocker cmd:mkdocker -h check:rc==0 check:output=~Usage: mkdocker end start:mkdocker_command +description:create docker instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -195,11 +203,13 @@ cmd:rmdef $$DOCKERCN check:rc==0 end start:rmdocker_h +description:output usage for rmdocker cmd:rmdocker -h check:rc==0 check:output=~Usage: rmdocker end start:rmdocker_command +description:remove docker instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -218,6 +228,7 @@ cmd:makehosts -d $$DOCKERCN check:rc==0 end start:rmdocker_f_command +description:force to remove docker instance cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -241,11 +252,13 @@ cmd:rmdef $$DOCKERCN check:rc==0 end start:lsdocker_h_command +description:output usage for lsdocker cmd:lsdocker -h check:rc==0 check:output=~Usage: lsdocker end start:lsdocker_l_command +description:list docker instance info cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN From a9cc5750c0520a3b8357dd4dbb3f36b9c7090be6 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 7 Apr 2016 08:39:13 -0400 Subject: [PATCH 03/52] modify docker testcase according to comments --- .../autotest/testcase/dockercommand/cases0 | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/xCAT-test/autotest/testcase/dockercommand/cases0 b/xCAT-test/autotest/testcase/dockercommand/cases0 index 85ff74ce9..59f327d31 100644 --- a/xCAT-test/autotest/testcase/dockercommand/cases0 +++ b/xCAT-test/autotest/testcase/dockercommand/cases0 @@ -18,10 +18,10 @@ cmd:rpower $$DOCKERCN stop check:rc==0 cmd:rpower $$DOCKERCN state check:output=~exited -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -42,10 +42,10 @@ check:output=~success cmd:rpower $$DOCKERCN state check:rc==0 check:output=~running -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -74,10 +74,10 @@ cmd:rpower $$DOCKERCN start check:rc==0 cmd:rpower $$DOCKERCN state check:output=~running -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -104,10 +104,10 @@ check:rc==0 check:output=~success cmd:rpower $$DOCKERCN state check:output=~running -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -131,10 +131,10 @@ cmd:rpower $$DOCKERCN state check:output=~paused cmd:rpower $$DOCKERCN unpause check:rc==0 -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -158,10 +158,10 @@ cmd:sleep 6 cmd:rpower $$DOCKERCN state check:output=~running cmd:sleep 6 -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -172,7 +172,7 @@ check:rc==0 check:output=~Usage: mkdocker end start:mkdocker_command -description:create docker instance +description:create docker instance image should be ubuntu and command should be bash here cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker check:rc==0 cmd:makehosts $$DOCKERCN @@ -195,9 +195,9 @@ check:output=~$$DOCKERCN check:rc==0 cmd:ping $$DOCKERCN -c 3 check:output=~64 bytes from $$DOCKERCN -cmd:makehosts -d $$DOCKERCN +cmd:rmdocker $$DOCKERCN -f check:rc==0 -cmd:rmdocker $$DOCKERCN -f +cmd:makehosts -d $$DOCKERCN check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 @@ -226,6 +226,8 @@ check:rc!=0 check:output=~ Error: No such container cmd:makehosts -d $$DOCKERCN check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 end start:rmdocker_f_command description:force to remove docker instance @@ -243,11 +245,11 @@ check:rc==0 cmd:rmdocker $$DOCKERCN chec:rc!=0 check:output=~Stop the container before attempting removal or use -f -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 check:output=~$$DOCKERCN: success +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end @@ -268,10 +270,10 @@ check:rc==0 cmd:lsdocker -l $$DOCKERCN check:rc==0 check:output=~$$DOCKERCN -cmd:makehosts -d $$DOCKERCN -check:rc==0 cmd:rmdocker $$DOCKERCN -f check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 cmd:rmdef $$DOCKERCN check:rc==0 end From c4b7f5505f0746e56c515db3b8b8b544d7e4a94c Mon Sep 17 00:00:00 2001 From: penguhyang Date: Thu, 7 Apr 2016 22:18:32 -0400 Subject: [PATCH 04/52] change the rscan output format --- xCAT-server/lib/xcat/plugins/kvm.pm | 52 ++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 9da8ec168..dd881b5d2 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3055,6 +3055,17 @@ sub rscan { $hash_vm2host{$vm_node_host->{node}} = $vm_node_host->{host}; } + my @maxlength; + my @rscan_header = ( + ["type", "" ], + ["name", "" ], + ["hypervisor", "" ], + ["id", "" ], + ["cpu", "" ], + ["memory", "" ], + ["nic", "" ], + ["disk", "" ]); + #operate every domain in current hypervisor foreach $dom (@doms) { my $name=$dom->get_name(); @@ -3071,16 +3082,31 @@ sub rscan { $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)/$4$3$2$1-$6$5-$8$7/; } my $type = $domain->findnodes("/domain")->[0]->getAttribute("type"); + if (length($type) > $maxlength[0]) { + $maxlength[0] = length($type); + } my @nodeobj = $domain->findnodes("/domain/name"); if (@nodeobj and defined($nodeobj[0])) { $node = $nodeobj[0]->to_literal; } + if (length($node) > $maxlength[1]) { + $maxlength[1] = length($node); + } my $hypervisor = $hyper; + if (length($hypervisor) > $maxlength[2]) { + $maxlength[2] = length($hypervisor); + } my $id = $domain->findnodes("/domain")->[0]->getAttribute("id"); + if (length($id) > $maxlength[3]) { + $maxlength[3] = length($id); + } my @vmcpusobj = $domain->findnodes("/domain/vcpu"); if (@vmcpusobj and defined($vmcpusobj[0])) { $vmcpus = $vmcpusobj[0]->to_literal; } + if (length($vmcpus) > $maxlength[4]) { + $maxlength[4] = length($vmcpus); + } my @vmmemoryobj = $domain->findnodes("/domain/memory"); if (@vmmemoryobj and defined($vmmemoryobj[0])) { my $mem = $vmmemoryobj[0]->to_literal; @@ -3105,6 +3131,9 @@ sub rscan { $vmmemory=($mem*1024)/(1024*1024); } } + if (length($vmmemory) > $maxlength[5]) { + $maxlength[5] = length($vmmemory); + } my @vmstoragediskobjs = $domain->findnodes("/domain/devices/disk"); foreach my $vmstoragediskobj (@vmstoragediskobjs) { if (($vmstoragediskobj->getAttribute("device") eq "disk") and ($vmstoragediskobj->getAttribute("type") eq "file")) { @@ -3115,6 +3144,9 @@ sub rscan { } } } + if (length($vmstorage) > $maxlength[7]) { + $maxlength[7] = length($vmstorage); + } my @archobj = $domain->findnodes("/domain/os/type"); if (@archobj and defined($archobj[0])) { $arch = $archobj[0]->getAttribute("arch"); @@ -3133,6 +3165,9 @@ sub rscan { } } } + if (length($vmnics) > $maxlength[6]) { + $maxlength[6] = length($vmnics); + } push @{$host2kvm{$uuid}}, join( ",", $type,$node,$hypervisor,$id,$vmcpus,$vmmemory,$vmnics,$vmstorage,$arch,$mac,$vmnicnicmodel ); if ($write) { unless (exists $hash_vm2host{$node}) { @@ -3222,15 +3257,14 @@ sub rscan { if (!$stanza) { my $header; - my @rscan_header = ( - ["type", "%-8s" ], - ["name", "%-9s" ], - ["hypervisor", "%-15s"], - ["id", "%-7s" ], - ["cpu", "%-8s" ], - ["memory", "%-11s"], - ["nic", "%-8s" ], - ["disk", "%-9s" ]); + $rscan_header[0][1] = sprintf "%%-%ds",($maxlength[0]+3); + $rscan_header[1][1] = sprintf "%%-%ds",($maxlength[1]+3); + $rscan_header[2][1] = sprintf "%%-%ds",($maxlength[2]+3); + $rscan_header[3][1] = sprintf "%%-%ds",($maxlength[3]+3); + $rscan_header[4][1] = sprintf "%%-%ds",($maxlength[4]+3); + $rscan_header[5][1] = sprintf "%%-%ds",($maxlength[5]+3); + $rscan_header[6][1] = sprintf "%%-%ds",($maxlength[6]+3); + $rscan_header[7][1] = sprintf "%%-%ds",($maxlength[7]+3); foreach (@rscan_header) { $header .= sprintf ( @$_[1], @$_[0] ); } From f3ed115bf5e724a49deb77c8257649ec910adf2d Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 22 Feb 2016 03:13:10 -0500 Subject: [PATCH 05/52] add description of -u and -p for rsetboot;patch pasu with the latest version --- xCAT-client/pods/man1/rsetboot.1.pod | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-client/pods/man1/rsetboot.1.pod b/xCAT-client/pods/man1/rsetboot.1.pod index d9540bc1a..21295325d 100644 --- a/xCAT-client/pods/man1/rsetboot.1.pod +++ b/xCAT-client/pods/man1/rsetboot.1.pod @@ -5,16 +5,14 @@ B - Sets the boot device to be used for BMC-based servers for the next =head1 SYNOPSIS -B I {B|B|B|B|B} +B I {B|B|B|B|B} [B<-u>|B<-p>] B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 DESCRIPTION -B sets the boot media that should be used on the next boot of the specified nodes. After the nodes are -booted with the specified device (e.g. via L), the nodes will return to using the -default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. +B sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via L), the nodes will return to using the default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. =head1 OPTIONS @@ -40,6 +38,14 @@ Boot using the default set in BIOS. Display the current boot setting. +=item B<-u> + +To specify the next boot mode to be "UEFI Mode". From Lenovo NX360 M5, if "-u" is not specified, B will force the next boot mode to be "Legacy Mode". + +=item B<-p> + +To make the specified boot device and boot mode settings persistent. + =back =head1 EXAMPLES From afeffe0df1dad8a50393a85b915687e851830594 Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 22 Feb 2016 04:03:48 -0500 Subject: [PATCH 06/52] add description of rsetboot -u/-p in Usage.pm;refine the manpage --- .../references/man1/rsetboot.1.rst | 18 ++++++++++++++---- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rsetboot.1.pod | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst b/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst index 0c8cef953..73f96eaf1 100644 --- a/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst @@ -11,7 +11,7 @@ SYNOPSIS ******** -\ **rsetboot**\ \ *noderange*\ {\ **hd | net | cd | default | stat**\ } +\ **rsetboot**\ \ *noderange*\ {\ **hd | net | cd | default | stat**\ } [\ **-u**\ ] [\ **-p**\ ] \ **rsetboot**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -21,9 +21,7 @@ DESCRIPTION *********** -\ **rsetboot**\ sets the boot media that should be used on the next boot of the specified nodes. After the nodes are -booted with the specified device (e.g. via rpower(1)|rpower.1), the nodes will return to using the -default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. +\ **rsetboot**\ sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via rpower(1)|rpower.1), the nodes will return to using the default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. ******* @@ -62,6 +60,18 @@ OPTIONS +\ **-u**\ + + To specify the next boot mode to be "UEFI Mode". + + + +\ **-p**\ + + To make the specified boot device and boot mode settings persistent. + + + ******** EXAMPLES diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 9bfd043a9..d8fbb63b3 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -96,7 +96,7 @@ my %usage = ( MIC specific: rinv noderange [system|ver|board|core|gddr|all]", "rsetboot" => -"Usage: rsetboot [net|hd|cd|floppy|def|stat] [-V|--verbose] +"Usage: rsetboot [net|hd|cd|floppy|def|stat] [-V|--verbose] [-u] [-p] rsetboot [-h|--help|-v|--version]", "rbootseq" => "Usage: diff --git a/xCAT-client/pods/man1/rsetboot.1.pod b/xCAT-client/pods/man1/rsetboot.1.pod index 21295325d..c9e6b1fd6 100644 --- a/xCAT-client/pods/man1/rsetboot.1.pod +++ b/xCAT-client/pods/man1/rsetboot.1.pod @@ -5,7 +5,7 @@ B - Sets the boot device to be used for BMC-based servers for the next =head1 SYNOPSIS -B I {B|B|B|B|B} [B<-u>|B<-p>] +B I {B|B|B|B|B} [B<-u>] [B<-p>] B [B<-h>|B<--help>|B<-v>|B<--version>] @@ -40,7 +40,7 @@ Display the current boot setting. =item B<-u> -To specify the next boot mode to be "UEFI Mode". From Lenovo NX360 M5, if "-u" is not specified, B will force the next boot mode to be "Legacy Mode". +To specify the next boot mode to be "UEFI Mode". =item B<-p> From 642059b3c247f7d26d3e49daa031a087b7c55792 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 12 Apr 2016 03:18:24 -0400 Subject: [PATCH 07/52] modify more content for bug fixing --- .../advanced/networks/infiniband/index.rst | 4 +- .../mlnxofed_ib_install_v2_diskful.rst | 200 +++++++++++------ .../mlnxofed_ib_install_v2_diskless.rst | 212 ++++++++++-------- .../mlnxofed_ib_install_v2_preparation.rst | 15 +- .../mlnxofed_ib_install_v2_usage.rst | 2 + .../infiniband/mlnxofed_ib_known_issue.rst | 19 ++ .../mlnxofed_ib_verified_scenario_matrix.rst | 15 ++ 7 files changed, 302 insertions(+), 165 deletions(-) create mode 100644 docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst create mode 100644 docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst diff --git a/docs/source/advanced/networks/infiniband/index.rst b/docs/source/advanced/networks/infiniband/index.rst index 1ef66d623..928ab7c80 100644 --- a/docs/source/advanced/networks/infiniband/index.rst +++ b/docs/source/advanced/networks/infiniband/index.rst @@ -1,8 +1,8 @@ Infiniband (Mellanox) ===================== -xCAT offers a certain degree support for Mellanox infiniband product, it help you to configurate Mellanox infiniband products easily. - +xCAT offers a certain degree support for Mellanox infiniband product, it help you to configurate Mellanox infiniband products easily. For more information about Mellanox infiniband, please refer to `Mellanox official site `_. + .. 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 b1eee7fff..b71ac5d37 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 @@ -1,95 +1,151 @@ Configuration for Diskful Installation ======================================= -1. Set script ``mlnxofed_ib_install`` as postbootscript :: +1. Set script ``mlnxofed_ib_install`` as ``postbootscripts`` or ``postscripts`` :: chdef -p postbootscripts="mlnxofed_ib_install -p /install//" + + Or :: + + chdef -p postscripts="mlnxofed_ib_install -p /install//" + + xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drives work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox dreives. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarioes Have Been Verified `. You can try this way in other else scenarios if you needed. -2. Specify dependence package **[required for RHEL and SLES]** +2. Specify dependency package - a) Copy a correct pkglist file **shipped by xCAT** according your environment to the ``/install/custom/install//`` directory, these pkglist files are located under ``/opt/xcat/share/xcat/install//`` :: + Some dependencies need to be installed before running Mellanox scripts. These dependencies are different between different scenario. xCAT configurates these dependency packages by using ``pkglist`` attribute of ``osimage`` definition. Please refer to :doc:`Add Additional Software Packages ` for more information:: - cp /opt/xcat/share/xcat/install//compute...pkglist \ - /install/custom/install//compute...pkglist + # lsdef -t osimage --install-compute + Object name: --install-compute + imagetype=linux + .... + pkgdir=/ + pkglist=//compute..pkglist + .... - b) Edit your ``/install/custom/install//compute...pkglist`` and add one line - - ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist#`` - - You can check directory ``/opt/xcat/share/xcat/ib/netboot//`` and choose one correct ``ib...pkglist`` according your environment. - - - c) Make the related osimage use the customized pkglist :: + You can append the ib dependency packages list in the end of ``//compute..pkglist`` directly like below: :: - chdef -t osimage -o --install-compute \ - pkglist=/install/custom/install//compute...pkglist + #cat //compute..pkglist + @base + @x11 + openssl + ntp + rsyn + #ib part + createrepo + kernel-devel + kernel-source + .... + + + Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute..pkglist`` like below way: :: + + #cat //compute..pkglist + @base + @x11 + openssl + ntp + rsyn + #INCLUDE://# + + xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + + #cat //compute..pkglist + @base + @x11 + openssl + ntp + rsyn + #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# + + Take rhels7.2 on ppc64le for example: :: + + # lsdef -t osimage rhels7.2-ppc64le-install-compute + Object name: rhels7.2-ppc64le-install-compute + imagetype=linux + osarch=ppc64le + osdistroname=rhels7.2-ppc64le + osname=Linux + osvers=rhels7.2 + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + pkgdir=/install/rhels7.2/ppc64le + pkglist=/install/custom/install/rh/compute.rhels7.ib.pkglist + profile=compute + provmethod=install + template=/opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl - Take RHEL 6.4 on x86_64 for example :: - cp /opt/xcat/share/xcat/install/rh/compute.rhels6.x86_64.pkglist \ - /install/custom/install/rh/compute.rhels6.x86_64.pkglist + **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/install/rh/compute.rhels7.ib.pkglist`` is a copy of ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist``. :: + + # cat /install/custom/install/rh/compute.rhels7.ib.pkglist + #Please make sure there is a space between @ and group name + wget + ntp + nfs-utils + net-snmp + rsync + yp-tools + openssh-server + util-linux + net-tools + #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist# + + - Edit the ``/install/custom/install/rh/compute.rhels6.x86_64.pkglist`` and add below line - ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist#`` - - Then ``/install/custom/install/rh/compute.rhels6.x86_64.pkglist`` looks like below :: - - #Please make sure there is a space between @ and group name - #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist# - ntp - nfs-utils - net-snmp - rsync - yp-tools - openssh-server - util-linux-ng - - Then modify related osimage :: - - chdef -t osimage -o rhels6.4-x86_64-install-compute \ - pkglist=/install/custom/install/rh/compute.rhels6.x86_64.pkglist - 3. Install node :: nodeset osimage=--install-compute rsetboot net rpower reset - **[Note]**: - - * In RHEL7.x, after performing all steps above, ``openibd`` doesn't work well. you can resolve this problem depending on `Mellanox OFED Linux Release Notes `_ by yourself. But reboot one more time can resolve all of these complex issues. so **we strongly recommend reboot machine again to avoid unexpected problem in RHEL7.x.** - - * If you performed firmware updates, i.e. you didn't pass ``--without-fw-update`` to option ``-m`` of ``mlnxofed_ib_install``, **reboot machine for all distro** After steps above, you can login target ndoe and find the Mellanox IB drives are located under ``/lib/modules//extra/``. - Issue ``ibstat`` command you can get the IB apater information :: + Issue ``ibv_devinfo`` command you can get the IB apater information :: + + # ibv_devinfo + hca_id: mlx5_0 + transport: InfiniBand (0) + fw_ver: 10.14.2036 + node_guid: f452:1403:0076:10e0 + sys_image_guid: f452:1403:0076:10e0 + vendor_id: 0x02c9 + vendor_part_id: 4113 + hw_ver: 0x0 + board_id: IBM1210111019 + phys_port_cnt: 2 + Device ports: + port: 1 + state: PORT_INIT (2) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand + + port: 2 + state: PORT_DOWN (1) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand + + Using ``service openibd status`` to verify if openibd works well. Below is the output in SLES :: + + #service openibd status + openibd.service - openibd - configure Mellanox devices + Loaded: loaded (/usr/lib/systemd/system/openibd.service; enabled) + Active: active (exited) since Sun 2016-04-10 07:13:46 EDT; 3h 24min ago + Docs: file:/etc/infiniband/openib.conf + Main PID: 48133 (code=exited, status=0/SUCCESS) + CGroup: /system.slice/openibd.service + + Apr 10 07:13:39 c910f05c33 openibd[48133]: [34B blob data] + Apr 10 07:13:46 c910f05c33 openibd[48133]: [49B blob data] + Apr 10 07:14:06 c910f05c33 logger[49644]: openibd: Set node_desc for mlx5_0: HCA-1 + + - [root@server ~]# ibstat - CA 'mlx4_0' - CA type: MT4099 - Number of ports: 2 - Firmware version: 2.11.500 - Hardware version: 0 - Node GUID: 0x5cf3fc000004ec02 - System image GUID: 0x5cf3fc000004ec05 - Port 1: - State: Initializing - Physical state: LinkUp - Rate: 40 (FDR10) - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec03 - Link layer: InfiniBand - Port 2: - State: Down - Physical state: Disabled - Rate: 10 - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec04 - Link layer: InfiniBand 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 37fae36c2..ccdf3005e 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 @@ -1,128 +1,160 @@ Configuration for Diskless Installation ======================================= -1. Specify dependence package **[required for RHEL and SLES]** +1. Specify dependency package - a) Copy a correct pkglist file **shipped by xCAT** according your environment to the ``/install/custom/netboot//`` directory :: + Some dependencies need to be installed before running Mellanox scripts. These dependencies are different between different scenario. xCAT configurates these dependency packages by using ``pkglist`` attribute of ``osimage`` definition. Please refer to :doc:`Add Additional Software Packages ` for more information:: - cp /opt/xcat/share/xcat/netboot//compute...pkglist \ - /install/custom/netboot//compute...pkglist + # lsdef -t osimage --netboot-compute + Object name: --netboot-compute + imagetype=linux + .... + pkgdir=/ + pkglist=//compute..pkglist + .... - b) Edit ``/install/custom/netboot//.pkglist`` and add ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist#`` + You can append the ib dependency packages list in the end of ``//compute..pkglist`` directly like below: :: - For example, on RHEL 6.4 (x86_64): :: + #cat //compute..pkglist + @base + @x11 + openssl + ntp + rsyn + #ib part + createrepo + kernel-devel + kernel-source + .... - cp /opt/xcat/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist \ - /install/custom/netboot/rh/compute.rhels6.x86_64.pkglist - - Edit ``/install/custom/netboot/rh/compute.rhels6.x86_64.pkglist`` and add ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist#`` - - Then ``/install/custom/netboot/rh/compute.rhels6.x86_64.pkglist`` looks like below :: - #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist# - bash - nfs-utils - openssl - dhclient - ..... + Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute..pkglist`` like below way: :: + + #cat //compute..pkglist + @base + @x11 + openssl + ntp + rsyn + #INCLUDE://# + + xCAT ships some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + + #cat //compute..pkglist + @base + @x11 + openssl + ntp + rsyn + #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# + 2. Prepare postinstall scripts - a) Specify a correct postinstall script **shipped by xCAT** :: - - mkdir -p /install/custom/netboot// - - cp /opt/xcat/share/xcat/netboot//.postinstall \ - /install/custom/netboot// - - chmod +x /install/custom/netboot//.postinstall + Edit ``postinstall`` script to trigger IB drvices installation during ``genimage``. Using below command to find out where the ``postinstall`` script is saved. :: + + # lsdef -t osimage --netboot-compute + Object name: --netboot-compute + .... + postinstall=/..postinstall + .... + - Take RHEL 6.4 on x86_64 for example :: - - mkdir -p /install/custom/netboot/rh/ - cp /opt/xcat/share/xcat/netboot/rh/compute.rhels6.x86_64.postinstall \ - /install/custom/netboot/rh/ - chmod +x /install/custom/netboot/rh/compute.rhels6.x86_64.postinstall - b) Edit ``/install/custom/netboot//.postinstall`` and add below line in the end :: + Edit ``/..postinstall`` and add below line in the end :: /install/postscripts/mlnxofed_ib_install \ -p /install// -i $1 -n genimage - **[Note]** If you want to customized kernel version (i.e the kernel version of the diskless image you want to generate is different with the kernel version of you management node), you need to pass ``--add-kernel-support`` attribute to Mellanox. the line added into ``.postinstall`` should like below :: + **[Note]** Mellanox OFED ISO was built on a certain kernal version, If your kernel version does not match with any of the Mellanox offered pre-built RPMs, you can pass ``--add-kernel-support`` attribute to Mellanox to rebuild these RPMs base on your kernel. The line added into ``.postinstall`` should like below :: /install/postscripts/mlnxofed_ib_install \ -p /install// -m --add-kernel-support -end- -i $1 -n genimage - Below steps maybe helpful for you to do judgment if you belong to this situation. - - Get the kernel version of your management node :: - - uname -r - - Get the kernel version of target image. take generating a diskless image of rhels7.0 on x86_64 for example :: - - [root@server]# lsdef -t osimage rhels7.0-x86_64-install-compute -i pkgdir - Object name: rhels7.0-x86_64-install-compute - pkgdir=/install/rhels7.0/x86_64 - - [root@server]# ls -l /install/rhels7.0/x86_64/Packages/ |grep kernel* - ....... - -r--r--r-- 1 root root 30264588 May 5 2014 kernel-3.10.0-123.el7.x86_64.rpm - ....... -3. Set the related osimage using the customized pkglist and compute.postinsall + Take rhels7.2 on ppc64le for example: :: -* [RHEL/SLES] :: + # lsdef -t osimage rhels7.2-ppc64le-netboot-compute + Object name: rhels7.2-ppc64le-netboot-compute + exlist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist + imagetype=linux + osarch=ppc64le + osdistroname=rhels7.2-ppc64le + osname=Linux + osvers=rhels7.2 + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + pkgdir=/install/rhels7.2/ppc64le + pkglist=/install/custom/install/rh/compute.rhels7.ib.pkglist + postinstall=/install/custom/install/rh/compute.rhels7.ppc64le.postinstall + profile=compute + provmethod=netboot + rootimgdir=/install/netboot/rhels7.2/ppc64le/compute - chdef -t osimage -o --netboot-compute \ - pkglist=/install/custom/netboot//compute...pkglist \ - postinstall=/install/custom/netboot//.postinstall -* [Ubuntu] :: + **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/install/rh/compute.rhels7.ib.pkglist`` is a copy of ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist``. For the same reason, ``/install/custom/install/rh/compute.rhels7.ppc64le.postinstall`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall``. :: - chdef -t osimage -o --netboot-compute \ - postinstall=/install/custom/netboot//.postinstall + # cat /install/custom/install/rh/compute.rhels7.ib.pkglist + #Please make sure there is a space between @ and group name + wget + ntp + nfs-utils + net-snmp + rsync + yp-tools + openssh-server + util-linux + net-tools + #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist# -4. Generate and package image for diskless installation :: + + #cat /install/custom/install/rh/compute.rhels7.ppc64le.postinstall + #!/bin/sh + #-- Do not remove following line if you want to make use of CVS version tracking + ...... + # [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION + #done + /install/postscripts/mlnxofed_ib_install -p /install/ofed/MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.2-ppc64le.iso -i $1 -n genimage + +3. Generate and package image for diskless installation :: genimage --netboot-compute packimage --netboot-compute -5. Install node :: +4. Install node :: nodeset osimage=--netboot-compute rsetboot net rpower reset - After installation, you can login target ndoe and issue ``ibstat`` command to verify if your IB driver works well. if everything is fine, you can get the IB apater information :: - - [root@server ~]# ibstat - CA 'mlx4_0' - CA type: MT4099 - Number of ports: 2 - Firmware version: 2.11.500 - Hardware version: 0 - Node GUID: 0x5cf3fc000004ec02 - System image GUID: 0x5cf3fc000004ec05 - Port 1: - State: Initializing - Physical state: LinkUp - Rate: 40 (FDR10) - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec03 - Link layer: InfiniBand - Port 2: - State: Down - Physical state: Disabled - Rate: 10 - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec04 - Link layer: InfiniBand + After installation, you can login target ndoe and issue ``ibv_devinfo`` command to verify if your IB driver works well. if everything is fine, you can get the IB apater information :: + + # ibv_devinfo + hca_id: mlx5_0 + transport: InfiniBand (0) + fw_ver: 10.14.2036 + node_guid: f452:1403:0076:10e0 + sys_image_guid: f452:1403:0076:10e0 + vendor_id: 0x02c9 + vendor_part_id: 4113 + hw_ver: 0x0 + board_id: IBM1210111019 + phys_port_cnt: 2 + Device ports: + port: 1 + state: PORT_INIT (2) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand + + port: 2 + state: PORT_DOWN (1) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand 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 217eb828d..3b26a2a9e 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 @@ -1,12 +1,22 @@ Preparation =========== -Obtain the Mellanox OFED ISO file from `Mellanox official site `_ and put it into one place under ``/install`` directory depending on your need. +Obtain the Mellanox OFED ISO +---------------------------- + +Obtain the Mellanox OFED ISO file from `Mellanox official Download Page `_ and put it into one place under ``/install`` directory depending on your need. **[NOTE]** * Mellanox provides OFED drivers in **tarball** and **iso** formats. xCAT only supports the **iso** format at this time. * Mellanox provides different OFED ISOs depending on operating system and machine architecture, named like MLNX_OFED_LINUX----.iso, you should download correct one according your environment. +* Mellanox has some updates and known issues for echo OFED, please read `InfiniBand/VPI Software Overview `_ to understand these information. +* The Mellanox links offered above maybe outdate in future for Mellanox updates his web page, xCAT will keep updating for synchronization. If we don't update in time, please access `Mellanox web portal `_ to find ``Support/Education`` then ``InfiniBand/VPI Drivers`` lables. + +Prepare Install Script +---------------------- + +**mlnxofed_ib_install.v2** is a sample script, its framework can help you install Mellanox drives easily. But in specific scenario, some detail need to be modified to meet requirement, such like dependency package list. It has been verified in limited scenarios and can work as solution in these scenarios. For these scenarions information please refer to :doc:`The Scenarioes Have Been Verified `. Copy **mlnxofed_ib_install.v2** into ``/install/postscripts`` and change name to **mlnxofed_ib_install** :: @@ -31,3 +41,6 @@ If need to pass ``--without-32bit --without-fw-update --add-kernel-support --for mlnxofed_ib_install -p /install// \ -m --without-32bit --without-fw-update --add-kernel-support --force -end- + +**[Note]** We recommend to update your firmware to the latest version to avoid unexpected problem when you install ib for the first time. + diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst index be8532360..52d500fb3 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst @@ -7,4 +7,6 @@ Using mlnxofed_ib_install.v2 (Recommend) mlnxofed_ib_install_v2_preparation.rst mlnxofed_ib_install_v2_diskful.rst mlnxofed_ib_install_v2_diskless.rst + mlnxofed_ib_verified_scenario_matrix.rst + mlnxofed_ib_known_issue.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst new file mode 100644 index 000000000..ef0ee44c6 --- /dev/null +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst @@ -0,0 +1,19 @@ +Known Issues +============ + + +Known Issue 1 +------------- + +After you install mellanox derives in rhels7.2 successfully by xCAT, maybe you have new requirement to upgrade your operating system to higher version. In this case you probably hit such problem the IB adaptor drives shipped by operating system is higher than the Mellanox drives you have installed. That means the the Mellanox drives will be replaced by the drives shipped by operating system. If it's not the result you expect, you hope keep the Mellanox drives after operating system upgraded, please add below statement into ``/etc/yum.conf`` in your target node after you install mellanox derives successfully for the first time. :: + + exclude=dapl* libib* ibacm infiniband* libmlx* librdma* opensm* ibutils* + + +Known Issue 2 +------------- + +If you want to use ``--add-kernel-support`` attribute in sles12.1 and ppc64le scenario, you will find some dependency packages are not shipped by SLES Server DVDs, such like ``python-devel``, it's shipped in SDK DVDs. xCAT doesn't ship specific pkglist to support such scenario. If you have such requirement, please used ``otherpkglist`` and ``otherpkgs`` attributes to prepare dependency packages repository ahead. If you need help about ``otherpkglist`` and ``otherpkgs``attributes, please refer to :doc:`Add Additional Software Packages `. + + + 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 new file mode 100644 index 000000000..f1dd91130 --- /dev/null +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst @@ -0,0 +1,15 @@ +The Scenarioes Have Been Verified +================================= + + ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| OS version | Arch | Ofed version | Attribute supported by mlnx | IB.pkglist | ++===============+=========+===================================================+==================================================================+===========================+ +| rhels7.1 | ppc64 | MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.1-ppc64.iso |--without-32bit --without-fw-update --add-kernel-support --force | ib.rhels7.ppc64.pkglist | ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| rhels7.2 | ppc64le | MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.2-ppc64le.iso |--without-32bit --without-fw-update --add-kernel-support --force | ib.rhels7.ppc64le.pkglist | ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| sles12.1 | ppc64le |MLNX_OFED_LINUX-3.2-2.0.0.0-sles12sp1-ppc64le.iso |--without-32bit --without-fw-update --force | ib.sles12.ppc64le.pkglist | ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| ubuntu14.04.3 | ppc64le |MLNX_OFED_LINUX-3.2-2.0.0.0-ubuntu14.04-ppc64le.iso|--without-32bit --without-fw-update --add-kernel-support --force |ib.ubuntu14.ppc64le.pkglist| ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ From 0ea278bc4cf6a17fdf5090a14f6c2c49aad572dd Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 12 Apr 2016 04:03:51 -0400 Subject: [PATCH 08/52] add pkglist for ppc64 and ppc64le environment --- .../xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist | 13 +++++++++++++ .../xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist | 2 ++ .../xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist | 1 + .../ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist | 1 + 4 files changed, 17 insertions(+) create mode 100644 xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist create mode 100644 xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist create mode 100644 xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist diff --git a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist new file mode 100644 index 000000000..b1a6d26db --- /dev/null +++ b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist @@ -0,0 +1,13 @@ +pciutils-libs +pciutils +tcl +tk +tcsh +libgcc.ppc +gcc-gfortran +createrepo +kernel-devel +python-devel +lsof +redhat-rpm-config +rpm-build diff --git a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist index a17788955..56ec36ea9 100644 --- a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist +++ b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist @@ -14,4 +14,6 @@ kernel-devel gtk2 atk cairo +gcc +createrepo diff --git a/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist new file mode 100644 index 000000000..6e8e5c887 --- /dev/null +++ b/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist @@ -0,0 +1 @@ +python-libxml2 diff --git a/xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist new file mode 100644 index 000000000..bcab162a8 --- /dev/null +++ b/xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist @@ -0,0 +1 @@ +dpkg-dev From 0e4c73795c97fed32f7c495aa8b14f3e45c5faf2 Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 12 Apr 2016 22:07:43 -0400 Subject: [PATCH 09/52] the shebang of bash scripts should be the 1st line of script file --- buildcore.sh | 4 ++-- builddep.sh | 3 ++- buildlocal.sh | 1 + makerpm | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/buildcore.sh b/buildcore.sh index 0fbcf0ec6..8db928c6a 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -1,6 +1,6 @@ -# The shell is commented out so that it will run in bash on linux and ksh on aix -# !/bin/bash +#!/bin/bash +# The shell is commented out so that it will run in bash on linux and ksh on aix # Build and upload the xcat-core code, on either linux or aix. # Getting Started: diff --git a/builddep.sh b/builddep.sh index 5a3f7e931..b5667f99e 100755 --- a/builddep.sh +++ b/builddep.sh @@ -1,5 +1,6 @@ +#!/bin/sh # The shell is commented out so that it will run in bash on linux and ksh on aix -# !/bin/sh + # # Package up all the xCAT open source dependencies # - creating the yum repos diff --git a/buildlocal.sh b/buildlocal.sh index fa4e6dfa6..da6f64899 100755 --- a/buildlocal.sh +++ b/buildlocal.sh @@ -1,3 +1,4 @@ +#!/bin/sh ####################################################################### #build script for local usage #used for Linux/AIX/Ubuntu diff --git a/makerpm b/makerpm index 76a800688..45c85481d 100755 --- a/makerpm +++ b/makerpm @@ -1,6 +1,6 @@ -# The shell is commented out so that it will run in bash on linux and ksh on aix -# !/bin/bash +#!/bin/bash +# The shell is commented out so that it will run in bash on linux and ksh on aix # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html # Common script to make any one the xcat rpms. To build locally, run in the top dir of local svn repository, for example: From 035a8e63850da3d9df67b430bb8beaf5188a9917 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 13 Apr 2016 00:49:11 -0400 Subject: [PATCH 10/52] remove the comment lines for AIX build --- buildcore.sh | 1 - builddep.sh | 1 - makerpm | 1 - 3 files changed, 3 deletions(-) diff --git a/buildcore.sh b/buildcore.sh index 8db928c6a..13494774c 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -1,6 +1,5 @@ #!/bin/bash -# The shell is commented out so that it will run in bash on linux and ksh on aix # Build and upload the xcat-core code, on either linux or aix. # Getting Started: diff --git a/builddep.sh b/builddep.sh index b5667f99e..84ca78e40 100755 --- a/builddep.sh +++ b/builddep.sh @@ -1,5 +1,4 @@ #!/bin/sh -# The shell is commented out so that it will run in bash on linux and ksh on aix # # Package up all the xCAT open source dependencies diff --git a/makerpm b/makerpm index 45c85481d..355e236bf 100755 --- a/makerpm +++ b/makerpm @@ -1,6 +1,5 @@ #!/bin/bash -# The shell is commented out so that it will run in bash on linux and ksh on aix # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html # Common script to make any one the xcat rpms. To build locally, run in the top dir of local svn repository, for example: From a33385c6da50c93ad3cfd0a0a0400d0b75e672d8 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Wed, 13 Apr 2016 03:07:56 -0400 Subject: [PATCH 11/52] changed all labels --- xCAT-test/autotest/testcase/installation/1 | 100 ++++++++++++++++++ .../reg_linux_SN_installation_hierarchy | 2 +- .../reg_linux_diskfull_installation_flat | 2 +- .../reg_linux_diskfull_installation_hierarchy | 2 +- .../reg_linux_diskless_installation_flat | 2 +- .../reg_linux_diskless_installation_hierarchy | 2 +- .../reg_linux_statelite_installation_flat | 2 +- ...reg_linux_statelite_installation_hierarchy | 1 + ...ux_statelite_installation_hierarchy_by_nfs | 2 +- ...tatelite_installation_hierarchy_by_ramdisk | 2 +- .../ubuntu_diskless_installation_p8le | 2 +- .../ubuntu_diskless_installation_vm | 2 +- .../ubuntu_full_installation_p8le | 2 +- .../installation/ubuntu_full_installation_vm | 2 +- 14 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 xCAT-test/autotest/testcase/installation/1 diff --git a/xCAT-test/autotest/testcase/installation/1 b/xCAT-test/autotest/testcase/installation/1 new file mode 100644 index 000000000..7e310aaa1 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/1 @@ -0,0 +1,100 @@ +start:reg_linux_statelite_installation_hierarchy_by_nfs +os:Linux +stop:yes + +cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN +check:rc==0 +cmd:chdef -t node $$SN groups=service,all +check:rc==0 + +cmd:makedns -n +check:rc==0 +cmd:makeconservercf +check:rc==0 +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 + +cmd:copycds $$ISO +check:rc==0 + +cmd:xdsh $$SN df|grep /install;if [ $? -eq 0 ] ;then xdsh $$SN umount /install;fi +check:rc==0 +cmd:xdsh $$SN 'cat /etc/exports|grep install; if [ "$?" -ne "0" ]; then echo "/install *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi' +check:rc==0 + +cmd:xdsh $$SN "mkdir -p /nodedata" +check:rc==0 +cmd:xdsh $$SN "chmod 755 /etc/exports" +check:rc==0 +cmd:xdsh $$SN 'cat /etc/exports|grep nodedata; if [ "$?" -ne "0" ]; then echo "/nodedata *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi' +check:rc==0 +cmd:xdsh $$SN 'cd /etc; export exports;cd -' +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'service nfs restart'; fi +check:rc==0 + +cmd:chtab node=$$CN statelite.statemnt="$$SN:/nodedata" +check:rc==0 + +cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv; tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv; fi +check:rc==0 +cmd:tabdump litefile +check:rc==0 + +cmd:chtab priority=4.7 policy.commands=litefile policy.rule=allow +check:rc==0 +cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow +check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +check:rc==0 + +cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -d /install/custom/netboot/sles ]; then mkdir -p /install/custom/netboot/sles; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -d /install/custom/netboot/rh ]; then mkdir -p /install/custom/netboot/rh; fi;fi +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -e /install/custom/netboot/sles/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/sles/compute.synclist; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -e /install/custom/netboot/rh/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/rh/compute.synclist; fi;fi +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute synclists=/install/custom/netboot/sles/compute.synclist rootfstype=; elif cat /etc/*release |grep "Red Hat" >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute synclists=/install/custom/netboot/rh/compute.synclist rootfstype=; fi +check:rc==0 + +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +check:rc==0 +cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +check:rc==0 +cmd:prsync /install $$SN:/ +check:rc==0 + +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +check:rc==0 +cmd:lsdef $$CN |grep provmethod +check:rc==0 +check:output=~statelite +cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi +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:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +check:output=~/nodedata/$$CN on /.statelite/persistent +check:output=~compute/rootimg on / type nfs +cmd:MNIP=`cat /etc/hosts|grep $$MN|awk '{print $1}'`; result=`xdsh $$CN "cat /etc/resolv.conf|grep $MNIP"`; if [ "$result" = "$$CN: nameserver $MNIP" ]; then echo "sync file works well"; fi; +check:output=~sync file works well + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir;fi +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index de138e5de..5fd078f34 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -1,6 +1,6 @@ start:reg_linux_SN_installation_hierarchy os:Linux -stop=yes +stop:yes cmd:chtab key=nameservers site.value="" check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 0cdc0239a..feec8c7c2 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: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 2e90b4525..ec28d5b86 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:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index c34ad4f44..705400a6a 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:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index abb6fda6a..7232133d4 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:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 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 af9d3a8ec..c0ba9c8f8 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:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy index 0f85312c9..f9de59ccd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy @@ -1,5 +1,6 @@ start:reg_linux_statelite_installation_hierarchy os:Linux +stop:yes cmd:MNIP=`cat /etc/hosts|grep $$MN|awk '{print $1}'`;sed -i "s:nameserver .*:nameserver $MNIP:g" /etc/resolv.conf 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 3bc3dd622..7e310aaa1 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:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN 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 3eaff6341..8d4984708 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:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le index fa08387d9..644e171a6 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le @@ -1,6 +1,6 @@ start:Diskless_installation_flat_p8_le os:Linux -stop=yes +stop:yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index 62980140f..444b14dbb 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -1,6 +1,6 @@ start:Ubuntu_diskless_installation_flat_x86_vm os:Linux -stop=yes +stop:yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le index 577497c82..c62cc0cac 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le @@ -1,6 +1,6 @@ start:Full_installation_flat_p8_le os:Linux -stop=yes +stop:yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm index 6cf90d2b6..ff4d42ce6 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm @@ -1,6 +1,6 @@ start:Ubuntu_full_installation_flat_x86_vm os:Linux -stop=yes +stop:yes cmd:copycds $$ISO check:rc==0 From 2ae30f5147d102b40881f39f1a19ef70543d7e1f Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Wed, 13 Apr 2016 03:11:59 -0400 Subject: [PATCH 12/52] delete unused file --- xCAT-test/autotest/testcase/installation/1 | 100 --------------------- 1 file changed, 100 deletions(-) delete mode 100644 xCAT-test/autotest/testcase/installation/1 diff --git a/xCAT-test/autotest/testcase/installation/1 b/xCAT-test/autotest/testcase/installation/1 deleted file mode 100644 index 7e310aaa1..000000000 --- a/xCAT-test/autotest/testcase/installation/1 +++ /dev/null @@ -1,100 +0,0 @@ -start:reg_linux_statelite_installation_hierarchy_by_nfs -os:Linux -stop:yes - -cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN -check:rc==0 -cmd:chdef -t node $$SN groups=service,all -check:rc==0 - -cmd:makedns -n -check:rc==0 -cmd:makeconservercf -check:rc==0 -cmd:sleep 20 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then getmacs -D $$CN; fi -check:rc==0 -cmd:makedhcp -n -check:rc==0 -cmd:makedhcp -a -check:rc==0 - -cmd:copycds $$ISO -check:rc==0 - -cmd:xdsh $$SN df|grep /install;if [ $? -eq 0 ] ;then xdsh $$SN umount /install;fi -check:rc==0 -cmd:xdsh $$SN 'cat /etc/exports|grep install; if [ "$?" -ne "0" ]; then echo "/install *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi' -check:rc==0 - -cmd:xdsh $$SN "mkdir -p /nodedata" -check:rc==0 -cmd:xdsh $$SN "chmod 755 /etc/exports" -check:rc==0 -cmd:xdsh $$SN 'cat /etc/exports|grep nodedata; if [ "$?" -ne "0" ]; then echo "/nodedata *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi' -check:rc==0 -cmd:xdsh $$SN 'cd /etc; export exports;cd -' -check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'service nfs restart'; fi -check:rc==0 - -cmd:chtab node=$$CN statelite.statemnt="$$SN:/nodedata" -check:rc==0 - -cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv; tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv; fi -check:rc==0 -cmd:tabdump litefile -check:rc==0 - -cmd:chtab priority=4.7 policy.commands=litefile policy.rule=allow -check:rc==0 -cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow -check:rc==0 - -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi -check:rc==0 - -cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -d /install/custom/netboot/sles ]; then mkdir -p /install/custom/netboot/sles; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -d /install/custom/netboot/rh ]; then mkdir -p /install/custom/netboot/rh; fi;fi -check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -e /install/custom/netboot/sles/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/sles/compute.synclist; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -e /install/custom/netboot/rh/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/rh/compute.synclist; fi;fi -check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute synclists=/install/custom/netboot/sles/compute.synclist rootfstype=; elif cat /etc/*release |grep "Red Hat" >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute synclists=/install/custom/netboot/rh/compute.synclist rootfstype=; fi -check:rc==0 - -cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:prsync /install $$SN:/ -check:rc==0 - -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~statelite -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi -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:xdsh $$CN date -check:rc==0 -check:output=~\d\d:\d\d:\d\d -cmd:xdsh $$CN mount -check:rc==0 -check:output=~/nodedata/$$CN on /.statelite/persistent -check:output=~compute/rootimg on / type nfs -cmd:MNIP=`cat /etc/hosts|grep $$MN|awk '{print $1}'`; result=`xdsh $$CN "cat /etc/resolv.conf|grep $MNIP"`; if [ "$result" = "$$CN: nameserver $MNIP" ]; then echo "sync file works well"; fi; -check:output=~sync file works well - -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir;fi -check:rc==0 -end From c21d08c3e7a61e80062f99f2ab9e5db1a3fc917b Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 14 Apr 2016 02:57:05 -0400 Subject: [PATCH 13/52] write MAC when creating docker container, remove connect network and/or disconnect network --- xCAT-server/lib/xcat/plugins/docker.pm | 123 ++----------------------- 1 file changed, 9 insertions(+), 114 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/docker.pm b/xCAT-server/lib/xcat/plugins/docker.pm index 48376a45b..7f4c1ad6a 100755 --- a/xCAT-server/lib/xcat/plugins/docker.pm +++ b/xCAT-server/lib/xcat/plugins/docker.pm @@ -172,15 +172,9 @@ my %command_states = ( # ^ / | # | 404 and / | # 20x| 'No such image'/ | -# | v 20x| error +# | v | error # CREATE_TO_WAIT_FOR_IMAGE_PULL_DONE ------------------------------> error_msg # | -# v error -# CREATE_TO_WAIT_FOR_RM_DEFCONN_DONE-------> error_msg -# | -# 20x| -# v error -# CREATE_TO_WAIT_FOR_CONNECT_NET_DONE------> error_msg # | # 20x| # v @@ -200,28 +194,10 @@ my %command_states = ( init_url => "/images/create?fromImage=#DOCKER_IMAGE#", init_state => "CREATE_TO_WAIT_FOR_IMAGE_PULL_DONE", }, - connectnet => { - genreq_ptr => \&genreq_for_net_connect, - state_machine_engine => \&default_state_engine, - init_method => "POST", - init_url => "/networks/#NETNAME#/connect", - init_state => "CREATE_TO_WAIT_FOR_CONNECT_NET_DONE", - }, - rmdefconn => { - genreq_ptr => \&genreq_for_net_disconnect, - state_machine_engine => \&default_state_engine, - init_method => "POST", - init_url => "/networks/bridge/disconnect", - init_state => "CREATE_TO_WAIT_FOR_RM_DEFCONN_DONE", - } }, -# The state changing for rmdocker -# -# INIT_TO_WAIT_FOR_DISCONNECT_NET_DONE -# If success or force to remove, to remove docker -# Else return error -# In remove docker round, return error_msg if failed or success if done +# For rmdocker +# return error_msg if failed or success if done rmdocker => { force => { state_machine_engine => \&default_state_engine, @@ -233,13 +209,6 @@ my %command_states = ( init_method => "DELETE", init_url => "/containers/#NODE#", }, - disconnect => { - genreq_ptr => \&genreq_for_net_disconnect, - state_machine_engine => \&default_state_engine, - init_method => "POST", - init_url => "/networks/#NETNAME#/disconnect", - init_state => "INIT_TO_WAIT_FOR_DISCONNECT_NET_DONE", - }, }, # For lsdocker [-l|--logs] @@ -484,17 +453,6 @@ sub default_state_engine { $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Pull image $node_hash->{image} start"]}]}); change_node_state($node, $command_states{mkdocker}{pullimage}); return; - } elsif ($data->is_success) { - $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Remove default network connection"]}]}); - change_node_state($node, $command_states{mkdocker}{rmdefconn}); - return; - } - } - elsif ($curr_state eq 'CREATE_TO_WAIT_FOR_RM_DEFCONN_DONE') { - if ($data->is_success) { - $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Connecting customzied network '$node_hash->{nics}'"]}]}); - change_node_state($node, $command_states{mkdocker}{connectnet}); - return; } } elsif ($curr_state eq 'CREATE_TO_WAIT_FOR_IMAGE_PULL_DONE') { @@ -505,13 +463,6 @@ sub default_state_engine { return; } } - elsif ($curr_state eq 'INIT_TO_WAIT_FOR_DISCONNECT_NET_DONE') { - if ($data->is_success or $node_hash_variable{$node}->{opt} eq 'force') { - $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Disconnect customzied network '$node_hash->{nics}' done"]}]}); - change_node_state($node, $command_states{rmdocker}{$node_hash->{opt}}); - return; - } - } foreach my $tmp (@msg) { if ($tmp->[0]) { @@ -736,7 +687,7 @@ sub parse_args { return ( [1, "Option $op is not supported for $cmd"]); } } - $request->{mapping_option} = "disconnect"; + $request->{mapping_option} = "force"; } elsif ($cmd eq 'lsdocker') { foreach my $op (@ARGV) { @@ -825,11 +776,7 @@ sub process_request { $mapping_hash = $command_states{$command}{$req->{mapping_option}}; } else { - if ($command eq 'rmdocker') { - $mapping_hash = $command_states{$command}{disconnect}; - } else { - $mapping_hash = $command_states{$command}{default}; - } + $mapping_hash = $command_states{$command}{default}; } my $max_concur_session_allow = 20; # A variable can be set by caculated in the future if ($command eq 'lsdocker') { @@ -1139,6 +1086,10 @@ sub genreq_for_mkdocker { $info_hash{Memory} = $dockerinfo->{mem}; $info_hash{MacAddress} = $dockerinfo->{mac}; $info_hash{CpusetCpus} = $dockerinfo->{cpus}; + $info_hash{HostConfig}->{NetworkMode} = $dockerinfo->{nics}; + $info_hash{NetworkDisabled} = JSON::false; + $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{IPAMConfig}->{IPv4Address} = $dockerinfo->{ip}; + $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{MacAddress} = $dockerinfo->{mac}; if (defined($dockerinfo->{flag})) { my $flag_hash = decode_json($dockerinfo->{flag}); %info_hash = (%info_hash, %$flag_hash); @@ -1149,62 +1100,6 @@ sub genreq_for_mkdocker { #------------------------------------------------------- -=head3 genreq_for_net_connect - - Generate HTTP request for network operation for a docker - - Input: $node: The docker container name - $dockerhost: hash, keys: name, port, user, pw, user, pw, user, pw - $method: the http method to generate the http request - $api: the url to generate the http request - - return: The http request; - Usage example: - my $res = genreq_for_net_connect($node,\%dockerhost,'POST','/networks/$nic/connect'); - -=cut - -#------------------------------------------------------- - -sub genreq_for_net_connect { - my ($node, $dockerhost, $method, $api) = @_; - my $dockerinfo = $node_hash_variable{$node}; - my %info_hash = (); - $info_hash{container} = $node; - $info_hash{EndpointConfig}->{IPAMConfig}->{IPv4Address} = $dockerinfo->{ip}; - my $content = encode_json \%info_hash; - return genreq($node, $dockerhost, $method, $api, $content); -} -#------------------------------------------------------- - -=head3 genreq_for_net_disconnect - - Generate HTTP request for network operation for a docker - - Input: $node: The docker container name - $dockerhost: hash, keys: name, port, user, pw, user, pw, user, pw - $method: the http method to generate the http request - $api: the url to generate the http request - - return: The http request; - Usage example: - my $res = genreq_for_net_disconnect($node,\%dockerhost,'POST','/networks/$nic/disconnect'); - -=cut - -#------------------------------------------------------- - -sub genreq_for_net_disconnect { - my ($node, $dockerhost, $method, $api) = @_; - my $dockerinfo = $node_hash_variable{$node}; - my %info_hash = (); - $info_hash{Container} = $node; - $info_hash{Force} = JSON::false; - my $content = encode_json \%info_hash; - return genreq($node, $dockerhost, $method, $api, $content); -} -#------------------------------------------------------- - =head3 sendreq Based on the method, url create a http request and send out on the given SSL connection From e09ef72014414529fa888dbc645b518530f553d9 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 14 Apr 2016 03:01:10 -0400 Subject: [PATCH 14/52] replace the digest algorithm of xCAT ssl certificate from sha1 to sha256 --- xCAT-server/share/xcat/ca/openssl.cnf.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/ca/openssl.cnf.tmpl b/xCAT-server/share/xcat/ca/openssl.cnf.tmpl index abfe25892..e3647635c 100644 --- a/xCAT-server/share/xcat/ca/openssl.cnf.tmpl +++ b/xCAT-server/share/xcat/ca/openssl.cnf.tmpl @@ -67,7 +67,7 @@ cert_opt = ca_default # Certificate field options default_days = 7300 # how long to certify for default_crl_days= 30 # how long before next CRL -default_md = sha1 # which md to use. +default_md = sha256 # which md to use. preserve = no # keep passed DN ordering # A few difference way of specifying how similar the request should look From f8e3da2280cf449e3e3950df7eff1c8e42dcc268 Mon Sep 17 00:00:00 2001 From: zet809 Date: Thu, 14 Apr 2016 15:19:08 +0800 Subject: [PATCH 15/52] Remove mac attribute It seems the docker can assign MACaddress automatically after the container is started, the pull request 926 have more information --- docs/source/advanced/docker/lifecycle_management.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/advanced/docker/lifecycle_management.rst b/docs/source/advanced/docker/lifecycle_management.rst index cd3385d20..95443d918 100644 --- a/docs/source/advanced/docker/lifecycle_management.rst +++ b/docs/source/advanced/docker/lifecycle_management.rst @@ -94,7 +94,6 @@ After the dockerhost is ready, a docker instance can be managed through xCAT com dockernics=mynet0 groups=docker,all ip=10.0.120.1 - mac=02:42:0a:00:78:01 mgt=docker postbootscripts=otherpkgs postscripts=syslog,remoteshell,syncfiles From b2a8ddecf072149007c0e5c3ba95b612f12133c1 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 14 Apr 2016 03:25:54 -0400 Subject: [PATCH 16/52] update example --- .../mlnxofed_ib_install_v2_diskful.rst | 60 +++++++---- .../mlnxofed_ib_install_v2_diskless.rst | 99 ++++++++++--------- 2 files changed, 93 insertions(+), 66 deletions(-) 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 b71ac5d37..601f03229 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 @@ -3,11 +3,11 @@ Configuration for Diskful Installation 1. Set script ``mlnxofed_ib_install`` as ``postbootscripts`` or ``postscripts`` :: - chdef -p postbootscripts="mlnxofed_ib_install -p /install//" + chdef -p postbootscripts="mlnxofed_ib_install -p /install//" Or :: - chdef -p postscripts="mlnxofed_ib_install -p /install//" + chdef -p postscripts="mlnxofed_ib_install -p /install//" xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drives work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox dreives. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarioes Have Been Verified `. You can try this way in other else scenarios if you needed. @@ -20,12 +20,12 @@ Configuration for Diskful Installation imagetype=linux .... pkgdir=/ - pkglist=//compute..pkglist + pkglist=//compute...pkglist .... - You can append the ib dependency packages list in the end of ``//compute..pkglist`` directly like below: :: + You can append the ib dependency packages list in the end of ``//compute...pkglist`` directly like below: :: - #cat //compute..pkglist + #cat //compute...pkglist @base @x11 openssl @@ -38,9 +38,9 @@ Configuration for Diskful Installation .... - Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute..pkglist`` like below way: :: + Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: - #cat //compute..pkglist + #cat //compute...pkglist @base @x11 openssl @@ -50,7 +50,7 @@ Configuration for Diskful Installation xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: - #cat //compute..pkglist + #cat //compute...pkglist @base @x11 openssl @@ -133,19 +133,37 @@ Configuration for Diskful Installation port_lmc: 0x00 link_layer: InfiniBand - Using ``service openibd status`` to verify if openibd works well. Below is the output in SLES :: - - #service openibd status - openibd.service - openibd - configure Mellanox devices - Loaded: loaded (/usr/lib/systemd/system/openibd.service; enabled) - Active: active (exited) since Sun 2016-04-10 07:13:46 EDT; 3h 24min ago - Docs: file:/etc/infiniband/openib.conf - Main PID: 48133 (code=exited, status=0/SUCCESS) - CGroup: /system.slice/openibd.service - - Apr 10 07:13:39 c910f05c33 openibd[48133]: [34B blob data] - Apr 10 07:13:46 c910f05c33 openibd[48133]: [49B blob data] - Apr 10 07:14:06 c910f05c33 logger[49644]: openibd: Set node_desc for mlx5_0: HCA-1 + Using ``service openibd status`` to verify if openibd works well. Below is the output in rhels7.2. :: + # service openibd status + HCA driver loaded + + Configured IPoIB devices: + ib0 ib1 + + Currently active IPoIB devices: + Configured Mellanox EN devices: + + Currently active Mellanox devices: + + The following OFED modules are loaded: + + rdma_ucm + rdma_cm + ib_addr + ib_ipoib + mlx4_core + mlx4_ib + mlx4_en + mlx5_core + mlx5_ib + ib_uverbs + ib_umad + ib_ucm + ib_sa + ib_cm + ib_mad + ib_core + 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 ccdf3005e..3a7636abd 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 @@ -10,17 +10,19 @@ Configuration for Diskless Installation imagetype=linux .... pkgdir=/ - pkglist=//compute..pkglist + pkglist=//compute...pkglist .... - You can append the ib dependency packages list in the end of ``//compute..pkglist`` directly like below: :: + You can append the ib dependency packages list in the end of ``//compute...pkglist`` directly like below: :: - #cat //compute..pkglist - @base - @x11 + #cat //compute...pkglist + bash + nfs-utils openssl - ntp - rsyn + dhclient + kernel + ..... + #ib part createrepo kernel-devel @@ -28,24 +30,26 @@ Configuration for Diskless Installation .... - Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute..pkglist`` like below way: :: + Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: - #cat //compute..pkglist - @base - @x11 + #cat //compute...pkglist + bash + nfs-utils openssl - ntp - rsyn + dhclient + kernel + ..... #INCLUDE://# xCAT ships some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: - #cat //compute..pkglist - @base - @x11 + #cat //compute...pkglist + bash + nfs-utils openssl - ntp - rsyn + dhclient + kernel + ..... #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# @@ -70,48 +74,53 @@ Configuration for Diskless Installation **[Note]** Mellanox OFED ISO was built on a certain kernal version, If your kernel version does not match with any of the Mellanox offered pre-built RPMs, you can pass ``--add-kernel-support`` attribute to Mellanox to rebuild these RPMs base on your kernel. The line added into ``.postinstall`` should like below :: /install/postscripts/mlnxofed_ib_install \ - -p /install// -m --add-kernel-support -end- -i $1 -n genimage + -p /install// -m --add-kernel-support -end- -i $1 -n genimage Take rhels7.2 on ppc64le for example: :: - # lsdef -t osimage rhels7.2-ppc64le-netboot-compute + #lsdef -t osimage rhels7.2-ppc64le-netboot-compute Object name: rhels7.2-ppc64le-netboot-compute - exlist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist - imagetype=linux - osarch=ppc64le - osdistroname=rhels7.2-ppc64le - osname=Linux - osvers=rhels7.2 - otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le - pkgdir=/install/rhels7.2/ppc64le - pkglist=/install/custom/install/rh/compute.rhels7.ib.pkglist - postinstall=/install/custom/install/rh/compute.rhels7.ppc64le.postinstall - profile=compute - provmethod=netboot - rootimgdir=/install/netboot/rhels7.2/ppc64le/compute + exlist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist + imagetype=linux + osarch=ppc64le + osdistroname=rhels7.2-ppc64le + osname=Linux + osvers=rhels7.2 + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + permission=755 + pkgdir=/install/rhels7.2/ppc64le + pkglist=/install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist + postinstall=/install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall + profile=compute + provmethod=netboot + rootimgdir=/install/netboot/rhels7.2/ppc64le/compute - **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/install/rh/compute.rhels7.ib.pkglist`` is a copy of ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist``. For the same reason, ``/install/custom/install/rh/compute.rhels7.ppc64le.postinstall`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall``. :: + **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist``. For the same reason, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall``. :: - # cat /install/custom/install/rh/compute.rhels7.ib.pkglist - #Please make sure there is a space between @ and group name - wget - ntp + ``compute.rhels7.ppc64le.pkglist`` looks like below: :: + + # cat /install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist + bash nfs-utils - net-snmp - rsync - yp-tools - openssh-server - util-linux + openssl + dhclient + bc + ...... + lsvpd + irqbalance + procps-ng + parted net-tools #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist# + ``compute.rhels7.ppc64le.ib.postinstall`` looks like below: :: - #cat /install/custom/install/rh/compute.rhels7.ppc64le.postinstall + # cat /install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall #!/bin/sh #-- Do not remove following line if you want to make use of CVS version tracking - ...... + ..... # [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION #done /install/postscripts/mlnxofed_ib_install -p /install/ofed/MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.2-ppc64le.iso -i $1 -n genimage From 831600b5cee2a488378a3ce1ca5ddeab4e14e5c0 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 14 Apr 2016 03:38:08 -0400 Subject: [PATCH 17/52] update for rhels7.2 on ppc64le for diskless --- xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist index 56ec36ea9..90723aa51 100644 --- a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist +++ b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist @@ -16,4 +16,4 @@ atk cairo gcc createrepo - +libnl From cf4fb89a5b6dde46e2f3ecc145afaa9d5e5a0ba9 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 14 Apr 2016 05:43:44 -0400 Subject: [PATCH 18/52] change p8le installation testcases file name --- .../Diskless_installation_flat_p8_le | 47 +++++++++++++++++++ .../installation/Full_installation_flat_p8_le | 31 ++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le create mode 100644 xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le new file mode 100644 index 000000000..644e171a6 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -0,0 +1,47 @@ +start:Diskless_installation_flat_p8_le +os:Linux +stop:yes + +cmd:copycds $$ISO +check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 20G ; fi +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:makeconservercf $$CN +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -d /install/custom/netboot/sles ]; then mkdir -p /install/custom/netboot/sles; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -d /install/custom/netboot/rh ]; then mkdir -p /install/custom/netboot/rh; fi; elif cat /etc/*release |grep "Ubuntu" >/dev/null;then if [ ! -d /install/custom/netboot/ubuntu ]; then mkdir -p /install/custom/netboot/ubuntu; fi; fi +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -e /install/custom/netboot/sles/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/sles/compute.synclist; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -e /install/custom/netboot/rh/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/rh/compute.synclist; fi; elif cat /etc/*release |grep "Ubuntu" >/dev/null;then if [ ! -e /install/custom/netboot/ubuntu/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/ubuntu/compute.synclist;fi; fi +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/install/custom/netboot/sles/compute.synclist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/install/custom/netboot/rh/compute.synclist;elif cat /etc/*release |grep "Ubuntu" >/dev/null; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/install/custom/netboot/ubuntu/compute.synclist;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:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:rpower $$CN boot +check:rc==0 +cmd:sleep 200 +cmd:lsdef -l $$CN | grep status +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:nodeset $$CN osimage +check:rc==0 +cmd:rpower $$CN reset +check:rc==0 +cmd:sleep 200 +cmd:lsdef -l $$CN | grep status +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +end diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le new file mode 100644 index 000000000..c62cc0cac --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -0,0 +1,31 @@ +start:Full_installation_flat_p8_le +os:Linux +stop:yes + +cmd:copycds $$ISO +check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +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:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:rpower $$CN boot +check:rc==0 +cmd:sleep 3000 +cmd:ping $$CN -c 3 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +end From 0c39a64046776206aa7d159697e48da83d443ce5 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 14 Apr 2016 05:45:32 -0400 Subject: [PATCH 19/52] delete p8le installation testcases --- .../ubuntu_diskless_installation_p8le | 47 ------------------- .../ubuntu_full_installation_p8le | 31 ------------ 2 files changed, 78 deletions(-) delete mode 100644 xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le delete mode 100644 xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le deleted file mode 100644 index 644e171a6..000000000 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le +++ /dev/null @@ -1,47 +0,0 @@ -start:Diskless_installation_flat_p8_le -os:Linux -stop:yes - -cmd:copycds $$ISO -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 20G ; fi -check:rc==0 -cmd:makedns -n -check:rc==0 -cmd:makedhcp -n -check:rc==0 -cmd:makedhcp -a -check:rc==0 -cmd:makeconservercf $$CN -check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -d /install/custom/netboot/sles ]; then mkdir -p /install/custom/netboot/sles; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -d /install/custom/netboot/rh ]; then mkdir -p /install/custom/netboot/rh; fi; elif cat /etc/*release |grep "Ubuntu" >/dev/null;then if [ ! -d /install/custom/netboot/ubuntu ]; then mkdir -p /install/custom/netboot/ubuntu; fi; fi -check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then if [ ! -e /install/custom/netboot/sles/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/sles/compute.synclist; fi; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ ! -e /install/custom/netboot/rh/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/rh/compute.synclist; fi; elif cat /etc/*release |grep "Ubuntu" >/dev/null;then if [ ! -e /install/custom/netboot/ubuntu/compute.synclist ]; then echo "/etc/resolv.conf -> /etc/resolv.conf" > /install/custom/netboot/ubuntu/compute.synclist;fi; fi -check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/install/custom/netboot/sles/compute.synclist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/install/custom/netboot/rh/compute.synclist;elif cat /etc/*release |grep "Ubuntu" >/dev/null; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/install/custom/netboot/ubuntu/compute.synclist;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:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:rpower $$CN boot -check:rc==0 -cmd:sleep 200 -cmd:lsdef -l $$CN | grep status -check:output=~booted -cmd:xdsh $$CN date -check:rc==0 -check:output=~\d\d:\d\d:\d\d -cmd:nodeset $$CN osimage -check:rc==0 -cmd:rpower $$CN reset -check:rc==0 -cmd:sleep 200 -cmd:lsdef -l $$CN | grep status -check:output=~booted -cmd:xdsh $$CN date -check:rc==0 -check:output=~\d\d:\d\d:\d\d -end diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le deleted file mode 100644 index c62cc0cac..000000000 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le +++ /dev/null @@ -1,31 +0,0 @@ -start:Full_installation_flat_p8_le -os:Linux -stop:yes - -cmd:copycds $$ISO -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi -check:rc==0 -cmd:makedhcp -n -check:rc==0 -cmd:makedhcp -a -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:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot -check:rc==0 -cmd:sleep 3000 -cmd:ping $$CN -c 3 -check:output=~64 bytes from $$CN -cmd:lsdef -l $$CN | grep status -check:output=~booted -cmd:xdsh $$CN date -check:rc==0 -check:output=~\d\d:\d\d:\d\d -end From 7876697e307c75eb0574195a5ac5592bdc690a0e Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 14 Apr 2016 10:39:35 -0400 Subject: [PATCH 20/52] add xz to rh6 netboot pkglist;do not mount /proc,/sys and /dev during genimage for rh6;do not add syslog module for dracut to generate initrd on rh6 --- .../netboot/rh/compute.rhels6.ppc64.pkglist | 1 + .../netboot/rh/compute.rhels6.x86_64.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/genimage | 60 +++++++++++++------ 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist index 992097641..6ad7101c8 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist @@ -24,3 +24,4 @@ lsvpd irqbalance procps parted +xz diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist index e235bfaba..cf0538893 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist @@ -20,3 +20,4 @@ rsync rsyslog e2fsprogs parted +xz diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 81688a1be..da2d15e70 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -73,18 +73,35 @@ sub xdie { die @_; } + +#helper subroutine to get the major release number +#of a osver +sub majversion { + my $version=shift; + my $majorrel; + + if($osver =~ /$\D*(\d*)[.\d]*$/){ + $majorrel=$1; + } + + return $majorrel; +} + sub mount_chroot { my $rootimage_dir = shift; - #postinstall script of package installation - #might access the /proc, /sys and /dev filesystem - #mount them from host read-only - system("mkdir -p $rootimage_dir/proc"); - system("mount proc $rootimage_dir/proc -t proc -o ro"); - system("mkdir -p $rootimage_dir/sys"); - system("mount sysfs $rootimage_dir/sys -t sysfs -o ro"); - system("mkdir -p $rootimage_dir/dev"); - system("mount devtmpfs $rootimage_dir/dev -t devtmpfs -o ro"); + if(majversion($osver) > 6){ + #postinstall script of package installation + #might access the /proc, /sys and /dev filesystem + #mount them from host read-only + #only available for rh7 or above + system("mkdir -p $rootimage_dir/proc"); + system("mount proc $rootimage_dir/proc -t proc -o ro"); + system("mkdir -p $rootimage_dir/sys"); + system("mount sysfs $rootimage_dir/sys -t sysfs -o ro"); + system("mkdir -p $rootimage_dir/dev"); + system("mount devtmpfs $rootimage_dir/dev -t devtmpfs -o ro"); + } } @@ -92,9 +109,11 @@ sub mount_chroot { sub umount_chroot { my $rootimage_dir = shift; - system("umount $rootimage_dir/proc"); - system("umount $rootimage_dir/sys"); - system("umount $rootimage_dir/dev"); + if(majversion($osver) >6){ + system("umount $rootimage_dir/proc"); + system("umount $rootimage_dir/sys"); + system("umount $rootimage_dir/dev"); + } } #check whether a dir is NFS mounted @@ -969,14 +988,19 @@ sub mkinitrd_dracut { $perm = (stat("$fullpath/$dracutdir/installkernel"))[2]; chmod($perm&07777, "$dracutmpath/installkernel"); + my $dracutmodulelist=" xcat nfs base network kernel-modules "; + if (-d glob($dracutmoduledir."[0-9]*fadump")){ + $dracutmodulelist .=" fadump "; + + } + + if ($dracutver >= "033") { + $dracutmodulelist .= " syslog "; + } + # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - if (-d glob($dracutmoduledir."[0-9]*fadump")){ - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules fadump syslog"\n}; - } - else{ - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules syslog"\n}; - } + print $DRACUTCONF qq{dracutmodules+="$$dracutmodulelist"\n}; print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; close $DRACUTCONF; } else { From a4615fc8ba591ece37e247054c627ce467d556bd Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 14 Apr 2016 15:09:36 -0400 Subject: [PATCH 21/52] rmvm command man page and type fixes --- .../admin-guides/references/man1/nodestat.1.rst | 2 +- .../guides/admin-guides/references/man1/rmvm.1.rst | 12 +++++------- xCAT-client/pods/man1/nodestat.1.pod | 2 +- xCAT-client/pods/man1/rmvm.1.pod | 12 +++++------- xCAT-server/lib/perl/xCAT/Template.pm | 4 ++-- xCAT-server/lib/xcat/monitoring/xcatmon.pm | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-) 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 f45dc3aa1..f51b0d015 100644 --- a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst @@ -59,7 +59,7 @@ Keywords to use: .. code-block:: perl - apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key filed in a different row. + apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key field in a different row. 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. 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 4fbe488f4..f3fc52f98 100644 --- a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst @@ -11,7 +11,7 @@ NAME **** -\ **rmvm**\ - Removes HMC-, DFM-, IVM-, KVM-, Vmware- and zVM-managed partitions or virtual machines. +\ **rmvm**\ - Removes HMC-, DFM-, IVM-, KVM-, VMware- and zVM-managed partitions or virtual machines. ******** @@ -25,18 +25,18 @@ SYNOPSIS \ **rmvm [-V| -**\ **-verbose]**\ \ *noderange*\ \ **[-r] [-**\ **-service]**\ -For KVM and Vmware: +For KVM and VMware: =================== -\ **rmvm [-p] [-f]**\ +\ **rmvm [-p] [-f]**\ \ *noderange*\ PPC (using Direct FSP Management) specific: =========================================== -\ **rmvm**\ \ *noderange*\ +\ **rmvm [-p]**\ \ *noderange*\ @@ -65,9 +65,7 @@ OPTIONS \ **-**\ **-service**\ Remove the service partitions of the specified CECs. -\ **-p**\ 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. - -\ **-p|-**\ **-part**\ Remove the specified partiton on normal power machine. +\ **-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. \ **-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/nodestat.1.pod b/xCAT-client/pods/man1/nodestat.1.pod index caf39cdde..42a0dc5f0 100644 --- a/xCAT-client/pods/man1/nodestat.1.pod +++ b/xCAT-client/pods/man1/nodestat.1.pod @@ -37,7 +37,7 @@ The following is an example of the settings in the B table: Keywords to use: - apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key filed in a different row. + apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key field in a different row. 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. diff --git a/xCAT-client/pods/man1/rmvm.1.pod b/xCAT-client/pods/man1/rmvm.1.pod index 0dbba6788..959a350d8 100644 --- a/xCAT-client/pods/man1/rmvm.1.pod +++ b/xCAT-client/pods/man1/rmvm.1.pod @@ -1,6 +1,6 @@ =head1 NAME -B - Removes HMC-, DFM-, IVM-, KVM-, Vmware- and zVM-managed partitions or virtual machines. +B - Removes HMC-, DFM-, IVM-, KVM-, VMware- and zVM-managed partitions or virtual machines. =head1 SYNOPSIS @@ -10,13 +10,13 @@ B B I B<[-r] [--service]> -=head2 For KVM and Vmware: +=head2 For KVM and VMware: -B +B I =head2 PPC (using Direct FSP Management) specific: -B I +B I =head1 DESCRIPTION @@ -37,9 +37,7 @@ B<-r> Retain the data object definitions of the nodes. B<--service> Remove the service partitions of the specified CECs. -B<-p> 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. - -B<-p|--part> Remove the specified partiton on normal power machine. +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<-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-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index e9089c564..c2ba52cd6 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -1577,7 +1577,7 @@ sub tabdb if ($rep) { return tabdb($rep->[0], $rep->[1], $rep->[2]); } else { - $tmplerr="Unable to find requested filed <$field> from table <$table>, with key <$key>" + $tmplerr="Unable to find requested field <$field> from table <$table>, with key <$key>" } } return ""; @@ -1586,7 +1586,7 @@ sub tabdb # check for site.xcatdebugmode if (($table =~ /site/) and ($key =~ /xcatdebugmode/)) { if ((($ent->{$field}) ne "0") and (($ent->{$field}) ne "1") and (($ent->{$field}) ne "2")) { - $tmplerr="Unable to recognise filed <$field> from table <$table>, with key <$key>. Please enter '0' '1' or '2'" + $tmplerr="Unable to recognise field <$field> from table <$table>, with key <$key>. Please enter '0' '1' or '2'" } } } diff --git a/xCAT-server/lib/xcat/monitoring/xcatmon.pm b/xCAT-server/lib/xcat/monitoring/xcatmon.pm index 61db830a0..02228ba80 100644 --- a/xCAT-server/lib/xcat/monitoring/xcatmon.pm +++ b/xCAT-server/lib/xcat/monitoring/xcatmon.pm @@ -418,7 +418,7 @@ sub getDescription { ping-interval: the number of minutes between each nmap/fping operation. The default value is 3. apps: a list of comma separated application names whose status will be queried. - For how to get the status of each app, look for app name in the key filed + For how to get the status of each app, look for app name in the key field in a different row. port: the application daemon port number, if not specified, use internal list, then /etc/services. From 53e3546e61eed81a56e5acaa8b1a91826192a7bb Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 14 Apr 2016 23:14:24 -0400 Subject: [PATCH 22/52] add dependencies for diskless --- xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist index b1a6d26db..5c4dd377e 100644 --- a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist +++ b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist @@ -11,3 +11,4 @@ python-devel lsof redhat-rpm-config rpm-build +libnl From 7aae5f4181dcbe85f67f031456b4532c523801fb Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 14 Apr 2016 23:16:19 -0400 Subject: [PATCH 23/52] add dependencies for diskless --- .../share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist index 6e8e5c887..a0979ff1a 100644 --- a/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist +++ b/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist @@ -1 +1,10 @@ python-libxml2 +tcsh +libatk-1_0-0 +python +tcl +lsof +libgtk-2_0-0 +tk +libnl1 +pciutils From 4c1c7c3228361a6eaab489a727753bd3f36e5c48 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 15 Apr 2016 02:41:39 -0400 Subject: [PATCH 24/52] modify docker command testcase during to issue 882 --- xCAT-test/autotest/testcase/dockercommand/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/dockercommand/cases0 b/xCAT-test/autotest/testcase/dockercommand/cases0 index 59f327d31..f3bd01e96 100644 --- a/xCAT-test/autotest/testcase/dockercommand/cases0 +++ b/xCAT-test/autotest/testcase/dockercommand/cases0 @@ -8,7 +8,7 @@ cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag= check:rc==0 cmd:rpower $$DOCKERCN stop check:rc==0 -check:ouptut=~container already stoped +check:ouptut=~container already stopped cmd:rpower $$DOCKERCN restart check:ouptut=~success cmd:rpower $$DOCKERCN state From 9ffa8e314deea7a19f127fae0e1eb697dc25d47b Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 15 Apr 2016 03:44:38 -0400 Subject: [PATCH 25/52] modify grammar error dependig on gongjie's comments --- .../infiniband/mlnxofed_ib_install_v2_diskful.rst | 6 +++--- .../infiniband/mlnxofed_ib_install_v2_diskless.rst | 14 +++++++------- .../mlnxofed_ib_install_v2_preparation.rst | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) 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 601f03229..78f5a35d5 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 @@ -38,7 +38,7 @@ Configuration for Diskful Installation .... - Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: + Or if you want to isolate InfiniBand dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: #cat //compute...pkglist @base @@ -99,9 +99,9 @@ Configuration for Diskful Installation rpower reset - After steps above, you can login target ndoe and find the Mellanox IB drives are located under ``/lib/modules//extra/``. + After steps above, you can login target node and find the Mellanox InfiniBand drives are located under ``/lib/modules//extra/``. - Issue ``ibv_devinfo`` command you can get the IB apater information :: + Issue ``ibv_devinfo`` command you can get the InfiniBand apater information :: # ibv_devinfo hca_id: mlx5_0 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 3a7636abd..9e83bc452 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 @@ -3,7 +3,7 @@ Configuration for Diskless Installation 1. Specify dependency package - Some dependencies need to be installed before running Mellanox scripts. These dependencies are different between different scenario. xCAT configurates these dependency packages by using ``pkglist`` attribute of ``osimage`` definition. Please refer to :doc:`Add Additional Software Packages ` for more information:: + Some dependencies need to be installed before running Mellanox scripts. These dependencies are different among different scenarios. xCAT can help user to install these dependency packages by adding these package names to the file specified by the ``pkglist`` attribute of the ``osimage`` definition. Please refer to :doc:`Add Additional Software Packages ` for more information:: # lsdef -t osimage --netboot-compute Object name: --netboot-compute @@ -30,7 +30,7 @@ Configuration for Diskless Installation .... - Or if you want to isolate IB dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: + Or if you want to isolate InfiniBand dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: #cat //compute...pkglist bash @@ -41,7 +41,7 @@ Configuration for Diskless Installation ..... #INCLUDE://# - xCAT ships some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + xCAT ships some InfiniBand pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: #cat //compute...pkglist bash @@ -55,7 +55,7 @@ Configuration for Diskless Installation 2. Prepare postinstall scripts - Edit ``postinstall`` script to trigger IB drvices installation during ``genimage``. Using below command to find out where the ``postinstall`` script is saved. :: + Edit ``postinstall`` script to trigger InfniBand drvices installation during ``genimage``. Using below command to find out where the ``postinstall`` script is defined. :: # lsdef -t osimage --netboot-compute Object name: --netboot-compute @@ -71,8 +71,8 @@ Configuration for Diskless Installation -p /install// -i $1 -n genimage - **[Note]** Mellanox OFED ISO was built on a certain kernal version, If your kernel version does not match with any of the Mellanox offered pre-built RPMs, you can pass ``--add-kernel-support`` attribute to Mellanox to rebuild these RPMs base on your kernel. The line added into ``.postinstall`` should like below :: - + **[Note]** Mellanox OFED ISO was built against a series of certain kernael versions, If the version of linux kernel you are using does not match with any of the Mellanox offered pre-built kernel modules, you can pass ``--add-kernel-support`` command line argument to Mellanox OFED installation script to build these kernel modules base on the version of linux kernel you are using. The line added into ``.postinstall`` should like below :: + /install/postscripts/mlnxofed_ib_install \ -p /install// -m --add-kernel-support -end- -i $1 -n genimage @@ -136,7 +136,7 @@ Configuration for Diskless Installation rsetboot net rpower reset - After installation, you can login target ndoe and issue ``ibv_devinfo`` command to verify if your IB driver works well. if everything is fine, you can get the IB apater information :: + After installation, you can login target ndoe and issue ``ibv_devinfo`` command to verify if your InfiniBand driver works well. if everything is fine, you can get the InfiniBand apater information :: # ibv_devinfo hca_id: mlx5_0 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 3b26a2a9e..d83840b4e 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 @@ -8,10 +8,10 @@ Obtain the Mellanox OFED ISO file from `Mellanox official Download Page ---.iso, you should download correct one according your environment. +* Mellanox provides OFED drivers in **tarball** and **ISO image** formats. xCAT only supports the **iso** format at this time. +* Mellanox provides different OFED ISOs depending on operating system and machine architecture, named like MLNX_OFED_LINUX----.iso, you should download correct one according to your environment. * Mellanox has some updates and known issues for echo OFED, please read `InfiniBand/VPI Software Overview `_ to understand these information. -* The Mellanox links offered above maybe outdate in future for Mellanox updates his web page, xCAT will keep updating for synchronization. If we don't update in time, please access `Mellanox web portal `_ to find ``Support/Education`` then ``InfiniBand/VPI Drivers`` lables. +* The Mellanox links offered above maybe outdate in future for Mellanox updates its web page, xCAT will keep updating for synchronization. If we don't update in time, please access `Mellanox web portal `_ to find ``Support/Education`` then ``InfiniBand/VPI Drivers`` lables. Prepare Install Script ---------------------- @@ -42,5 +42,5 @@ If need to pass ``--without-32bit --without-fw-update --add-kernel-support --for mlnxofed_ib_install -p /install// \ -m --without-32bit --without-fw-update --add-kernel-support --force -end- -**[Note]** We recommend to update your firmware to the latest version to avoid unexpected problem when you install ib for the first time. +**[Note]** We recommend to update your firmware to the version Mellanox supported in its release notes to avoid unexpected problem when you install InfiniBand driver. From 04dd30211f45c24b264ee581e2799d0151be087d Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 13 Apr 2016 03:42:54 -0400 Subject: [PATCH 26/52] mini refine for genesis script doxcat to have it run into bash if no NIC with IP facing xcat MN found --- xCAT-genesis-scripts/bin/doxcat | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 3dd876bc4..3ff63d83f 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -188,6 +188,7 @@ else done echo -n "Acquiring network addresses.." + 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 @@ -199,6 +200,10 @@ else fi done sleep 2 + tries=$(($tries+1)) + if [ $tries -ge 10 ]; then + break + fi done if [ -z "$bootnic" ]; then /bin/bash From 49a85041fe685a8a13c6faa11adf0c2422fd9bba Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 15 Apr 2016 04:07:25 -0400 Subject: [PATCH 27/52] replace infiniband to InfiniBand --- .../advanced/networks/infiniband/driver_and_installation.rst | 4 ++-- docs/source/advanced/networks/infiniband/index.rst | 4 ++-- .../networks/infiniband/mlnxofed_ib_install_v2_diskful.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/advanced/networks/infiniband/driver_and_installation.rst b/docs/source/advanced/networks/infiniband/driver_and_installation.rst index 1c22dfed9..d9d10a596 100644 --- a/docs/source/advanced/networks/infiniband/driver_and_installation.rst +++ b/docs/source/advanced/networks/infiniband/driver_and_installation.rst @@ -1,11 +1,11 @@ IB Driver Preparation and Installation ====================================== -xCAT provides sample postscripts to help you install the Mellanox OpenFabrics Enterprise Distribution (OFED) Infiniband Driver. These scripts are located in ``opt/xcat/share/xcat/ib/scripts/Mellanox/``. You can use these scripts directly or change them to satisfy your own environment. **xCAT 2.11 drops support of mlnxofed_ib_install and recommends using version 2 of the script: mlnxofed_ib_install.v2**. +xCAT provides sample postscripts to help you install the Mellanox OpenFabrics Enterprise Distribution (OFED) InfiniBand Driver. These scripts are located in ``opt/xcat/share/xcat/ib/scripts/Mellanox/``. You can use these scripts directly or change them to satisfy your own environment. **xCAT 2.11 drops support of mlnxofed_ib_install and recommends using version 2 of the script: mlnxofed_ib_install.v2**. .. toctree:: :maxdepth: 2 mlnxofed_ib_install_v2_usage.rst mlnxofed_ib_install_v1_usage.rst - \ No newline at end of file + diff --git a/docs/source/advanced/networks/infiniband/index.rst b/docs/source/advanced/networks/infiniband/index.rst index 928ab7c80..c525d6c95 100644 --- a/docs/source/advanced/networks/infiniband/index.rst +++ b/docs/source/advanced/networks/infiniband/index.rst @@ -1,7 +1,7 @@ -Infiniband (Mellanox) +InfiniBand (Mellanox) ===================== -xCAT offers a certain degree support for Mellanox infiniband product, it help you to configurate Mellanox infiniband products easily. For more information about Mellanox infiniband, please refer to `Mellanox official site `_. +xCAT offers a certain degree support for Mellanox InfiniBand product, it help you to configurate Mellanox InfiniBand products easily. For more information about Mellanox InfiniBand, please refer to `Mellanox official site `_. .. 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 78f5a35d5..449009446 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 @@ -9,7 +9,7 @@ Configuration for Diskful Installation chdef -p postscripts="mlnxofed_ib_install -p /install//" - xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drives work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox dreives. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarioes Have Been Verified `. You can try this way in other else scenarios if you needed. + xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drivers work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox drivers. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarioes Have Been Verified `. You can try this way in other else scenarios if you needed. 2. Specify dependency package From 3d4b215b33da116fa0b0ba0f2db001cf6354c99d Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 15 Apr 2016 05:13:55 -0400 Subject: [PATCH 28/52] Fix issue 863: mac could not be assigned to docker container --- xCAT-server/lib/xcat/plugins/docker.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/docker.pm b/xCAT-server/lib/xcat/plugins/docker.pm index 7f4c1ad6a..b9ff4a16c 100755 --- a/xCAT-server/lib/xcat/plugins/docker.pm +++ b/xCAT-server/lib/xcat/plugins/docker.pm @@ -1078,6 +1078,10 @@ sub genreq_for_mkdocker { my ($node, $dockerhost, $method, $api) = @_; my $dockerinfo = $node_hash_variable{$node}; my %info_hash = (); + if (defined($dockerinfo->{flag})) { + my $flag_hash = decode_json($dockerinfo->{flag}); + %info_hash = %$flag_hash; + } #$info_hash{name} = '/'.$node; #$info_hash{Hostname} = ''; #$info_hash{Domainname} = ''; @@ -1089,11 +1093,6 @@ sub genreq_for_mkdocker { $info_hash{HostConfig}->{NetworkMode} = $dockerinfo->{nics}; $info_hash{NetworkDisabled} = JSON::false; $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{IPAMConfig}->{IPv4Address} = $dockerinfo->{ip}; - $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{MacAddress} = $dockerinfo->{mac}; - if (defined($dockerinfo->{flag})) { - my $flag_hash = decode_json($dockerinfo->{flag}); - %info_hash = (%info_hash, %$flag_hash); - } my $content = encode_json \%info_hash; return genreq($node, $dockerhost, $method, $api, $content); } From 3cfa94229f54df08b77c158393d9cca0d2b440e6 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 15 Apr 2016 17:25:16 +0800 Subject: [PATCH 29/52] Add mac attribute It approves that the docker can deal with mac address correctly when creating. The commit f8e3da2280cf449e3e3950df7eff1c8e42dcc268 is useless. --- docs/source/advanced/docker/lifecycle_management.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/advanced/docker/lifecycle_management.rst b/docs/source/advanced/docker/lifecycle_management.rst index 95443d918..cd3385d20 100644 --- a/docs/source/advanced/docker/lifecycle_management.rst +++ b/docs/source/advanced/docker/lifecycle_management.rst @@ -94,6 +94,7 @@ After the dockerhost is ready, a docker instance can be managed through xCAT com dockernics=mynet0 groups=docker,all ip=10.0.120.1 + mac=02:42:0a:00:78:01 mgt=docker postbootscripts=otherpkgs postscripts=syslog,remoteshell,syncfiles From 9c72e470ff5c04fa208b9904eb78071dc1235495 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 5 Feb 2016 11:12:36 -0500 Subject: [PATCH 30/52] Add in information about the management node configuration during the install of the management node so that there is no need to repeat the same information in the admin guide later on in the documentation. --- .../install-guides/apt/prepare_mgmt_node.rst | 28 +++++++++++------ .../guides/install-guides/common_sections.rst | 11 ++----- .../install-guides/yum/prepare_mgmt_node.rst | 31 ++++++++++++++----- .../zypper/prepare_mgmt_node.rst | 23 +++++++++++--- 4 files changed, 63 insertions(+), 30 deletions(-) diff --git a/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst b/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst index f0ca608fb..f67fefc32 100644 --- a/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst +++ b/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst @@ -33,16 +33,24 @@ xCAT uses the apt package manager on Ubuntu Linux distributions to install and r gpgcheck=1 -Set up Network --------------- +Configure the Management Node +----------------------------- -The Management Node IP address should be set to a **static** IP address. +By setting properties on the Management Node before installing the xCAT software will allow xCAT to automatically configure key attributes in the xCAT ``site`` table during the install. -Modify the ``interfaces`` file in ``/etc/network`` and configure a static IP address. :: - - # The primary network interface - auto eth0 - iface eth0 inet static - address 10.3.31.11 - netmask 255.0.0.0 +#. Ensure a hostname is configured on the management node by issuing the ``hostname`` command. [*It's recommended to use a fully qualified domain name (FQDN) when setting the hostname*] + #. To set the hostname of *xcatmn.cluster.com*: :: + + hostname xcatmn.cluster.com + + #. Add the hostname to the ``/etc/hostname`` and ``/etc/hosts`` to persist the hostname on reboot. + + #. Reboot or run ``service hostname restart`` to allow the hostname to take effect and verify the hostname command returns correctly: + + * ``hostname`` + * ``hostname -d`` - should display the domain + +#. Reduce the risk of the Management Node IP address being lost by setting the interface IP to **STATIC** in the ``/etc/network/interfaces`` configuration file. + +#. Configure any domain search strings and nameservers using the ``resolvconf`` command. diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index be5e43d22..b4646a0cb 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -3,6 +3,9 @@ For the current list of operating systems supported and verified by the development team for the different releases of xCAT, see the :doc:`xCAT2 Release Notes `. +**Disclaimer** These instructions are intended to only be guidelines and specific details may differ slightly based on the operating system version. Always refer to the operating system documentation for the latest recommended procedures. + + .. END_see_release_notes .. BEGIN_install_os_mgmt_node @@ -26,14 +29,6 @@ The system requirements for your xCAT management node largely depend on the size .. END_install_os_mgmt_node -.. BEGIN_setup_mgmt_node_network - -The Management Node IP address should be set to a **static** IP address. - -Modify the ``ifcfg-`` file in ``/etc/sysconfig/network-scripts`` and configure a static IP address. - -.. END_setup_mgmt_node_network - .. BEGIN_install_xcat_introduction xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` diff --git a/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst b/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst index d02ec031e..7dbc7d0d7 100644 --- a/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst +++ b/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst @@ -15,9 +15,8 @@ Configure the Base OS Repository xCAT uses the yum package manager on RHEL Linux distributions to install and resolve dependency packages provided by the base operating system. Follow this section to create the repository for the base operating system on the Management Node -#. Copy the DVD iso file to ``/tmp`` on the Management Node: :: - - # This example will use RHEL-LE-7.1-20150219.1-Server-ppc64le-dvd1.iso +#. Copy the DVD iso file to ``/tmp`` on the Management Node. + This example will use file ``RHEL-LE-7.1-20150219.1-Server-ppc64le-dvd1.iso`` #. Mount the iso to ``/mnt/iso/rhels7.1`` on the Management Node. :: @@ -33,10 +32,26 @@ xCAT uses the yum package manager on RHEL Linux distributions to install and res gpgcheck=1 -Set up Network --------------- +Configure the Management Node +----------------------------- -.. include:: ../common_sections.rst - :start-after: BEGIN_setup_mgmt_node_network - :end-before: END_setup_mgmt_node_network +By setting properties on the Management Node before installing the xCAT software will allow xCAT to automatically configure key attributes in the xCAT ``site`` table during the install. + +#. Ensure a hostname is configured on the management node by issuing the ``hostname`` command. [*It's recommended to use a fully qualified domain name (FQDN) when setting the hostname*] + + #. To set the hostname of *xcatmn.cluster.com*: :: + + hostname xcatmn.cluster.com + + #. Add the hostname to the ``/etc/sysconfig/network`` in order to persist the hostname on reboot. + + + #. Reboot the server and verify the hostname by running the following commands: + + * ``hostname`` + * ``hostname -d`` - should display the domain + +#. Reduce the risk of the Management Node IP address being lost by setting the IP to **STATIC** in the ``/etc/sysconfig/network-scripts/ifcfg-`` configuration files. + +#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file. diff --git a/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst b/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst index a795339b4..fce8dc660 100644 --- a/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst +++ b/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst @@ -33,10 +33,25 @@ xCAT uses the zypper package manager on SLES Linux distributions to install and gpgcheck=1 -Set up Network --------------- +Configure the Management Node +----------------------------- -The Management Node IP address should be set to a **static** IP address. +By setting properties on the Management Node before installing the xCAT software will allow xCAT to automatically configure key attributes in the xCAT ``site`` table during the install. -Modify the ``ifcfg-`` file in ``/etc/sysconfig/network/`` and configure a static IP address. +#. Ensure a hostname is configured on the management node by issuing the ``hostname`` command. [*It's recommended to use a fully qualified domain name (FQDN) when setting the hostname*] + #. To set the hostname of *xcatmn.cluster.com*: :: + + hostname xcatmn.cluster.com + + #. Add the hostname to the ``/etc/hostname`` in order to persist the hostname on reboot. + + + #. Reboot the server and verify the hostname by running the following commands: + + * ``hostname`` + * ``hostname -d`` - should display the domain + +#. Reduce the risk of the Management Node IP address being lost by setting the IP to **STATIC** in the ``/etc/sysconfig/network/ifcfg-`` configuration files. + +#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file. From bb48f7f93d3ea3eb8af266ba738a1d78d06ec4c2 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 5 Feb 2016 11:50:35 -0500 Subject: [PATCH 31/52] Refactored the configure_xcat section in the admin guide, moving some of the basic configuration over to the install guide so that we do not need to mention that in the guide. - split the configure_xcat.rst file into separate files under a configure directory so that users can go from one section to another without being overloaded with information --- .../admin-guides/manage_clusters/index.rst | 8 +- .../ppc64le/configure/index.rst | 11 + .../ppc64le/configure/networks.rst | 46 ++++ .../ppc64le/configure/password.rst | 59 ++++ .../ppc64le/configure/site.rst | 36 +++ .../ppc64le/configure_xcat.rst | 251 ------------------ .../manage_clusters/ppc64le/index.rst | 6 +- 7 files changed, 157 insertions(+), 260 deletions(-) create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst delete mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/index.rst b/docs/source/guides/admin-guides/manage_clusters/index.rst index 9efd4b00d..d44e4a099 100644 --- a/docs/source/guides/admin-guides/manage_clusters/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/index.rst @@ -1,14 +1,10 @@ Manage Clusters =============== -This chapter introduces the procedures of how to manage a real cluster. Basically, it includes the following parts: +The following provides detailed information to help start managing your cluster using xCAT. - * Discover and Define Nodes - * Deploy/Configure OS for the Nodes - * Install/Configure Applications for the Nodes - * General System Management Work for the Nodes +The sections are organized based on hardware architecture. -You should select the proper sub-chapter according to the hardware type of your cluster. If having a mixed cluster that has multiple types of hardware, you have to refer to multiple sub-chapters accordingly. .. toctree:: :maxdepth: 2 diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst new file mode 100644 index 000000000..47a731063 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst @@ -0,0 +1,11 @@ +Configure xCAT +============== + +After install of xCAT software on the management node, set some site specific configuration values before using xCAT. + +.. toctree:: + :maxdepth: 2 + + site.rst + networks.rst + password.rst 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 new file mode 100644 index 000000000..c76f83302 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst @@ -0,0 +1,46 @@ +Set attributes in the ``networks`` table +======================================== + +#. Display the network settings defined in the xCAT ``networks`` table using: ``tabdump networks`` :: + + #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers, + dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain, + comments,disable + "10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth0","10.0.0.101",,"10.4.27.5",,,,,,,,,,,, + + A default network is created for the detected primary network using the same netmask and gateway. There may be additional network entries defined in the table for any additional networks present on the management node when xCAT is installed. + +#. To define additional networks into the ``networks`` table, use one of the following options: + + * (**recommended**) Use ``mkdef`` to create/update an entry into ``networks`` table: + + To create a network entry for 192.168.X.X/16 with a gateway of 192.168.1.254: :: + + mkdef -t network -o net1 net=192.168.0.0 mask=255.255.0.0 gateway=192.168.1.254 + + * Use the ``tabedit`` command to modify the networks table directly in an editor: ``tabedit networks`` + + * Use the ``makenetworks`` command to automatically generate a entry in the ``networks`` table + +#. Verify the network statements + + **Domain** and **nameserver** attributes must be configured in the ``networks`` table or in the ``site`` table for xCAT to function properly. + + + +Initialize DHCP services +------------------------ + +#. (**Optional**) Configure DHCP to listen on different network interfaces + + xCAT allows specifying different network intercaces thateDHCP can listen on for different nodes or node groups. If this is not needed, go to the next step. To set dhcpinterfaces :: + + chdef -t site dhcpinterfaces='xcatmn|eth1,eth2;service|bond0' + + For more information, see ``dhcpinterfaces`` keyword n the :doc:`site table `. + + +#. Create a new DHCP configuration file with the networks defined using the ``makedhcp`` command. :: + + makedhcp -n + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst new file mode 100644 index 000000000..10ce7da6b --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst @@ -0,0 +1,59 @@ +Configure passwords +=================== + +#. Configure the system password for the ``root`` user on the compute nodes using one of the following method: + + * Set using the :doc:`chtab ` command: :: + + chtab key=system passwd.username=root passwd.password=abc123 + + To encrypt the password using ``openssl``, use the following command: :: + + chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123` + + * Directly edit the passwd table using the :doc:`tabedit ` command. + + +#. Configure the passwords for various management methods + + * For IPMI/BMC managed systems: :: + + chtab key=ipmi password.username=USERID passwd.password=PASSW0RD + + * For HMC managed systems: :: + + chtab key=hmc passwd.username=hscroot passwd.password=abc123 + + The username and password for the HMC can be assigned directly to the HMC node object definition in xCAT. This is needed when the HMC username/password is different for each HMC. :: + + mkdef -t node -o hmc1 groups=hmc,all nodetype=ppc hwtype=hmc mgt=hmc \ + username=hscroot password=hmcPassw0rd + + * For Blade managed systems: :: + + chtab key=blade passwd.username=USERID passwd.password=PASSW0RD + + * For FSP/BPA (Flexible Service Processor/Bulk Power Assembly), if the passwords are set to the factory defaults, you must change them before running and commands to them. :: + + rspconfig frame general_passwd=general, + rspconfig frame admin_passwd=admin, + rspconfig frame HMC_passwd=, + + +#. If the REST API is being used configure a user and set a policy rule in xCAT. + + #. Create a non root user that will be used to make the REST API calls. :: + + useradd xcatws + passwd xcatws # set the password + + #. Create an entry for the user into the xCAT ``passwd`` table. :: + + chtab key=xcat passwd.username=xcatws passwd.password= + + #. Set a policy in the xCAT ``policy`` table to allow the user to make calls against xCAT. :: + + mkdef -t policy 6 name=xcatws rule=allow + + + When making calls to the xCAT REST API, pass in the credentials using the following attributes: ``userName`` and ``userPW`` diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst new file mode 100644 index 000000000..33e8deaa0 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst @@ -0,0 +1,36 @@ +Set attributes in the ``site`` table +==================================== + +#. Verify the following attributes have been correctly set in the xCAT ``site`` table. + + * domain + * forwarders + * master [#]_ + * nameservers + + *For more information on the keywords, see the DHCP ATTRIBUTES in the :doc:`site ` table.* + + If the fields are not set or need to be changed, use the xCAT ``chdef`` command: :: + + chdef -t site domain="domain_string" + chdef -t site fowarders="forwarders" + chdef -t site master="xcat_master_ip" + chdef -t site nameservers="nameserver1,nameserver2,etc" + +.. [#] The value of the ``master`` attribute in the site table can be set to either the Management Node IP or Service Node IP. + +Initialize DNS services +----------------------- + +#. Initialize the DNS [#]_ services on the xCAT Management Node: :: + + makedns -n + + Verify DNS is working by running ``nslookup`` against your Management Node: :: + + nslookup + + For more information on DNS, refer to :ref:`dns_label` + + +.. [#] Setting up name resolution and the ability to have hostname resolved to IP addresses is **required** for xCAT. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst deleted file mode 100644 index 70b877814..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst +++ /dev/null @@ -1,251 +0,0 @@ -Configure xCAT -============== - -After you installed xCAT packages on management node,you have to configure the management node first .This document introduces how to configure the environment well before you can use xCAT normally. - -Here is a summary of steps required for the xCAT management node . - -:: - - 1.Check Site Table - 2.Check Networks - 3.Configure Password Table - 4.Initialize DHCP - -Check Site Table ----------------- - -After xCAT is installed , site table should be checked. Please verify following attributes and make sure they are correctly set. :: - - domain: The DNS domain name (exg. cluster.com). - - nameservers: A comma delimited list of DNS servers that each node in this network should use. This value will end up in the nameserver settings of the /etc/resolv.conf on each node in this network. If this attribute value is set to the IP address of an xCAT node, make sure DNS is running on it. In a hierarchical cluster, you can also set this attribute to "" to mean the DNS server for each node in this network should be the node that is managing it (either its service node or the management node). Used in creating the DHCP network definition, and DNS configuration. - - forwarders: The DNS servers at your site that can provide names outside of the cluster. The makedns command will configure the DNS on the management node to forward requests it does not know to these servers.Note that the DNS servers on the service nodes will ignore this value and always be configured to forward requests to the management node. - - master: The hostname of the xCAT management node, as known by the nodes. - -1. Before xCAT build is installed, management HostName and management DomainName should be configured in DNS configure file **/etc/resolv.conf**, after xCAT is installed, nameserver, master, domain and forwarder will be set correctly in site table. - - 1.1.Before install xCAT: - - * Modify **resolv.conf** file like example1: - - :: - - cat /etc/resolv.conf - ; generated by /usr/sbin/dhclient-script - search - nameserver - nameserver - - * Configure hostname setting so that using ``hostname`` could get the machine hostname like example2: - - :: - - mn:~ # hostname - mn - - * Configure domain name setting so that using ``hostname -d`` could get domain name like example3: - - :: - - [root@mn ~]# hostname -d - pok.stglabs.ibm.com - - 1.2 After xCAT is installed: - - * Using tabdump site to check ``site table``, the outputs will like example4: - - :: - - "domain","",, - "forwarders","",, - "master","",, - "nameservers","",, - -2. If configures in above 1 are not configured before xCAT is installed, the outputs of ``tabdump site`` are as following: :: - - "domain"," ",, - "forwarders",,, - "master","NORESOLUTION",, - "nameservers","NORESOLUTION" - - * In this situation, please configure the **/etc/resolv.conf** file according to example1. Then using ``chdef`` (exg. ``chdef -t site master=`` ) or ``tabedit site`` command to configure the site table according to example4. - -3.After site table is configured - - * Please initialize DNS using: :: - - makedns -n - - * Verify DNS work well using: :: - - nslookup - - * It gives out the Management node hostname and resolved ip. Here is an example: :: - - c910f04x27v05:~ # nslookup c910f04x27v05 - Server: 10.4.27.5 - Address: 10.4.27.5#53 - Name: c910f04x27v05.pok.stglabs.ibm.com - Address: 10.4.27.5 - -**Note**: - -#. The value of attribute master in site table can be set either management node ip or service node ip. -#. Setting up name resolution and having the nodes resolved to IP addresses are required in xCAT clusters . -#. Set site.forwarders to your site-wide DNS servers that can resolve site or public hostnames. The DNS on the MN will forward any requests it can't answer to these servers. -#. For more dns explanation please refer to :ref:`dns_label` - -Check Networks --------------- - -Please check networks tables: :: - - tabdump networks - -The outputs are as following: :: - - #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,comments,disable - "10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth0","10.0.0.103",,"10.4.27.5",,,,,,,,,,,, - -**Note**:Networks table will be set after xCAT is installed using default net,default mask and default gateway. - -1.If the cluster-facing NICs were not configured when xCAT was installed, or if there are more networks in the cluster that are only available via the service nodes or compute nodes, users can use such options below to create network definitions (exg.50.3.5.5). - - 1.1(Optinal) How to configured networks table: - - * Using ``mkdef`` to update networks table. :: - - mkdef -t network -o net1 net=9.114.0.0 mask=255.255.255.224 gateway=9.114.113.254 - - net The network address. - - mask The network mask. - - gateway The network gateway. - - * Or using ``tabedit`` to modify networks table. :: - - Tabedit networks - - * Or using command ``makenetworks`` to automatically generate networks table entry. :: - - makenetworks - - 1.2.Verify networks table similar like: - - :: - - # tabdump networks - #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,nodehostname,comments,disable - 50_0_0_0-255_0_0_0","50.0.0.0","255.0.0.0","eth1","",,"50.3.5.5",,,,,,,,,,,, - -**Note**:Domain and nameservers values must be provided either in the network definiton corresponding to the node or in the site definition. - -Configure Password Table -------------------------- - -The password should be set in the passwd table that will be assigned to root when the node is installed. You can modify this table using ``tabedit``. To change the default password for root on the nodes, change the system line. :: - - tabedit passwd - #key,username,password,cryptmethod,comments,disable - "system","root","cluster",,, - "hmc","hscroot","ABC123",,, - -Or :: - - chtab key=system passwd.username=root passwd.password=cluster - -**Note**: - -#. Currently xCAT puts the root password on the node only during install. It is taken from the passwd table where key=system. The new subcluster support requires a unique password for each subcluster to be installed. - -#. The xCAT database needs to contain the proper authentication working with hmc/blade/ipmi userid and password. Example for passwd set up: - - :: - - chtab key=hmc passwd.username=hscroot passwd.password=abc123 - or - chtab key=blade passwd.username=USERID passwd.password=PASSW0RD - or - chtab key=ipmi passwd.username=USERID passwd.password=PASSW0RD - -#. (Optional)If the BPA passwords are still the factory defaults, you must change them before running any other commands to them. - - :: - - rspconfig frame general_passwd=general, - rspconfig frame admin_passwd=admin, - rspconfig frame HMC_passwd=, - -#. (Optional)The username and password for xCAT to access an HMC can also be assigned directly to the HMC node object using the ``mkdef`` or ``chdef`` commands. This assignment is useful when a specific HMC has a username and/or password that is different from the default one specified in the passwd table. For example, to create an HMC node object and set a unique username or password for it: - - :: - - mkdef -t node -o hmc1 groups=hmc,all nodetype=ppc hwtype=hmc mgt=hmc username=hscroot password=abc1234 - - Or to change it if the HMC definition already exists: - - chdef -t node -o hmc1 username=hscroot password=abc1234 - -#. (Optional)The REST API calls need to provide a username and password. When this request is passed to xcatd, it will first verify that this user/pw is in the xCAT passwd table, and then xcatd will look in the policy table to see if that user is allowed to do the requested operation. - - * The account which key is xcat will be used for the REST API authentication. The username and password should be passed in with the attirbutes. :: - - userName: Pass the username of the account - userPW: Pass the password of the account - - * Use non-root account to create new user and setup the password and policy rules. :: - - useradd wsuser - passwd wsuser # set the password - tabch key=xcat,username=wsuser passwd.password=cluster - mkdef -t policy 6 name=wsuser rule=allow - - * Use root account: :: - - tabch key=xcat,username=root passwd.password= - -Initialize DHCP ---------------- - -Initialize DHCP service -~~~~~~~~~~~~~~~~~~~~~~~ - -Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on. :: - - makedhcp -n - -(Optional)Setup the DHCP interfaces in site table -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To set up the site table dhcp interfaces for your system p cluster, identify the correct interfaces that xCAT should listen to on your management node and service nodes. :: - - chdef -t site dhcpinterfaces='pmanagenode|eth1;service|eth0' - - makedhcp -n - - dhcpinterfaces: The network interfaces DHCP should listen on. If it is the same for all nodes, use a simple comma-separated list of NICs. To specify different NICs for different nodes:xcatmn|eth1,eth2;service|bond0.In this example xcatmn is the name of the xCAT MN, and DHCP there should listen on eth1 and eth2. On all of the nodes in group 'service' DHCP should listen on the bond0 nic. - -**Note**:To verify makedhcp work well, please check nic,domain-name ,domain-servers in dhcpd.conf , for example: :: - - shared-network nic { - subnet 10.0.0.0 netmask 255.0.0.0 { - authoritative; - max-lease-time 43200; - min-lease-time 43200; - default-lease-time 43200; - option routers 10.2.1.12; - next-server 10.2.1.13; - option log-servers ; - option ntp-servers ; - option domain-name ""; - option domain-name-servers ; - option domain-search "pok.stglabs.ibm.com"; - zone pok.stglabs.ibm.com. { - primary 10.2.1.13; key xcat_key; - } - - 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 2ae5caba4..882086fa2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -1,14 +1,14 @@ IBM Power LE / OpenPOWER ========================= -This chapter introduces the procedure of how to manage an IBM Power LE/OpenPower cluster. Generally speaking, the processor of **Compute Node** is **IBM Power Chip** based and the management module is **BMC** based. +The following sections documents the procedures in managing IBM Power LE (Little Endian) / OpenPOWER servers in an xCAT cluster. +These are machines use the IBM Power Architecture and is **IPMI** managed. -For a new user, you are recommended to read this chapter in order since later section depends on the execute result of previous section. .. toctree:: :maxdepth: 2 - configure_xcat.rst + configure/index.rst discovery/index.rst management.rst diskful/index.rst From f283877e840525c5f32854f969b64a17a241ff55 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 9 Feb 2016 13:23:28 -0500 Subject: [PATCH 32/52] Refactor the mtms based discovery section to try and make the MTMS hardware discovery process more clear --- .../ppc64le/discovery/config_environment.rst | 17 +--- .../ppc64le/discovery/index.rst | 24 ++--- .../ppc64le/discovery/mtms/discovery.rst | 91 +++++++++++++++++++ .../discovery/mtms/example_environment.rst | 5 + .../ppc64le/discovery/mtms/index.rst | 34 +++++++ .../discovery/mtms/preverification.rst | 35 +++++++ 6 files changed, 181 insertions(+), 25 deletions(-) create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst index 028e73d61..95c71c100 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst @@ -4,7 +4,6 @@ Configure xCAT Configure network table ``````````````````````` - Normally, there will be at least two entries for the two subnet on MN in ``networks`` table after xCAT is installed:: #tabdump networks @@ -50,18 +49,10 @@ For hardware management with ipmi, add the following line:: Verify the genesis packages ``````````````````````````` -Genesis packages are used to **create the root image for network boot** and **MUST** be installed before doing hardware discovery. +The **xcat-genesis** packages should have been installed when xCAT was installed, but would cause problems if missing. **xcat-genesis** packages are required to create the genesis root image to do hardware discovery and the genesis kernel sits in ``/tftpboot/xcat/``. Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: -* **[RH]**:: +* **[RHEL/SLES]**: ``rpm -qa | grep -i genesis`` - # rpm -qa |grep -i genesis - xCAT-genesis-scripts-ppc64-2.10-snap201507240527.noarch - xCAT-genesis-base-ppc64-2.10-snap201505172314.noarch +* **[Ubuntu]**: ``dpkg -l | grep -i genesis`` -* **[ubuntu]**:: - - # dpkg -l | grep genesis - ii xcat-genesis-base-ppc64 2.10-snap201505172314 all xCAT Genesis netboot image - ii xcat-genesis-scripts 2.10-snap201507240105 ppc64el xCAT genesis - -**Note:** If the two packages are not installed, install them first and then run ``mknb ppc64`` to create the network boot root image. +If missing, install them from the ``xcat-deps`` package and run ``mknb ppc64`` to create the genesis network boot root image. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst index 242dded82..76bab886a 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst @@ -1,11 +1,20 @@ Hardware Discovery & Define Node ================================ -Have the servers to be defined as **Node Object** in xCAT is the first step to do for a cluster management. +In order to manage machines using xCAT, the machines need to be defined as ``node`` objects in xCATs database. The :doc:`xCAT Objects ` documentation describes the process for manually creating ``node`` objects one by one using the xCAT ``mkdef`` command. This is valid when managing a small sizes cluster but can be error prone and cumbersome when managing large sized clusters. -In the chapter :doc:`xCAT Object <../../../basic_concepts/xcat_object/index>`, it describes how to create a **Node Object** through `mkdef` command. You can collect all the necessary information of target servers and define them to a **xCAT Node Object** by manually run `mkdef` command. This is doable when you have a small cluster which has less than 10 servers. But it's really error-prone and inefficiency to manually configure SP (like BMC) and collect information for a large number servers. +xCAT provides several *automatic hardware discovery* methods to assist with hardware discovery by helping to simplify the process of detecting service processors (SP) and collecting various server information. The following are methods that xCAT supports: + + +.. toctree:: + :maxdepth: 2 + + mtms/index.rst + switch_discovery.rst + seq_discovery.rst + manually_define.rst + manually_discovery.rst -xCAT offers several powerful **Automatic Hardware Discovery** methods to simplify the procedure of SP configuration and server information collection. If your managed cluster has more than 10 servers, the automatic discovery is worth to take a try. If your cluster has more than 50 servers, the automatic discovery is recommended. Following are the brief characteristics and adaptability of each method, you can select a proper one according to your cluster size and other consideration. @@ -73,12 +82,3 @@ Following are the brief characteristics and adaptability of each method, you can You have to strictly boot on the node in order if you want the node has the expected name. Generally you have to waiting for the discovery process finished before power on the next one. -.. toctree:: - :maxdepth: 2 - - manually_define.rst - mtms_discovery.rst - switch_discovery.rst - seq_discovery.rst - manually_discovery.rst - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst new file mode 100644 index 000000000..cfebba91e --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst @@ -0,0 +1,91 @@ +Discover and Define Servers +=========================== + +When the IPMI-based server is connected to power, the BMC automatically boots up and tries to a DHCP IP address. Once the BMC gets an IP address, xCAT can discover the BMC and obtain some basic information. Use the :doc:`bmcdiscover ` command to scan the network for BMCs. + +#. Discover the BMCs over a network range. :: + + bmcdiscover --range 50.0.100.1-100 -t -z + + The output should be similar to: :: + + node-8247-22l-10112ca: + objtype=node + groups=all + bmc=50.0.100.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + nodetype=mp + hwtype=bmc + + By default, ``bmcdiscover`` will use the username/password for the "ipmi" key in the xCAT ``passwd`` table. You can specify a different username or password with command line optjons to ``bmcdiscover``. + +#. If the output looks good, run the command again using the ``-w`` option to write to the xCAT database and redirect the output to a file in order to create the **predefined** node stanzas: :: + + bmcdiscover --range 50.0.100.1-100 -t -z -w > predefined_bmc.stanza + +#. The discovered node stanza is now in the xCAT databased. Edit the ``predefined_bmc.stanza`` file and modify the following: + + #. Rename the ``node-8247-22l-10112ca`` to the intended hostname for the compute node + + #. Remove the ``nodetype`` and ``hwtype`` attributes for the node stanza + + The resulting predefined definition should be similar to: :: + + cn1: + objtype=node + groups=all + bmc=50.0.100.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + + +#. Define the predefined node to xCAT: [#]_ :: + + cat predefined_bmc.stanza | mkdef -z + + + +#. Modify the predefined node using xCAT commands + + #. Set the IP address for the compute node: :: + + chdef cn1 ip=10.0.101.1 + + #. Set the BMC IP address to a different value: :: + + chdef cn1 bmc=50.0.101.1 + + #. Set the chain table attribute to do BMC setup/discovery: :: + + chdef cn1 chain="runcmd=bmcsetup" + + +#. Add the node information to ``/etc/hosts`` and DNS: :: + + makehosts cn1 + makedns -n + + +#. [**Optional**] To monitor the node discovery process, configure conserver for the **discovered** nodes: :: + + makeconservercf node-8247-22l-10112ca + rcons node-8247-22l-10112ca + +#. Start the discovery process by booting the **discovered** node definition: :: + + rsetboot node-8247-22l-10112ca net + rpower node-8247-22l-10112ca on + +#. The discovery process should complete and update the status for the **predefined** node and update the status to "bmcready": :: + + lsdef cn1 | grep status + + Displaying the node attributes should show more attributes discoverd for the node, necessary for xCAT to do OS deployment. + + +.. [#] The changes made in the next step can be made directly into the ``predefined_bmc.stanza`` before importing to xCAT. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst new file mode 100644 index 000000000..95f91f758 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst @@ -0,0 +1,5 @@ +Environment +=========== + +.. include:: ../schedule_environment.rst + 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 new file mode 100644 index 000000000..b24899ebf --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst @@ -0,0 +1,34 @@ +MTMS-based Discovery +==================== + +MTMS is short for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial which is unique for each physical server. MTMS-based hardware discovery assumes that the administator has the MTMS information for all the physical servers and has a mapping for the MTMS and hostname/IP for the servers. + +Pros and Cons +------------- + +Pros +```` + + * Limited effort to get servers defined using xCAT hardware discovery engine + +Cons +```` + + * When compared to switch-based discovery, the administrator needs to be involved to create a **predefined-node** from each of the **discovered-nodes** stanzas. This could become difficult for a large number of servers. + + +Overview +-------- + + #. Automatically search and collect MTMS information from the servers + #. Define the **discovered-node** to xCAT + #. Create a **predefined-node** to xCAT providing additional properties + #. Power on the **discovered-nodes** triggering xCAT's hardware discovery engine. + + +.. toctree:: + :maxdepth: 2 + + preverification.rst + example_environment.rst + discovery.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst new file mode 100644 index 000000000..0e7c2b451 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst @@ -0,0 +1,35 @@ +Before Starting +=============== + +Before starting hardware discovery, ensure the following is configured to make the discovery process as smooth as possible. + +Password Table +-------------- + +In order to communicate with IPMI-based (bmc) hardware, verify that the xCAT ``passwd`` table contains an entry for ``ipmi`` defininig the username and password for IPMI-based servers. :: + + tabdump passwd | grep ipmi + + +Genesis Package +--------------- + +The **xcat-genesis** packages provides the utility to create the genesis network boot rootimage used by xCAT when doing hardware discivery. IT should have been installed during the xCAT installation and would cause problems if missing. + +Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: + + * **[RHEL/SLES]**: :: + + rpm -qa | grep -i genesis + + * **[Ubuntu]**: :: + + dpkg -l | grep -i genesis + + +If the packages are missing: + + #. Install them using the OS specific package manager from the ``xcat-deps`` repository + #. Create the network boot rootimage with the following command: ``mknb ppc64``. + The resulting genesis kernel should appear in the ``/tftpboot/xcat`` directory. + From 21e7f3bfe12dbbdfd9cf03aeb947ada02996e630 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 17 Feb 2016 14:51:16 -0500 Subject: [PATCH 33/52] Change wording based on review comments --- .../admin-guides/manage_clusters/ppc64le/configure/site.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst index 33e8deaa0..c7d54dee7 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst @@ -17,7 +17,7 @@ Set attributes in the ``site`` table chdef -t site master="xcat_master_ip" chdef -t site nameservers="nameserver1,nameserver2,etc" -.. [#] The value of the ``master`` attribute in the site table can be set to either the Management Node IP or Service Node IP. +.. [#] The value of the ``master`` attribute in the site table should be set as the IP address of the management node responsible for the compute node. Initialize DNS services ----------------------- From 60112243db52996ca02f3cd1d0ad51f1b23fb4ce Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 11 Mar 2016 14:57:15 -0500 Subject: [PATCH 34/52] Fix some spelling issues and wording issues in the configuration section --- .../manage_clusters/ppc64le/configure/index.rst | 2 +- .../manage_clusters/ppc64le/configure/networks.rst | 14 +++++++------- .../manage_clusters/ppc64le/configure/password.rst | 8 ++++---- .../manage_clusters/ppc64le/configure/site.rst | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst index 47a731063..766981112 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst @@ -1,7 +1,7 @@ Configure xCAT ============== -After install of xCAT software on the management node, set some site specific configuration values before using xCAT. +After installing xCAT onto the management node, configure some basic attributes for your cluster into xCAT. .. toctree:: :maxdepth: 2 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 c76f83302..5c6feeacf 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 @@ -8,15 +8,15 @@ Set attributes in the ``networks`` table comments,disable "10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth0","10.0.0.101",,"10.4.27.5",,,,,,,,,,,, - A default network is created for the detected primary network using the same netmask and gateway. There may be additional network entries defined in the table for any additional networks present on the management node when xCAT is installed. + A default network is created for the detected primary network using the same netmask and gateway. There may be additional network entries in the table for each network present on the management node where xCAT is installed. -#. To define additional networks into the ``networks`` table, use one of the following options: +#. To define additional networks, use one of the following options: - * (**recommended**) Use ``mkdef`` to create/update an entry into ``networks`` table: + * Use ``mkdef`` to create/update an entry into ``networks`` table. (**Recommended**) - To create a network entry for 192.168.X.X/16 with a gateway of 192.168.1.254: :: + To create a network entry for 192.168.X.X/16 with a gateway of 192.168.1.254: :: - mkdef -t network -o net1 net=192.168.0.0 mask=255.255.0.0 gateway=192.168.1.254 + mkdef -t network -o net1 net=192.168.0.0 mask=255.255.0.0 gateway=192.168.1.254 * Use the ``tabedit`` command to modify the networks table directly in an editor: ``tabedit networks`` @@ -31,13 +31,13 @@ Set attributes in the ``networks`` table Initialize DHCP services ------------------------ -#. (**Optional**) Configure DHCP to listen on different network interfaces +#. Configure DHCP to listen on different network interfaces (**Optional**) xCAT allows specifying different network intercaces thateDHCP can listen on for different nodes or node groups. If this is not needed, go to the next step. To set dhcpinterfaces :: chdef -t site dhcpinterfaces='xcatmn|eth1,eth2;service|bond0' - For more information, see ``dhcpinterfaces`` keyword n the :doc:`site table `. + For more information, see ``dhcpinterfaces`` keyword in the :doc:`site ` table. #. Create a new DHCP configuration file with the networks defined using the ``makedhcp`` command. :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst index 10ce7da6b..af22d16d8 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst @@ -1,9 +1,9 @@ Configure passwords =================== -#. Configure the system password for the ``root`` user on the compute nodes using one of the following method: +#. Configure the system password for the ``root`` user on the compute nodes. - * Set using the :doc:`chtab ` command: :: + * Set using the :doc:`chtab ` command: (**Recommended**) :: chtab key=system passwd.username=root passwd.password=abc123 @@ -14,11 +14,11 @@ Configure passwords * Directly edit the passwd table using the :doc:`tabedit ` command. -#. Configure the passwords for various management methods +#. Configure the passwords for Management modules of the compute nodes. * For IPMI/BMC managed systems: :: - chtab key=ipmi password.username=USERID passwd.password=PASSW0RD + chtab key=ipmi passwd.username=USERID passwd.password=PASSW0RD * For HMC managed systems: :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst index c7d54dee7..49911d4d2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst @@ -8,7 +8,7 @@ Set attributes in the ``site`` table * master [#]_ * nameservers - *For more information on the keywords, see the DHCP ATTRIBUTES in the :doc:`site ` table.* + For more information on the keywords, see the DHCP ATTRIBUTES in the :doc:`site ` table. If the fields are not set or need to be changed, use the xCAT ``chdef`` command: :: From 7e2c7b680da18169981e03c92c6d525b5709b9a2 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 25 Mar 2016 11:38:51 -0400 Subject: [PATCH 35/52] Refactor the MTMS section again to handle the DHCP and STATIC ip address case Delete the mtms_discovery.rst file since the content is in the mtms directory --- .../ppc64le/discovery/index.rst | 2 +- .../ppc64le/discovery/mtms/discovery.rst | 157 ++++++++++++------ .../discovery/mtms/example_environment.rst | 5 - .../ppc64le/discovery/mtms/index.rst | 29 ++-- .../discovery/mtms/preverification.rst | 35 ---- .../ppc64le/discovery/mtms/verification.rst | 39 +++++ .../ppc64le/discovery/mtms_discovery.rst | 80 --------- 7 files changed, 154 insertions(+), 193 deletions(-) delete mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst delete mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst delete mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst index 76bab886a..61de0fdc5 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst @@ -1,7 +1,7 @@ Hardware Discovery & Define Node ================================ -In order to manage machines using xCAT, the machines need to be defined as ``node`` objects in xCATs database. The :doc:`xCAT Objects ` documentation describes the process for manually creating ``node`` objects one by one using the xCAT ``mkdef`` command. This is valid when managing a small sizes cluster but can be error prone and cumbersome when managing large sized clusters. +In order to manage machines using xCAT, the machines need to be defined as xCAT ``node objects`` in the database. The :doc:`xCAT Objects ` documentation describes the process for manually creating ``node objects`` one by one using the xCAT ``mkdef`` command. This is valid when managing a small sizes cluster but can be error prone and cumbersome when managing large sized clusters. xCAT provides several *automatic hardware discovery* methods to assist with hardware discovery by helping to simplify the process of detecting service processors (SP) and collecting various server information. The following are methods that xCAT supports: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst index cfebba91e..71f10b962 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst @@ -1,79 +1,135 @@ -Discover and Define Servers -=========================== +Discovery +========= -When the IPMI-based server is connected to power, the BMC automatically boots up and tries to a DHCP IP address. Once the BMC gets an IP address, xCAT can discover the BMC and obtain some basic information. Use the :doc:`bmcdiscover ` command to scan the network for BMCs. +When the IPMI-based servers are connected to power, the default setting from manuafacturing is DHCP mode and the BMCs will obtain a IP address from an open range DHCP server on your network. (xCAT can start an open range on the DHCP server by setting the ``dynamicrange`` attribute in the networks table) -#. Discover the BMCs over a network range. :: +When the BMCs have an IP address and is pingable from the xCAT management node, administrators can discover the BMCs using the xCAT :doc:`bmcdiscover ` command and obtain basic information to start the hardware discovery process. When hardware discovery is running, xCAT uses the genesis kernel to discover attributes of the compute node and populate the node attributes so xCAT can then manage the node. - bmcdiscover --range 50.0.100.1-100 -t -z +The following example outlines the MTMS based hardware discovery for a single IPMI-based compute node. - The output should be similar to: :: ++-------------------------+------------+ +| Environment | Value | ++=========================+============+ +| Compute Node Model Type | 8247-22l | ++-------------------------+------------+ +| Compute Node Serial Num | 10112CA | ++-------------------------+------------+ +| Compute Node Hostname | cn01 | ++-------------------------+------------+ +| Compute Node IP address | 10.1.2.1 | ++-------------------------+------------+ +| BMC DHCP IP address | 172.30.0.1 | ++-------------------------+------------+ +| BMC STATIC IP address | 172.20.0.1 | ++-------------------------+------------+ - node-8247-22l-10112ca: +#. Gather the **predefined** nodes + + Using the ``bmcdiscover`` command, discover the nodes over an IP range and save the output to a file to use as a base for creating the **predefined** compute nodes. + + To discover the BMC with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + + The discovered nodes has the naming convention: node-<*model-type*>-<*serial-number*> :: + + # cat predefined.stanzas + node-8247-22l-10112ca: objtype=node groups=all - bmc=50.0.100.1 - cons=ipmi - mgt=ipmi - mtm=8247-22L - serial=10112CA - nodetype=mp - hwtype=bmc - - By default, ``bmcdiscover`` will use the username/password for the "ipmi" key in the xCAT ``passwd`` table. You can specify a different username or password with command line optjons to ``bmcdiscover``. - -#. If the output looks good, run the command again using the ``-w`` option to write to the xCAT database and redirect the output to a file in order to create the **predefined** node stanzas: :: - - bmcdiscover --range 50.0.100.1-100 -t -z -w > predefined_bmc.stanza - -#. The discovered node stanza is now in the xCAT databased. Edit the ``predefined_bmc.stanza`` file and modify the following: - - #. Rename the ``node-8247-22l-10112ca`` to the intended hostname for the compute node - - #. Remove the ``nodetype`` and ``hwtype`` attributes for the node stanza - - The resulting predefined definition should be similar to: :: - - cn1: - objtype=node - groups=all - bmc=50.0.100.1 + bmc=172.30.0.1 cons=ipmi mgt=ipmi mtm=8247-22L serial=10112CA - -#. Define the predefined node to xCAT: [#]_ :: - cat predefined_bmc.stanza | mkdef -z +#. Gather the **discovered** nodes + + Using the ``bmcdiscover`` command again to discover the nodes over the IP range, but use the ``-t`` option to get machine type information and the ``-w`` option to automatically write the output to the xCAT database. + + To discover the BMC with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -t -z -w + + The discovered nodes will be written to xCAT database: :: + + # lsdef node-8247-22l-10112ca + Object name: node-8247-22l-10112ca + bmc=172.30.0.1 + cons=ipmi + groups=all + hwtype=bmc + mgt=ipmi + mtm=8247-22L + nodetype=mp + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + serial=10112CA +#. Edit the **predefined** nodes and set their intended ``hostname`` and ``IP adress`` -#. Modify the predefined node using xCAT commands + #. Edit the file saved from the above step. :: - #. Set the IP address for the compute node: :: + vi predefined.stanzas - chdef cn1 ip=10.0.101.1 + #. Rename the object names to their intended compute node hostnames. :: - #. Set the BMC IP address to a different value: :: + node-8247-22l-10112ca ==> cn01 - chdef cn1 bmc=50.0.101.1 + #. Set the ``ip=`` attribute for the compute node IP address. :: - #. Set the chain table attribute to do BMC setup/discovery: :: + ip=10.1.2.1 - chdef cn1 chain="runcmd=bmcsetup" + #. Repeat for additional nodes in the predefined.stanza file based on the MTMS mapping. -#. Add the node information to ``/etc/hosts`` and DNS: :: + In this example, our **predefined.stanzas** file now looks like the following: :: + + # cat predefined.stanzas + cn01: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + ip=10.1.2.1 + + +#. Define the **predefined node** to xCAT: :: + + cat predefined.stanzas | mkdef -z + +#. **[Optional]** Change the BMC IP address from DHCP to STATIC + + Some sites would prefer to configure the BMCs to use static IP addresses to avoid issues when DHCP leases expire. xCAT provides a way for the administrator to modify theDHCP IP address to a static IP address during the hardware discovery process using the xCAT chain concept. + + Set the BMC IP address to a different value for the **predefined** compute node definitions. + + To change the DHCP IP address of 172.30.0.1 to a STATIC IP address of 172.**20**.0.1, run the following command: :: + + chdef cn01 bmc=172.20.0.1 chain="rumcmd=bmcsetup" + + +#. Add the compute node IP information to ``/etc/hosts``: :: + + makehosts cn01 + +#. Refresh the DNS configuration for the new hosts: :: - makehosts cn1 makedns -n +#. **[Optional]** Monitor the node discovery process using rcons -#. [**Optional**] To monitor the node discovery process, configure conserver for the **discovered** nodes: :: + Configure the conserver for the **discovered** node to watch the discovery process using ``rcons``:: makeconservercf node-8247-22l-10112ca + + In another terminal window, open the remote console: :: + rcons node-8247-22l-10112ca #. Start the discovery process by booting the **discovered** node definition: :: @@ -81,11 +137,4 @@ When the IPMI-based server is connected to power, the BMC automatically boots up rsetboot node-8247-22l-10112ca net rpower node-8247-22l-10112ca on -#. The discovery process should complete and update the status for the **predefined** node and update the status to "bmcready": :: - - lsdef cn1 | grep status - - Displaying the node attributes should show more attributes discoverd for the node, necessary for xCAT to do OS deployment. - - -.. [#] The changes made in the next step can be made directly into the ``predefined_bmc.stanza`` before importing to xCAT. +#. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst deleted file mode 100644 index 95f91f758..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/example_environment.rst +++ /dev/null @@ -1,5 +0,0 @@ -Environment -=========== - -.. include:: ../schedule_environment.rst - 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 b24899ebf..e54e49ee1 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 @@ -1,34 +1,27 @@ MTMS-based Discovery ==================== -MTMS is short for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial which is unique for each physical server. MTMS-based hardware discovery assumes that the administator has the MTMS information for all the physical servers and has a mapping for the MTMS and hostname/IP for the servers. +MTMS stands for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial which is a way to uniquely define each physical server. -Pros and Cons -------------- +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. -Pros -```` - - * Limited effort to get servers defined using xCAT hardware discovery engine - -Cons -```` - - * When compared to switch-based discovery, the administrator needs to be involved to create a **predefined-node** from each of the **discovered-nodes** stanzas. This could become difficult for a large number of servers. - - -Overview --------- +**Overview** #. Automatically search and collect MTMS information from the servers #. Define the **discovered-node** to xCAT #. Create a **predefined-node** to xCAT providing additional properties #. Power on the **discovered-nodes** triggering xCAT's hardware discovery engine. +**Pros** + + * Limited effort to get servers defined using xCAT hardware discovery engine + +**Cons** + + * When compared to switch-based discovery, the administrator needs to create the **predefined-node** for each of the **discovered-nodes** stanzas. This could become difficult for a large number of servers. .. toctree:: :maxdepth: 2 - preverification.rst - example_environment.rst + verification.rst discovery.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst deleted file mode 100644 index 0e7c2b451..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/preverification.rst +++ /dev/null @@ -1,35 +0,0 @@ -Before Starting -=============== - -Before starting hardware discovery, ensure the following is configured to make the discovery process as smooth as possible. - -Password Table --------------- - -In order to communicate with IPMI-based (bmc) hardware, verify that the xCAT ``passwd`` table contains an entry for ``ipmi`` defininig the username and password for IPMI-based servers. :: - - tabdump passwd | grep ipmi - - -Genesis Package ---------------- - -The **xcat-genesis** packages provides the utility to create the genesis network boot rootimage used by xCAT when doing hardware discivery. IT should have been installed during the xCAT installation and would cause problems if missing. - -Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: - - * **[RHEL/SLES]**: :: - - rpm -qa | grep -i genesis - - * **[Ubuntu]**: :: - - dpkg -l | grep -i genesis - - -If the packages are missing: - - #. Install them using the OS specific package manager from the ``xcat-deps`` repository - #. Create the network boot rootimage with the following command: ``mknb ppc64``. - The resulting genesis kernel should appear in the ``/tftpboot/xcat`` directory. - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst new file mode 100644 index 000000000..bb2bae9b2 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst @@ -0,0 +1,39 @@ +Verification +============ + +Before starting hardware discovery, ensure the following is configured to make the discovery process as smooth as possible. + +Password Table +-------------- + +In order to communicate with IPMI-based hardware (with BMCs), verify that the xCAT ``passwd`` table contains an entry for ``ipmi`` which defines the username and password to communicate with the IPMI-based servers. :: + + tabdump passwd | grep ipmi + +If not configured, use the following command as an example to set the ``usernam=ADMIN`` and ``password=admin``. :: + + chtab key=ipmi passwd.username=ADMIN passwd.password=admin + + +Genesis Package +--------------- + +The **xcat-genesis** packages provides the utility to create the genesis network boot rootimage used by xCAT when doing hardware discovery. It should have been installed during the xCAT installation and would cause problems if missing. + +Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: + + * **[RHEL/SLES]**: :: + + rpm -qa | grep -i genesis + + * **[Ubuntu]**: :: + + dpkg -l | grep -i genesis + + +If missing: + + #. Install them from the ``xcat-dep`` repository using the Operating Specific package manager (``yum, zypper, apt-get, etc``) + + #. Create the network boot rootimage with the following command: ``mknb ppc64``. The resulting genesis kernel should be present in ``/tftpboot/xcat`` directory. + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst deleted file mode 100644 index ea9e921bd..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst +++ /dev/null @@ -1,80 +0,0 @@ -MTMS-based Discovery -==================== - -MTMS is short for Machine Type/Model and Serial which is unique for a physical server. The idea of MTMS based hardware discovery is that the admin know the physical location information of the server with specified MTMS. Then the admin can assign nodename and host ip address for the physical server. - -.. include:: schedule_environment.rst -.. include:: config_environment.rst - -Discover server and define --------------------------- - -After environment is ready, and the server is powered, we can start server discovery process. The first thing to do is discovering the FSP/BMC of the server. It is automatically powered on when the physical server is powered. - -The following command can be used to discover BMC(s) within an IP range and write the discovered node definition(s) into a stanza file:: - - bmcdiscover -s nmap --range 50.0.100.1-100 -z > ./bmc.stanza - -**Note**: bmcdiscover will use username/password pair set in ``passwd`` table with **key** equal **ipmi**. If you'd like to use other username/password, you can use :: - - bmcdiscover -s nmap --range 50.0.100.1-100 -z -u -p > ./bmc.stanza - -You need to modify the node definition(s) in stanza file before using them, the stanza file will be like this:: - - # cat pbmc.stanza - cn1: - objtype=node - bmc=50.0.100.1 - mtm=8247-42L - serial=10112CA - groups=pbmc,all - mgt=ipmi - -Then, define it into xCATdb:: - - # cat pbmc.stanza | mkdef -z - 1 object definitions have been created or modified. - -The server definition will be like this:: - - # lsdef cn1 - Object name: cn1 - bmc=50.0.100.1 - groups=pbmc,all - hidden=0 - mgt=ipmi - mtm=8247-42L - nodetype=mp - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - serial=10112CA - -After the physical server is defined into xCATdb, the next thing is update the node definition with the example node attributes:: - - chdef cn1 ip=10.0.101.1 - -In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. For more info about chain, please refer to :doc:`Chain <../../../../../advanced/chain/index>` :: - - chdef cn1 chain="runcmd=bmcsetup" - -Then, add node info into /etc/hosts and DNS:: - - makehosts cn1 - makedns -n - - - -Start discovery process ------------------------ - -To start discovery process, just need to power on the host remotely with the following command, and the discovery process will start automatically after the host is powered on:: - - rpower cn1 on - -**[Optional]** If you'd like to monitor the discovery process, you can use:: - - chdef cn1 cons=ipmi - makeconservercf - rcons cn1 - -.. include:: standard_cn_definition.rst From b7c841999ecc48acf5c01f21f62db02eba8ba43e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 15 Apr 2016 11:26:51 -0400 Subject: [PATCH 36/52] Refactor the MTMS section again to cover the two scenarios - using bmcsetup to configure BMC with dhcp assigned IP address - using bmcsetup to configure BMC with different IP in another subnet --- .../ppc64le/discovery/mtms/discovery.rst | 140 +---------------- .../mtms/discovery_using_defined.rst | 144 ++++++++++++++++++ .../discovery/mtms/discovery_using_dhcp.rst | 113 ++++++++++++++ .../ppc64le/discovery/mtms/index.rst | 4 +- .../ppc64le/discovery/mtms/verification.rst | 22 ++- 5 files changed, 284 insertions(+), 139 deletions(-) create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst index 71f10b962..45e69d072 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst @@ -1,140 +1,14 @@ Discovery ========= -When the IPMI-based servers are connected to power, the default setting from manuafacturing is DHCP mode and the BMCs will obtain a IP address from an open range DHCP server on your network. (xCAT can start an open range on the DHCP server by setting the ``dynamicrange`` attribute in the networks table) +When the IPMI-based servers are connected to power, the BMCs will boot up and attempt to obtain an IP address from an open range dhcp server on your network. In the case for xCAT managed networks, xCAT should be configured serve an open range dhcp IP addresses with the ``dynamicrange`` attribute in the networks table. -When the BMCs have an IP address and is pingable from the xCAT management node, administrators can discover the BMCs using the xCAT :doc:`bmcdiscover ` command and obtain basic information to start the hardware discovery process. When hardware discovery is running, xCAT uses the genesis kernel to discover attributes of the compute node and populate the node attributes so xCAT can then manage the node. +When the BMCs have an IP address and is pingable from the xCAT management node, administrators can discover the BMCs using the xCAT's :doc:`bmcdiscover ` command and obtain basic information to start the hardware discovery process. -The following example outlines the MTMS based hardware discovery for a single IPMI-based compute node. +xCAT Hardware discover uses the xCAT genesis kernel (diskless) to discover additional attributes of the compute node and automatically populate the node definitions in xCAT. -+-------------------------+------------+ -| Environment | Value | -+=========================+============+ -| Compute Node Model Type | 8247-22l | -+-------------------------+------------+ -| Compute Node Serial Num | 10112CA | -+-------------------------+------------+ -| Compute Node Hostname | cn01 | -+-------------------------+------------+ -| Compute Node IP address | 10.1.2.1 | -+-------------------------+------------+ -| BMC DHCP IP address | 172.30.0.1 | -+-------------------------+------------+ -| BMC STATIC IP address | 172.20.0.1 | -+-------------------------+------------+ +.. toctree:: + :maxdepth: 2 -#. Gather the **predefined** nodes - - Using the ``bmcdiscover`` command, discover the nodes over an IP range and save the output to a file to use as a base for creating the **predefined** compute nodes. - - To discover the BMC with an IP address of 172.30.0.1, use the command: :: - - bmcdiscover --range 172.30.0.1 -z > predefined.stanzas - - The discovered nodes has the naming convention: node-<*model-type*>-<*serial-number*> :: - - # cat predefined.stanzas - node-8247-22l-10112ca: - objtype=node - groups=all - bmc=172.30.0.1 - cons=ipmi - mgt=ipmi - mtm=8247-22L - serial=10112CA - - -#. Gather the **discovered** nodes - - Using the ``bmcdiscover`` command again to discover the nodes over the IP range, but use the ``-t`` option to get machine type information and the ``-w`` option to automatically write the output to the xCAT database. - - To discover the BMC with an IP address of 172.30.0.1, use the command: :: - - bmcdiscover --range 172.30.0.1 -t -z -w - - The discovered nodes will be written to xCAT database: :: - - # lsdef node-8247-22l-10112ca - Object name: node-8247-22l-10112ca - bmc=172.30.0.1 - cons=ipmi - groups=all - hwtype=bmc - mgt=ipmi - mtm=8247-22L - nodetype=mp - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - serial=10112CA - - -#. Edit the **predefined** nodes and set their intended ``hostname`` and ``IP adress`` - - #. Edit the file saved from the above step. :: - - vi predefined.stanzas - - #. Rename the object names to their intended compute node hostnames. :: - - node-8247-22l-10112ca ==> cn01 - - #. Set the ``ip=`` attribute for the compute node IP address. :: - - ip=10.1.2.1 - - #. Repeat for additional nodes in the predefined.stanza file based on the MTMS mapping. - - - In this example, our **predefined.stanzas** file now looks like the following: :: - - # cat predefined.stanzas - cn01: - objtype=node - groups=all - bmc=172.30.0.1 - cons=ipmi - mgt=ipmi - mtm=8247-22L - serial=10112CA - ip=10.1.2.1 - - -#. Define the **predefined node** to xCAT: :: - - cat predefined.stanzas | mkdef -z - -#. **[Optional]** Change the BMC IP address from DHCP to STATIC - - Some sites would prefer to configure the BMCs to use static IP addresses to avoid issues when DHCP leases expire. xCAT provides a way for the administrator to modify theDHCP IP address to a static IP address during the hardware discovery process using the xCAT chain concept. - - Set the BMC IP address to a different value for the **predefined** compute node definitions. - - To change the DHCP IP address of 172.30.0.1 to a STATIC IP address of 172.**20**.0.1, run the following command: :: - - chdef cn01 bmc=172.20.0.1 chain="rumcmd=bmcsetup" - - -#. Add the compute node IP information to ``/etc/hosts``: :: - - makehosts cn01 - -#. Refresh the DNS configuration for the new hosts: :: - - makedns -n - -#. **[Optional]** Monitor the node discovery process using rcons - - Configure the conserver for the **discovered** node to watch the discovery process using ``rcons``:: - - makeconservercf node-8247-22l-10112ca - - In another terminal window, open the remote console: :: - - rcons node-8247-22l-10112ca - -#. Start the discovery process by booting the **discovered** node definition: :: - - rsetboot node-8247-22l-10112ca net - rpower node-8247-22l-10112ca on - -#. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. + discovery_using_defined.rst + discovery_using_dhcp.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst new file mode 100644 index 000000000..e5e8c7769 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -0,0 +1,144 @@ +Set static BMC IP using different IP address (recommended) +========================================================== + +The following example outlines the MTMS based hardware discovery for a single IPMI-based compute node. + ++------------------------------+------------+ +| Compute Node Information | Value | ++==============================+============+ +| Model Type | 8247-22l | ++------------------------------+------------+ +| Serial Number | 10112CA | ++------------------------------+------------+ +| Hostname | cn01 | ++------------------------------+------------+ +| IP address | 10.1.2.1 | ++------------------------------+------------+ + +The BMC IP address is obtained by the open range dhcp server and the plan in this scenario is to change the IP address for the BMC to a static IP address in a different subnet than the open range addresses. + ++------------------------------+------------+ +| BMC Information | Value | ++==============================+============+ +| IP address - dhcp | 172.30.0.1 | ++------------------------------+------------+ +| IP address - static | 172.20.2.1 | ++------------------------------+------------+ + +#. Detect the BMCs and add the node definitions into xCAT. + + Use the ``bmcdiscover`` command to discover the BMCs responding over an IP range and automatically write the output into the xCAT database. You **must** use the ``-t`` option to indicate node type is bmc and the ``-w`` option to automatically write the output into the xCAT database. + + To discover the BMC with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -t -z -w + + The discovered nodes will be written to xCAT database: :: + + # lsdef node-8247-22l-10112ca + Object name: node-8247-22l-10112ca + bmc=172.30.0.1 + cons=ipmi + groups=all + hwtype=bmc + mgt=ipmi + mtm=8247-22L + nodetype=mp + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + serial=10112CA + + +#. **Pre-define** the compute nodes: + + Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT. + + To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + + The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> :: + + # cat predefined.stanzas + node-8247-22l-10112ca: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + + +#. Edit the ``predefined.stanzas`` file and change the discovered nodes to the intended ``hostname`` and ``IP address``. + + #. Edit the ``predefined.stanzas`` file: :: + + vi predefined.stanzas + + #. Rename the discovered object names to their intended compute node hostnames based on the MTMS mapping: :: + + node-8247-22l-10112ca ==> cn01 + + #. Add a ``ip`` attribute and give it the compute node IP address: :: + + ip=10.1.2.1 + + #. Repeat for additional nodes in the ``predefined.stanza`` file based on the MTMS mapping. + + + In this example, the ``predefined.stanzas`` file now looks like the following: :: + + # cat predefined.stanzas + cn01: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + ip=10.1.2.1 + + +#. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. :: + + chdef cn01 chain="runcmd=bmcsetup" + + +#. Change the BMC IP address + + Set the BMC IP address to a different value for the **predefined** compute node definitions. + + To change the dhcp obtained IP address of 172.30.0.1 to a static IP address of 172.20.2.1, run the following command: :: + + chdef cn01 bmc=172.20.2.1 + +#. Define the compute nodes into xCAT: :: + + cat predefined.stanzas | mkdef -z + +#. Add the compute node IP information to ``/etc/hosts``: :: + + makehosts cn01 + +#. Refresh the DNS configuration for the new hosts: :: + + makedns -n + +#. **[Optional]** Monitor the node discovery process using rcons + + Configure the conserver for the **discovered** node to watch the discovery process using ``rcons``:: + + makeconservercf node-8247-22l-10112ca + + In another terminal window, open the remote console: :: + + rcons node-8247-22l-10112ca + +#. Start the discovery process by booting the **discovered** node definition: :: + + rsetboot node-8247-22l-10112ca net + rpower node-8247-22l-10112ca on + +#. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst new file mode 100644 index 000000000..afac7af98 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst @@ -0,0 +1,113 @@ +Set static BMC IP using dhcp provided IP address +================================================ + +The following example outlines the MTMS based hardware discovery for a single IPMI-based compute node. + ++------------------------------+------------+ +| Compute Node Information | Value | ++==============================+============+ +| Model Type | 8247-22l | ++------------------------------+------------+ +| Serial Number | 10112CA | ++------------------------------+------------+ +| Hostname | cn01 | ++------------------------------+------------+ +| IP address | 10.1.2.1 | ++------------------------------+------------+ + +The BMC IP address is obtained by the open range dhcp server and the plan is to leave the IP address the same, except we want to change the IP address to be static in the BMC. + ++------------------------------+------------+ +| BMC Information | Value | ++==============================+============+ +| IP address - dhcp | 172.30.0.1 | ++------------------------------+------------+ +| IP address - static | 172.30.0.1 | ++------------------------------+------------+ + + +#. **Pre-define** the compute nodes: + + Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT. + + To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + + The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> :: + + # cat predefined.stanzas + node-8247-22l-10112ca: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + + +#. Edit the ``predefined.stanzas`` file and change the discovered nodes to the intended ``hostname`` and ``IP address``. + + #. Edit the ``predefined.stanzas`` file: :: + + vi predefined.stanzas + + #. Rename the discovered object names to their intended compute node hostnames based on the MTMS mapping: :: + + node-8247-22l-10112ca ==> cn01 + + #. Add a ``ip`` attribute and give it the compute node IP address: :: + + ip=10.1.2.1 + + #. Repeat for additional nodes in the ``predefined.stanza`` file based on the MTMS mapping. + + + In this example, the ``predefined.stanzas`` file now looks like the following: :: + + # cat predefined.stanzas + cn01: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + ip=10.1.2.1 + + +#. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. :: + + chdef cn01 chain="runcmd=bmcsetup" + +#. Define the compute nodes into xCAT: :: + + cat predefined.stanzas | mkdef -z + +#. Add the compute node IP information to ``/etc/hosts``: :: + + makehosts cn01 + +#. Refresh the DNS configuration for the new hosts: :: + + makedns -n + +#. **[Optional]** Monitor the node discovery process using rcons + + Configure the conserver for the **discovered** node to watch the discovery process using ``rcons``:: + + makeconservercf node-8247-22l-10112ca + + In another terminal window, open the remote console: :: + + rcons node-8247-22l-10112ca + +#. Start the discovery process by booting the **discovered** node definition: :: + + rsetboot node-8247-22l-10112ca net + rpower node-8247-22l-10112ca on + +#. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. + 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 e54e49ee1..4402da090 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 @@ -1,7 +1,7 @@ MTMS-based Discovery ==================== -MTMS stands for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial which is a way to uniquely define each physical server. +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. @@ -24,4 +24,4 @@ MTMS-based hardware discovery assumes the administator has the model type and se :maxdepth: 2 verification.rst - discovery.rst + discovery.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst index bb2bae9b2..a77acd58c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst @@ -6,11 +6,11 @@ Before starting hardware discovery, ensure the following is configured to make t Password Table -------------- -In order to communicate with IPMI-based hardware (with BMCs), verify that the xCAT ``passwd`` table contains an entry for ``ipmi`` which defines the username and password to communicate with the IPMI-based servers. :: +In order to communicate with IPMI-based hardware (with BMCs), verify that the xCAT ``passwd`` table contains an entry for ``ipmi`` which defines the default username and password to communicate with the IPMI-based servers. :: tabdump passwd | grep ipmi -If not configured, use the following command as an example to set the ``usernam=ADMIN`` and ``password=admin``. :: +If not configured, use the following command to set ``usernam=ADMIN`` and ``password=admin``. :: chtab key=ipmi passwd.username=ADMIN passwd.password=admin @@ -18,7 +18,7 @@ If not configured, use the following command as an example to set the ``usernam= Genesis Package --------------- -The **xcat-genesis** packages provides the utility to create the genesis network boot rootimage used by xCAT when doing hardware discovery. It should have been installed during the xCAT installation and would cause problems if missing. +The **xCAT-genesis** packages provides the utility to create the genesis network boot rootimage used by xCAT when doing hardware discovery. It should be installed during the xCAT install and would cause problems if missing. Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: @@ -35,5 +35,19 @@ If missing: #. Install them from the ``xcat-dep`` repository using the Operating Specific package manager (``yum, zypper, apt-get, etc``) - #. Create the network boot rootimage with the following command: ``mknb ppc64``. The resulting genesis kernel should be present in ``/tftpboot/xcat`` directory. + * **[RHEL]**: :: + + yum install xCAT-genesis + + * **[SLES]**: :: + + zypper install xCAT-genesis + + * **[Ubuntu]**: :: + + apt-get install xCAT-genesis + + #. Create the network boot rootimage with the following command: ``mknb ppc64``. + + The genesis kernel should be copied to ``/tftpboot/xcat``. From b7beeabcf812c1f094699148b2d2403b36174537 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 18 Apr 2016 02:15:08 -0400 Subject: [PATCH 37/52] modify format error --- .../networks/infiniband/mlnxofed_ib_install_v2_diskful.rst | 4 ++-- .../networks/infiniband/mlnxofed_ib_install_v2_diskless.rst | 6 +++--- .../infiniband/mlnxofed_ib_install_v2_preparation.rst | 2 +- .../infiniband/mlnxofed_ib_verified_scenario_matrix.rst | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) 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 449009446..fdb27f4f7 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 @@ -9,7 +9,7 @@ Configuration for Diskful Installation chdef -p postscripts="mlnxofed_ib_install -p /install//" - xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drivers work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox drivers. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarioes Have Been Verified `. You can try this way in other else scenarios if you needed. + xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drivers work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox drivers. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarios Have Been Verified `. You can try this way in other else scenarios if you needed. 2. Specify dependency package @@ -48,7 +48,7 @@ Configuration for Diskful Installation rsyn #INCLUDE://# - xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: #cat //compute...pkglist @base 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 9e83bc452..597424add 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 @@ -41,7 +41,7 @@ Configuration for Diskless Installation ..... #INCLUDE://# - xCAT ships some InfiniBand pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarioes Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + xCAT ships some InfiniBand pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: #cat //compute...pkglist bash @@ -77,7 +77,7 @@ Configuration for Diskless Installation -p /install// -m --add-kernel-support -end- -i $1 -n genimage - Take rhels7.2 on ppc64le for example: :: + Take rhels7.2 on ppc64le for example: :: #lsdef -t osimage rhels7.2-ppc64le-netboot-compute Object name: rhels7.2-ppc64le-netboot-compute @@ -97,7 +97,7 @@ Configuration for Diskless Installation rootimgdir=/install/netboot/rhels7.2/ppc64le/compute - **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist``. For the same reason, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall``. :: + **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist``. For the same reason, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall``. ``compute.rhels7.ppc64le.pkglist`` looks like below: :: 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 d83840b4e..0cbe8576c 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 @@ -16,7 +16,7 @@ Obtain the Mellanox OFED ISO file from `Mellanox official Download Page `. +**mlnxofed_ib_install.v2** is a sample script, its framework can help you install Mellanox drives easily. But in specific scenario, some detail need to be modified to meet requirement, such like dependency package list. It has been verified in limited scenarios and can work as solution in these scenarios. For these scenarions information please refer to :doc:`The Scenarios Have Been Verified `. Copy **mlnxofed_ib_install.v2** into ``/install/postscripts`` and change name to **mlnxofed_ib_install** :: 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 f1dd91130..d8a515de6 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,4 +1,4 @@ -The Scenarioes Have Been Verified +The Scenarios Have Been Verified ================================= From 4cdaf4aacb70a27eacf0944623800b1a4e423e6f Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 18 Apr 2016 02:15:11 -0400 Subject: [PATCH 38/52] add baremetal support in case --- .../installation/Diskless_installation_flat_p8_le | 3 ++- .../installation/reg_linux_diskfull_installation_flat | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index 644e171a6..c81c3bf8a 100644 --- a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -4,7 +4,7 @@ stop:yes cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 20G ; fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi check:rc==0 cmd:makedns -n check:rc==0 @@ -26,6 +26,7 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi cmd:rpower $$CN boot check:rc==0 cmd:sleep 200 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 feec8c7c2..65f380fb2 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -6,7 +6,7 @@ cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -14,7 +14,7 @@ check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN cmd:sleep 20 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then getmacs -D $$CN; fi +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 @@ -32,10 +32,11 @@ check:rc==0 cmd:lsdef $$CN |grep provmethod check:rc==0 check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi +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:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 1200;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then sleep 600;else sleep 180;fi +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" =~ "ipmi" ]]; then sleep 1800;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then sleep 1200;else sleep 600;fi cmd:lsdef -l $$CN | grep status From c950ca7507c887073faf334ab404c25b5bc1728a Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 18 Apr 2016 02:24:50 -0400 Subject: [PATCH 39/52] modify spelling error --- .../infiniband/mlnxofed_ib_install_v2_diskful.rst | 2 +- .../infiniband/mlnxofed_ib_install_v2_diskless.rst | 8 ++++---- .../infiniband/mlnxofed_ib_install_v2_preparation.rst | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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 fdb27f4f7..453e888a5 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 @@ -48,7 +48,7 @@ Configuration for Diskful Installation rsyn #INCLUDE://# - xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenario. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: #cat //compute...pkglist @base 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 597424add..e9576024f 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 @@ -41,7 +41,7 @@ Configuration for Diskless Installation ..... #INCLUDE://# - xCAT ships some InfiniBand pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenarion. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + xCAT ships some InfiniBand pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenario. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: #cat //compute...pkglist bash @@ -65,13 +65,13 @@ Configuration for Diskless Installation - Edit ``/..postinstall`` and add below line in the end :: + Edit ``/..postinstall`` and add below line in the end. :: /install/postscripts/mlnxofed_ib_install \ -p /install// -i $1 -n genimage - **[Note]** Mellanox OFED ISO was built against a series of certain kernael versions, If the version of linux kernel you are using does not match with any of the Mellanox offered pre-built kernel modules, you can pass ``--add-kernel-support`` command line argument to Mellanox OFED installation script to build these kernel modules base on the version of linux kernel you are using. The line added into ``.postinstall`` should like below :: + **[Note]** Mellanox OFED ISO was built against a series of certain kernael versions, If the version of linux kernel you are using does not match with any of the Mellanox offered pre-built kernel modules, you can pass ``--add-kernel-support`` command line argument to Mellanox OFED installation script to build these kernel modules base on the version of linux kernel you are using. The line added into ``.postinstall`` should like below. :: /install/postscripts/mlnxofed_ib_install \ -p /install// -m --add-kernel-support -end- -i $1 -n genimage @@ -136,7 +136,7 @@ Configuration for Diskless Installation rsetboot net rpower reset - After installation, you can login target ndoe and issue ``ibv_devinfo`` command to verify if your InfiniBand driver works well. if everything is fine, you can get the InfiniBand apater information :: + After installation, you can login target ndoe and issue ``ibv_devinfo`` command to verify if your InfiniBand driver works well. if everything is fine, you can get the InfiniBand apater information. :: # ibv_devinfo hca_id: mlx5_0 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 0cbe8576c..cff51e6a6 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 @@ -37,7 +37,7 @@ In general you can use ``mlnxofed_ib_install`` like below :: mlnxofed_ib_install -p /install// -If need to pass ``--without-32bit --without-fw-update --add-kernel-support --force`` to ``mlnxofedinstall``, refer to below command :: +If need to pass ``--without-32bit --without-fw-update --add-kernel-support --force`` to ``mlnxofedinstall``, refer to below command. :: mlnxofed_ib_install -p /install// \ -m --without-32bit --without-fw-update --add-kernel-support --force -end- From 0488542cb26fefd43a797fe0837d31f73aa667ef Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 18 Apr 2016 03:00:25 -0400 Subject: [PATCH 40/52] refine the coding style;add comments --- xCAT-server/share/xcat/netboot/rh/genimage | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index da2d15e70..fdb23ef93 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -77,11 +77,11 @@ sub xdie { #helper subroutine to get the major release number #of a osver sub majversion { - my $version=shift; + my $version = shift; my $majorrel; - if($osver =~ /$\D*(\d*)[.\d]*$/){ - $majorrel=$1; + if($osver =~ /^\D*(\d*)[.\d]*$/){ + $majorrel = $1; } return $majorrel; @@ -90,11 +90,10 @@ sub majversion { sub mount_chroot { my $rootimage_dir = shift; + #postinstall script of some packages might access the /proc, /sys and /dev filesystem + #For Redhat7 or above, mount these directories readonly from host to avoid error messages + #For Redhat6 or below, mount these directories might introduce error messages if(majversion($osver) > 6){ - #postinstall script of package installation - #might access the /proc, /sys and /dev filesystem - #mount them from host read-only - #only available for rh7 or above system("mkdir -p $rootimage_dir/proc"); system("mount proc $rootimage_dir/proc -t proc -o ro"); system("mkdir -p $rootimage_dir/sys"); From 000ec281f1e5ca188c76af0b619555ab6703245d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 18 Apr 2016 10:50:17 -0400 Subject: [PATCH 41/52] Added some changes to mtms section based on the review comments. --- .../discovery/mtms/discovery_using_defined.rst | 2 +- .../ppc64le/discovery/mtms/discovery_using_dhcp.rst | 12 ++++++------ .../manage_clusters/ppc64le/discovery/mtms/index.rst | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst index e5e8c7769..ca8e4c571 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -15,7 +15,7 @@ The following example outlines the MTMS based hardware discovery for a single IP | IP address | 10.1.2.1 | +------------------------------+------------+ -The BMC IP address is obtained by the open range dhcp server and the plan in this scenario is to change the IP address for the BMC to a static IP address in a different subnet than the open range addresses. +The BMC IP address is obtained by the open range dhcp server and the plan in this scenario is to change the IP address for the BMC to a static IP address in a different subnet than the open range addresses. The static IP address in this example is in the same subnet as the open range to simplify the networking configuration on the xCAT management node. +------------------------------+------------+ | BMC Information | Value | diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst index afac7af98..7759e3c2e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst @@ -96,18 +96,18 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to #. **[Optional]** Monitor the node discovery process using rcons - Configure the conserver for the **discovered** node to watch the discovery process using ``rcons``:: + Configure the conserver for the **predefined** node to watch the discovery process using ``rcons``:: - makeconservercf node-8247-22l-10112ca + makeconservercf cn01 In another terminal window, open the remote console: :: - rcons node-8247-22l-10112ca + rcons cn01 -#. Start the discovery process by booting the **discovered** node definition: :: +#. Start the discovery process by booting the **predefined** node definition: :: - rsetboot node-8247-22l-10112ca net - rpower node-8247-22l-10112ca on + rsetboot cn01 net + rpower cn01 on #. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. 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 4402da090..fde5e5254 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 @@ -8,9 +8,9 @@ MTMS-based hardware discovery assumes the administator has the model type and se **Overview** #. Automatically search and collect MTMS information from the servers - #. Define the **discovered-node** to xCAT - #. Create a **predefined-node** to xCAT providing additional properties - #. Power on the **discovered-nodes** triggering xCAT's hardware discovery engine. + #. Write **discovered-bmc-nodes** to xCAT (recommened 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 **Pros** @@ -18,7 +18,7 @@ MTMS-based hardware discovery assumes the administator has the model type and se **Cons** - * When compared to switch-based discovery, the administrator needs to create the **predefined-node** for each of the **discovered-nodes** stanzas. This could become difficult for a large number of servers. + * When compared to switch-based discovery, the administrator needs to create the **predefined-compute-nodes** for each of the **discovered-bmc-nodes**. This could become difficult for a large number of servers. .. toctree:: :maxdepth: 2 From d1bb364ff68bea997c240c9ad9eb64cd98e871a8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 15 Apr 2016 10:57:50 -0400 Subject: [PATCH 42/52] Fix nodeset command for shell and shutdown options and fix nodeset usage and man page --- .../references/man8/nodeset.8.rst | 8 +++--- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man8/nodeset.8.pod | 8 +++--- xCAT-server/lib/xcat/plugins/grub2.pm | 27 ++++++++++++++++++- 4 files changed, 35 insertions(+), 10 deletions(-) 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 3da5ec913..d8c0be67f 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -19,11 +19,11 @@ Name **************** -\ **nodeset**\ [\ *noderange*\ ] [\ **boot**\ | \ **stat**\ | \ **iscsiboot**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ = \ *imagename*\ | \ **shell**\ | \ **shutdown**\ ] +\ **nodeset**\ \ *noderange*\ [\ **boot**\ | \ **stat**\ | \ **iscsiboot**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\ | \ **shutdown**\ ] -\ **nodeset**\ \ *noderange*\ \ **osimage=**\ \ *imagename*\ [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] +\ **nodeset**\ \ *noderange*\ \ **osimage**\ [=\ *imagename*\ ] [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] -\ **nodeset**\ \ *noderange*\ \ **runimage=**\ \ *task*\ +\ **nodeset**\ \ *noderange*\ \ **runimage=**\ \ *task*\ \ **nodeset**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -74,7 +74,7 @@ A user can supply their own scripts to be run on the mn or on the service node ( -\ **osimage | osimage= +\ **osimage | 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. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index d8fbb63b3..f7c60288e 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -459,7 +459,7 @@ Options: "Usage: Common: nodeset [-h|--help|-v|--version] - nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline]", + nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline|shutdown|stat]", "rmflexnode" => "Usage: rmflexnode [-h|--help|-v|--version] diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index 6741beb92..835b7de8a 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -4,11 +4,11 @@ B - set the boot state for a noderange =head1 B -B [I] [B | B | B | B | B | B= I | B | B] +B I [B | B | B | B | B | B[=I] | B | B] -B I B I [B<--noupdateinitrd>] [B<--ignorekernelchk>] +B I B[=I] [B<--noupdateinitrd>] [B<--ignorekernelchk>] -B I B I +B I BI B [B<-h>|B<--help>|B<-v>|B<--version>] @@ -49,7 +49,7 @@ Instruct network boot loader to be skipped, generally meaning boot to hard disk Cleanup the current pxe/tftp boot configuration files for the nodes requested -=item B|B> +=item B|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. diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 418a67f30..4317c1eb0 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -23,7 +23,7 @@ my $globaltftpdir = xCAT::TableUtils->getTftpDir(); my %usage = ( - "nodeset" => "Usage: nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline]", + "nodeset" => "Usage: nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline|shutdown|stat]", ); sub handled_commands { # process noderes:netboot like "grub2-" @@ -620,6 +620,31 @@ sub process_request { { $validarch = $osimgent->{'osarch'}; } + else + { + # Can not determine arch from osimage definition. This is most likely + # the case when nodeset is "shell" or "shutdown". Look at node definition, to + # figure out arch to use. + + # get nodename from osimagenodehash hash + my $node_name = $osimagenodehash{$osimage}[0]; + + # lookup node arch setting + my $node_entry = $typetab->getNodeAttribs($node_name,['arch']); + if ($node_entry and $node_entry->{'arch'}) + { + # Extracted arch from node definition + $validarch = $node_entry->{'arch'}; + } + else + { + # At this point we can not determine architecture either + # from osimage or node definition. + my $rsp; + push @{$rsp->{data}}, "Not able to determine architecture of node $node_name. Verify arch attribute setting.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + } if ($validarch =~ /ppc64/i) { $validarch="ppc" From 5d211909bd049b17ffaadf43afd300ec4f872615 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 19 Apr 2016 02:15:54 -0400 Subject: [PATCH 43/52] add checkrc=0 --- .../testcase/installation/Diskless_installation_flat_p8_le | 1 + .../testcase/installation/reg_linux_diskfull_installation_flat | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index c81c3bf8a..9a85d211d 100644 --- a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -27,6 +27,7 @@ check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi +check:rc==0 cmd:rpower $$CN boot check:rc==0 cmd:sleep 200 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 65f380fb2..a6730c24d 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -33,6 +33,7 @@ cmd:lsdef $$CN |grep provmethod check:rc==0 check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 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 From 59d1b779ed5e190eaccaceae5522ff43e515ce6c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 19 Apr 2016 06:46:57 -0400 Subject: [PATCH 44/52] work around for autotest case for issue 455 --- .../testcase/installation/Diskless_installation_flat_p8_le | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index 9a85d211d..876aad295 100644 --- a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -4,7 +4,7 @@ stop:yes cmd:copycds $$ISO check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f && mkvm $$CN ; fi check:rc==0 cmd:makedns -n check:rc==0 From b5842bf90508db94e121714fd65e391079fca6ae Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 19 Apr 2016 14:01:08 -0400 Subject: [PATCH 45/52] Support Mariadb on ubuntu 16.04 --- .../advanced/hierarchy/databases/mysql_configure.rst | 2 +- .../advanced/hierarchy/databases/mysql_install.rst | 2 +- xCAT-client/bin/mysqlsetup | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/source/advanced/hierarchy/databases/mysql_configure.rst b/docs/source/advanced/hierarchy/databases/mysql_configure.rst index 4b03f9b78..b830760b4 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_configure.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_configure.rst @@ -29,7 +29,7 @@ Granting/Revoking access to the database for Service Node Clients * Log into the MySQL interactive program. :: - /usr/bin/mysql -r root -p + /usr/bin/mysql -u root -p * Granting access to the xCAT database. Service Nodes are required for xCAT hierarchical support. Compute nodes may also need access that depends on which application is going to run. (xcat201 is xcatadmin's password for following examples) :: diff --git a/docs/source/advanced/hierarchy/databases/mysql_install.rst b/docs/source/advanced/hierarchy/databases/mysql_install.rst index a22eef7b6..e5dd7cc58 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_install.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_install.rst @@ -77,7 +77,7 @@ Debian/Ubuntu mysql-server-5* mysql-server-core-5* -* MariaDB - Using ``apt-get``, ensure that the following packages are installed on the management node: :: +* MariaDB - Using ``apt-get``, ensure that the following packages are installed on the management node. ``apt-get install mariadb-server`` will pull in all required packages. For Ubuntu 16.04, it no longer required ``libmariadbclient18``. :: libmariadbclient18 mariadb-client diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index c0d38cffb..23e0c371d 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -874,12 +874,20 @@ sub initmysqldb } # end AIX only #on debian/ubuntu should comment the bind-adress line in my.cnf + #on Ubuntu16.04, the bind-address line is in the mariadb.conf.d/50-server.cnf if ( $::debianflag ){ - $cmd = "sed 's/\\(^\\s*bind.*\\)/#\\1/' /etc/mysql/my.cnf > /tmp/my.cnf; mv -f /tmp/my.cnf /etc/mysql/my.cnf;chmod 644 /etc/mysql/my.cnf"; + my $bind_file; + if (-e "/etc/mysql/mariadb.conf.d/50-server.cnf") + { + $bind_file = "/etc/mysql/mariadb.conf.d/50-server.cnf"; + } else { + $bind_file = "/etc/mysql/my.cnf"; + } + $cmd = "sed 's/\\(^\\s*bind.*\\)/#\\1/' $bind_file > /tmp/my.cnf; mv -f /tmp/my.cnf $bind_file;chmod 644 $bind_file"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E", " comment the bind-address line in /etc/mysql/my.cfg failed: $cmd."); + xCAT::MsgUtils->message("E", " comment the bind-address line in $bind_file failed: $cmd."); exit(1); } } From f7d1e4e3f757cd2ef2281e4ee664fbbddf29e0a5 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 20 Apr 2016 08:52:53 -0400 Subject: [PATCH 46/52] modify vm cases about issue 455 --- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../testcase/installation/ubuntu_diskless_installation_vm | 2 +- .../testcase/installation/ubuntu_full_installation_vm_docker | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 a6730c24d..5c73b4917 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -6,7 +6,7 @@ cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f && mkvm $$CN ; fi cmd:makedns -n check:rc==0 cmd:makeconservercf diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index 444b14dbb..569d7605d 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -4,7 +4,7 @@ stop:yes cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi +cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f && mkvm $$CN ; fi cmd:makedns -n check:rc==0 cmd:makedhcp -n diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker index 3e7df1837..ced2f1231 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -2,7 +2,7 @@ start:Full_installation_flat_docker os:Linux cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$DOCKERHOST,arch)__" != "ppc64" ]];then chdef -t node -o $$DOCKERHOST vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$DOCKERHOST -f -p && mkvm $$DOCKERHOST -s 40G; fi +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,arch)__" != "ppc64" ]];then chdef -t node -o $$DOCKERHOST vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$DOCKERHOST -f && mkvm $$DOCKERHOST ; fi check:rc==0 cmd:makehosts $$DOCKERHOST check:rc==0 From f20fd2a869b3bd251d457461dfc9ff2d6410378d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 20 Apr 2016 11:38:40 -0400 Subject: [PATCH 47/52] perltidy grub2.pm --- xCAT-server/lib/xcat/plugins/grub2.pm | 865 +++++++++++++------------- 1 file changed, 442 insertions(+), 423 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 4317c1eb0..15267f0da 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -23,22 +23,25 @@ my $globaltftpdir = xCAT::TableUtils->getTftpDir(); my %usage = ( - "nodeset" => "Usage: nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline|shutdown|stat]", +"nodeset" => "Usage: nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline|shutdown|stat]", ); + sub handled_commands { + # process noderes:netboot like "grub2-" # such as grub2-http and grub2-tftp return { nodeset => "noderes:netboot=(grub2[-]?.*)" - } + } } sub check_dhcp { return 1; + #TODO: omapi magic to do things right my $node = shift; my $dhcpfile; - open ($dhcpfile,$dhcpconf); + open($dhcpfile, $dhcpconf); while (<$dhcpfile>) { if (/host $node\b/) { close $dhcpfile; @@ -49,25 +52,26 @@ sub check_dhcp { return 0; } -sub _slow_get_tftpdir { #make up for paths where tftpdir is not passed in - my $node=shift; - my $nrtab = xCAT::Table->new('noderes',-create=>0); #in order to detect per-node tftp directories +sub _slow_get_tftpdir { #make up for paths where tftpdir is not passed in + my $node = shift; + my $nrtab = xCAT::Table->new('noderes', -create => 0); #in order to detect per-node tftp directories unless ($nrtab) { return $globaltftpdir; } - my $ent = $nrtab->getNodeAttribs($node,["tftpdir"]); + my $ent = $nrtab->getNodeAttribs($node, ["tftpdir"]); if ($ent and $ent->{tftpdir}) { - return $ent->{tftpdir}; + return $ent->{tftpdir}; } else { return $globaltftpdir; } } + sub getstate { - my $node = shift; + my $node = shift; my $tftpdir = shift; unless ($tftpdir) { $tftpdir = _slow_get_tftpdir($node); } if (check_dhcp($node)) { - if (-r $tftpdir . "/boot/grub2/".$node) { + if (-r $tftpdir . "/boot/grub2/" . $node) { my $fhand; - open ($fhand,$tftpdir . "/boot/grub2/".$node); + open($fhand, $tftpdir . "/boot/grub2/" . $node); my $headline = <$fhand>; close $fhand; $headline =~ s/^#//; @@ -82,17 +86,19 @@ sub getstate { } sub setstate { + =pod This function will manipulate the grub structure to match what the noderes/chain tables indicate the node should be booting. =cut - my $node = shift; - my %bphash = %{shift()}; - my %chainhash = %{shift()}; - my %machash = %{shift()}; - my $tftpdir = shift; - my %nrhash = %{shift()}; + + my $node = shift; + my %bphash = %{ shift() }; + my %chainhash = %{ shift() }; + my %machash = %{ shift() }; + my $tftpdir = shift; + my %nrhash = %{ shift() }; my $linuximghash = shift(); my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); if ($kern->{kcmdline} =~ /!myipfn!/) { @@ -101,27 +107,28 @@ sub setstate { if ($ipfnd[0] eq 1) { $::callback->( - { - error => [$ipfnd[1]], - errorcode => [1] - }); + { + error => [ $ipfnd[1] ], + errorcode => [1] + }); return; } elsif ($ipfnd[0] eq 2) { my $servicenodes = $nrhash{$node}->[0]; if ($servicenodes and $servicenodes->{servicenode}) { my @sns = split /,/, $servicenodes->{servicenode}; - foreach my $sn ( @sns ) { + foreach my $sn (@sns) { + # We are in the service node pools, print error if no facing ip. if (xCAT::InstUtils->is_me($sn)) { my @myself = xCAT::NetworkUtils->determinehostname(); - my $myname = $myself[(scalar @myself)-1]; + my $myname = $myself[ (scalar @myself) - 1 ]; $::callback->( { - error => [ - "$myname: $ipfnd[1] on service node $sn" - ], - errorcode => [1] + error => [ + "$myname: $ipfnd[1] on service node $sn" + ], + errorcode => [1] } ); return; @@ -129,13 +136,13 @@ sub setstate { } } else { $::callback->( - { - error => [ + { + error => [ "$myname: $ipfnd[1]" - ], - errorcode => [1] - } - ); + ], + errorcode => [1] + } + ); return; } } else { @@ -146,238 +153,243 @@ sub setstate { my $addkcmdline; if ($kern->{addkcmdline}) { - $addkcmdline .= $kern->{addkcmdline}." "; + $addkcmdline .= $kern->{addkcmdline} . " "; } - - if($linuximghash and $linuximghash->{'addkcmdline'}) + + if ($linuximghash and $linuximghash->{'addkcmdline'}) { - unless($linuximghash->{'boottarget'}) + unless ($linuximghash->{'boottarget'}) { - $addkcmdline .= $linuximghash->{'addkcmdline'}." "; - } + $addkcmdline .= $linuximghash->{'addkcmdline'} . " "; + } } my $cmdhashref; - if($addkcmdline){ - $cmdhashref=xCAT::Utils->splitkcmdline($addkcmdline); - } - - if($cmdhashref and $cmdhashref->{volatile}) - { - $kern->{kcmdline}.=" ".$cmdhashref->{volatile}; + if ($addkcmdline) { + $cmdhashref = xCAT::Utils->splitkcmdline($addkcmdline); } - + + if ($cmdhashref and $cmdhashref->{volatile}) + { + $kern->{kcmdline} .= " " . $cmdhashref->{volatile}; + } + my $pcfg; unless (-d "$tftpdir/boot/grub2") { - mkpath("$tftpdir/boot/grub2"); + mkpath("$tftpdir/boot/grub2"); } my $nodemac; - my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] ); - - open($pcfg,'>',$tftpdir."/boot/grub2/".$node); - my $cref=$chainhash{$node}->[0]; #$chaintab->getNodeAttribs($node,['currstate']); + my %client_nethash = xCAT::DBobjUtils->getNetwkInfo([$node]); + + open($pcfg, '>', $tftpdir . "/boot/grub2/" . $node); + my $cref = $chainhash{$node}->[0]; #$chaintab->getNodeAttribs($node,['currstate']); if ($cref->{currstate}) { - print $pcfg "#".$cref->{currstate}."\n"; + print $pcfg "#" . $cref->{currstate} . "\n"; } - if(($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")){ - print $pcfg "set debug=all\n"; + if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) { + print $pcfg "set debug=all\n"; } print $pcfg "set timeout=5\n"; - - $normalnodes{$node}=1; #Assume a normal netboot (well, normal dhcp, - #which is normally with a valid 'filename' field, - #but the typical ppc case will be 'special' makedhcp - #to clear the filename field, so the logic is a little - #opposite - + + $normalnodes{$node} = 1; #Assume a normal netboot (well, normal dhcp, + #which is normally with a valid 'filename' field, + #but the typical ppc case will be 'special' makedhcp + #to clear the filename field, so the logic is a little + #opposite + if ($cref and $cref->{currstate} eq "boot") { - $breaknetbootnodes{$node}=1; - delete $normalnodes{$node}; #Signify to omit this from one makedhcp command - close($pcfg); + $breaknetbootnodes{$node} = 1; + delete $normalnodes{$node}; #Signify to omit this from one makedhcp command + close($pcfg); } elsif ($kern and $kern->{kernel}) { - #It's time to set grub configuration for this node to boot the kernel.. - #get tftpserver - my $tftpserver; - if (defined ($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'tftpserver'}) { - $tftpserver = $nrhash{$node}->[0]->{'tftpserver'}; - } 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; - } - - my $grub2protocol="tftp"; - if (defined ($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'} - && ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) { - $grub2protocol = $1; - } - unless($grub2protocol =~ /^http|tftp$/ ){ - $::callback->( - { - error => [ - "Invalid netboot method, please check noderes.netboot for $node" - ], - errorcode => [1] - } - ); - return; - } + #It's time to set grub configuration for this node to boot the kernel.. + #get tftpserver + my $tftpserver; + if (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'tftpserver'}) { + $tftpserver = $nrhash{$node}->[0]->{'tftpserver'}; + } 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; + } - - print $pcfg "set default=\"xCAT OS Deployment\"\n"; - print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; - print $pcfg " insmod http\n"; - print $pcfg " insmod tftp\n"; - print $pcfg " set root=$grub2protocol,$serverip\n"; - print $pcfg " echo Loading Install kernel ...\n"; - - my $protocolrootdir=""; - if($grub2protocol =~ /^http$/) - { - $protocolrootdir=$tftpdir; - } + my $grub2protocol = "tftp"; + if (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'} + && ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) { + $grub2protocol = $1; + } - if ($kern and $kern->{kcmdline}) { - print $pcfg " linux $protocolrootdir/$kern->{kernel} $kern->{kcmdline}\n"; - } else { - print $pcfg " linux $protocolrootdir/$kern->{kernel}\n"; - } - print $pcfg " echo Loading initial ramdisk ...\n"; - if ($kern and $kern->{initrd}) { - print $pcfg " initrd $protocolrootdir/$kern->{initrd}\n"; - } - - print $pcfg "}"; - close($pcfg); - my $inetn = xCAT::NetworkUtils->getipaddr($node); - unless ($inetn) { - syslog("local1|err","xCAT unable to resolve IP for $node in grub2 plugin"); - return; - } - } else { - close($pcfg); + unless ($grub2protocol =~ /^http|tftp$/) { + $::callback->( + { + error => [ +"Invalid netboot method, please check noderes.netboot for $node" + ], + errorcode => [1] + } + ); + return; + } + + + print $pcfg "set default=\"xCAT OS Deployment\"\n"; + print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; + print $pcfg " insmod http\n"; + print $pcfg " insmod tftp\n"; + print $pcfg " set root=$grub2protocol,$serverip\n"; + print $pcfg " echo Loading Install kernel ...\n"; + + my $protocolrootdir = ""; + if ($grub2protocol =~ /^http$/) + { + $protocolrootdir = $tftpdir; + } + + if ($kern and $kern->{kcmdline}) { + print $pcfg " linux $protocolrootdir/$kern->{kernel} $kern->{kcmdline}\n"; + } else { + print $pcfg " linux $protocolrootdir/$kern->{kernel}\n"; + } + print $pcfg " echo Loading initial ramdisk ...\n"; + if ($kern and $kern->{initrd}) { + print $pcfg " initrd $protocolrootdir/$kern->{initrd}\n"; + } + + print $pcfg "}"; + close($pcfg); + my $inetn = xCAT::NetworkUtils->getipaddr($node); + unless ($inetn) { + syslog("local1|err", "xCAT unable to resolve IP for $node in grub2 plugin"); + return; + } + } else { + close($pcfg); } my $ip = xCAT::NetworkUtils->getipaddr($node); unless ($ip) { - syslog("local1|err","xCAT unable to resolve IP in grub2 plugin"); - return; + syslog("local1|err", "xCAT unable to resolve IP in grub2 plugin"); + return; } my $mactab = xCAT::Table->new('mac'); my %ipaddrs; my $macstring; $ipaddrs{$ip} = 1; if ($mactab) { - my $ment = $machash{$node}->[0]; #$mactab->getNodeAttribs($node,['mac']); - if ($ment and $ment->{mac}) { - $macstring=$ment->{mac}; - my @macs = split(/\|/,$ment->{mac}); - foreach (@macs) { - $nodemac = $_; - if (/!(.*)/) { - my $ipaddr = xCAT::NetworkUtils->getipaddr($1); - if ($ipaddr) { - $ipaddrs{$ipaddr} = 1; - } - } - } - } + my $ment = $machash{$node}->[0]; #$mactab->getNodeAttribs($node,['mac']); + if ($ment and $ment->{mac}) { + $macstring = $ment->{mac}; + my @macs = split(/\|/, $ment->{mac}); + foreach (@macs) { + $nodemac = $_; + if (/!(.*)/) { + my $ipaddr = xCAT::NetworkUtils->getipaddr($1); + if ($ipaddr) { + $ipaddrs{$ipaddr} = 1; + } + } + } + } } + # Do not use symbolic link, p5 does not support symbolic link in /tftpboot # my $hassymlink = eval { symlink("",""); 1 }; foreach $ip (keys %ipaddrs) { - my @ipa=split(/\./,$ip); - my $pname = "grub.cfg-" . sprintf("%02x%02x%02x%02x",@ipa); - unlink($tftpdir."/boot/grub2/".$pname); - link($tftpdir."/boot/grub2/".$node,$tftpdir."/boot/grub2/".$pname); + my @ipa = split(/\./, $ip); + my $pname = "grub.cfg-" . sprintf("%02x%02x%02x%02x", @ipa); + unlink($tftpdir . "/boot/grub2/" . $pname); + link($tftpdir . "/boot/grub2/" . $node, $tftpdir . "/boot/grub2/" . $pname); } - if($macstring){ - $nodemac=xCAT::Utils->parseMacTabEntry($macstring,$node); + if ($macstring) { + $nodemac = xCAT::Utils->parseMacTabEntry($macstring, $node); } if ($nodemac =~ /:/) { my $tmp = lc($nodemac); $tmp =~ s/(..):(..):(..):(..):(..):(..)/$1-$2-$3-$4-$5-$6/g; my $pname = "grub.cfg-01-" . $tmp; - unlink($tftpdir."/boot/grub2/".$pname); - link($tftpdir."/boot/grub2/".$node,$tftpdir."/boot/grub2/".$pname); + unlink($tftpdir . "/boot/grub2/" . $pname); + link($tftpdir . "/boot/grub2/" . $node, $tftpdir . "/boot/grub2/" . $pname); } - return; + return; } my $errored = 0; -sub pass_along { + +sub pass_along { my $resp = shift; - + $callback->($resp); if ($resp and ($resp->{errorcode} and $resp->{errorcode}->[0]) or ($resp->{error} and $resp->{error}->[0])) { - $errored=1; + $errored = 1; } - foreach (@{$resp->{node}}) { - if ($_->{error} or $_->{errorcode}) { - $errored=1; - } + foreach (@{ $resp->{node} }) { + if ($_->{error} or $_->{errorcode}) { + $errored = 1; + } } } - + sub preprocess_request { my $req = shift; if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } my $callback1 = shift; - my $command = $req->{command}->[0]; - my $sub_req = shift; - my @args=(); + my $command = $req->{command}->[0]; + my $sub_req = shift; + my @args = (); if (ref($req->{arg})) { - @args=@{$req->{arg}}; + @args = @{ $req->{arg} }; } else { - @args=($req->{arg}); + @args = ($req->{arg}); } @ARGV = @args; my $nodes = $req->{node}; + #use Getopt::Long; my $HELP; my $VERSION; my $VERBOSE; Getopt::Long::Configure("bundling"); Getopt::Long::Configure("pass_through"); - if (!GetOptions('h|?|help' => \$HELP, - 'v|version' => \$VERSION, - 'V' => \$VERBOSE #>>>>>>>used for trace log>>>>>>> - ) ) { - if($usage{$command}) { - my %rsp; - $rsp{data}->[0]=$usage{$command}; - $callback1->(\%rsp); - } - return; + if (!GetOptions('h|?|help' => \$HELP, + 'v|version' => \$VERSION, + 'V' => \$VERBOSE #>>>>>>>used for trace log>>>>>>> + )) { + if ($usage{$command}) { + my %rsp; + $rsp{data}->[0] = $usage{$command}; + $callback1->(\%rsp); + } + return; } #>>>>>>>used for trace log start>>>>>> - my $verbose_on_off=0; - if($VERBOSE){$verbose_on_off=1;} + my $verbose_on_off = 0; + if ($VERBOSE) { $verbose_on_off = 1; } + #>>>>>>>used for trace log end>>>>>>> - - if ($HELP) { - if($usage{$command}) { + + if ($HELP) { + if ($usage{$command}) { my %rsp; - $rsp{data}->[0]=$usage{$command}; + $rsp{data}->[0] = $usage{$command}; $callback1->(\%rsp); } return; @@ -386,296 +398,301 @@ sub preprocess_request { if ($VERSION) { my $ver = xCAT::Utils->Version(); my %rsp; - $rsp{data}->[0]="$ver"; + $rsp{data}->[0] = "$ver"; $callback1->(\%rsp); - return; + return; } - if (@ARGV==0) { - if($usage{$command}) { + if (@ARGV == 0) { + if ($usage{$command}) { my %rsp; - $rsp{data}->[0]=$usage{$command}; + $rsp{data}->[0] = $usage{$command}; $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 - my @entries = xCAT::TableUtils->get_site_attribute("sharedtftp"); - my $t_entry = $entries[0]; - - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: sharedtftp=$t_entry"); - - if ( defined($t_entry) and ($t_entry eq "0" or $t_entry eq "no" or $t_entry eq "NO")) { - # check for computenodes and servicenodes from the noderange, if so error out - my @SN; - my @CN; - xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN); - unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { - if ((@SN > 0) && (@CN >0 )) { # there are both SN and CN - my $rsp; - $rsp->{data}->[0] = - "Nodeset was run with a noderange containing both service nodes and compute nodes. This is not valid. You must submit with either compute nodes in the noderange or service nodes. \n"; - xCAT::MsgUtils->message("E", $rsp, $callback1); - 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 + my @entries = xCAT::TableUtils->get_site_attribute("sharedtftp"); + my $t_entry = $entries[0]; - $req->{'_disparatetftp'}=[1]; - if ($req->{inittime}->[0]) { - return [$req]; - } - if (@CN >0 ) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req,@_); - } - } - return [$req]; + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: sharedtftp=$t_entry"); + + if (defined($t_entry) and ($t_entry eq "0" or $t_entry eq "no" or $t_entry eq "NO")) { + + # check for computenodes and servicenodes from the noderange, if so error out + my @SN; + my @CN; + xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN); + unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { + if ((@SN > 0) && (@CN > 0)) { # there are both SN and CN + my $rsp; + $rsp->{data}->[0] = +"Nodeset was run with a noderange containing both service nodes and compute nodes. This is not valid. You must submit with either compute nodes in the noderange or service nodes. \n"; + xCAT::MsgUtils->message("E", $rsp, $callback1); + return; + + } + } + + $req->{'_disparatetftp'} = [1]; + if ($req->{inittime}->[0]) { + return [$req]; + } + if (@CN > 0) { # if compute nodes broadcast to all servicenodes + return xCAT::Scope->get_broadcast_scope($req, @_); + } + } + return [$req]; } sub process_request { - $request = shift; - $callback = shift; - $::callback=$callback; - $sub_req = shift; - my $command = $request->{command}->[0]; - %breaknetbootnodes=(); - %normalnodes=(); - + $request = shift; + $callback = shift; + $::callback = $callback; + $sub_req = shift; + my $command = $request->{command}->[0]; + %breaknetbootnodes = (); + %normalnodes = (); + my @args; my @nodes; my @rnodes; - + #>>>>>>>used for trace log start>>>>>>> my %opt; - my $verbose_on_off=0; + my $verbose_on_off = 0; if (ref($::XNBA_request->{arg})) { - @args=@{$::XNBA_request->{arg}}; + @args = @{ $::XNBA_request->{arg} }; } else { - @args=($::XNBA_request->{arg}); + @args = ($::XNBA_request->{arg}); } @ARGV = @args; - GetOptions('V' => \$opt{V}); - if($opt{V}){$verbose_on_off=1;} - #>>>>>>>used for trace log end>>>>>>> + GetOptions('V' => \$opt{V}); + if ($opt{V}) { $verbose_on_off = 1; } + + #>>>>>>>used for trace log end>>>>>>> if (ref($request->{node})) { - @rnodes = @{$request->{node}}; + @rnodes = @{ $request->{node} }; } else { if ($request->{node}) { @rnodes = ($request->{node}); } } unless (@rnodes) { - if ($usage{$request->{command}->[0]}) { - $callback->({data=>$usage{$request->{command}->[0]}}); + if ($usage{ $request->{command}->[0] }) { + $callback->({ data => $usage{ $request->{command}->[0] } }); } return; } - + #if not shared tftpdir, then filter, otherwise, set up everything if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command @nodes = (); foreach (@rnodes) { if (xCAT::NetworkUtils->nodeonmynet($_)) { - push @nodes,$_; + push @nodes, $_; } else { - xCAT::MsgUtils->message("S", "$_: grub2 netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); + xCAT::MsgUtils->message("S", "$_: grub2 netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); } } } else { @nodes = @rnodes; } - + #>>>>>>>used for trace log>>>>>>> - my $str_node = join(" ",@nodes); - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: nodes are $str_node"); - + my $str_node = join(" ", @nodes); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: nodes are $str_node"); + # return directly if no nodes in the same network unless (@nodes) { xCAT::MsgUtils->message("S", "xCAT: grub2 netboot: no valid nodes. Stop the operation on this server."); return; } - + if (ref($request->{arg})) { - @args=@{$request->{arg}}; + @args = @{ $request->{arg} }; } else { - @args=($request->{arg}); + @args = ($request->{arg}); } - + #now run the begin part of the prescripts - unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { - $errored=0; - if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: the call is distrubuted to the service node already, so only need to handles my own children"); - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runbeginpre request"); - $sub_req->({command=>['runbeginpre'], - node=>\@nodes, - arg=>[$args[0], '-l']},\&pass_along); + unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; + if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: the call is distrubuted to the service node already, so only need to handles my own children"); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runbeginpre request"); + $sub_req->({ command => ['runbeginpre'], + node => \@nodes, + arg => [ $args[0], '-l' ] }, \&pass_along); } else { #nodeset did not distribute to the service node, here we need to let runednpre to distribute the nodes to their masters - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: nodeset did not distribute to the service node"); - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runbeginpre request"); - $sub_req->({command=>['runbeginpre'], - node=>\@rnodes, - arg=>[$args[0]]},\&pass_along); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: nodeset did not distribute to the service node"); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runbeginpre request"); + $sub_req->({ command => ['runbeginpre'], + node => \@rnodes, + arg => [ $args[0] ] }, \&pass_along); } if ($errored) { - my $rsp; - $rsp->{errorcode}->[0]=1; - $rsp->{error}->[0]="Failed in running begin prescripts.\n"; - $callback->($rsp); - return; + my $rsp; + $rsp->{errorcode}->[0] = 1; + $rsp->{error}->[0] = "Failed in running begin prescripts.\n"; + $callback->($rsp); + return; } - } - + } + #back to normal business - my $inittime=0; - if (exists($request->{inittime})) { $inittime= $request->{inittime}->[0];} - if (!$inittime) { $inittime=0;} - $errored=0; - unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue setdestiny request"); - $sub_req->({command=>['setdestiny'], - node=>\@nodes, - inittime=>[$inittime], - arg=>\@args},\&pass_along); + my $inittime = 0; + if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } + if (!$inittime) { $inittime = 0; } + $errored = 0; + unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); + $sub_req->({ command => ['setdestiny'], + node => \@nodes, + inittime => [$inittime], + arg => \@args }, \&pass_along); } if ($errored) { return; } - - my $bptab=xCAT::Table->new('bootparams',-create=>1); - my $bphash = $bptab->getNodesAttribs(\@nodes,['kernel','initrd','kcmdline','addkcmdline']); - my $chaintab=xCAT::Table->new('chain',-create=>1); - my $chainhash=$chaintab->getNodesAttribs(\@nodes,['currstate']); - my $noderestab=xCAT::Table->new('noderes',-create=>1); - my $nodereshash=$noderestab->getNodesAttribs(\@nodes,['tftpdir']); - my $mactab=xCAT::Table->new('mac',-create=>1); - my $machash=$mactab->getNodesAttribs(\@nodes,['mac']); - my $nrtab=xCAT::Table->new('noderes',-create=>1); - my $nrhash=$nrtab->getNodesAttribs(\@nodes,['servicenode','tftpserver','xcatmaster','netboot']); - my $typetab=xCAT::Table->new('nodetype',-create=>1); - my $typehash=$typetab->getNodesAttribs(\@nodes,['os','provmethod','arch','profile']); - my $linuximgtab=xCAT::Table->new('linuximage',-create=>1); - my $osimagetab=xCAT::Table->new('osimage',-create=>1); - + + my $bptab = xCAT::Table->new('bootparams', -create => 1); + my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); + my $chaintab = xCAT::Table->new('chain', -create => 1); + my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); + my $noderestab = xCAT::Table->new('noderes', -create => 1); + my $nodereshash = $noderestab->getNodesAttribs(\@nodes, ['tftpdir']); + my $mactab = xCAT::Table->new('mac', -create => 1); + my $machash = $mactab->getNodesAttribs(\@nodes, ['mac']); + my $nrtab = xCAT::Table->new('noderes', -create => 1); + my $nrhash = $nrtab->getNodesAttribs(\@nodes, [ 'servicenode', 'tftpserver', 'xcatmaster', 'netboot' ]); + my $typetab = xCAT::Table->new('nodetype', -create => 1); + my $typehash = $typetab->getNodesAttribs(\@nodes, [ 'os', 'provmethod', 'arch', 'profile' ]); + my $linuximgtab = xCAT::Table->new('linuximage', -create => 1); + my $osimagetab = xCAT::Table->new('osimage', -create => 1); + my $rc; my $errstr; - + my $tftpdir; foreach (@nodes) { my %response; if ($nodereshash->{$_} and $nodereshash->{$_}->[0] and $nodereshash->{$_}->[0]->{tftpdir}) { - $tftpdir = $nodereshash->{$_}->[0]->{tftpdir}; + $tftpdir = $nodereshash->{$_}->[0]->{tftpdir}; } else { - $tftpdir = $globaltftpdir; + $tftpdir = $globaltftpdir; } - $response{node}->[0]->{name}->[0]=$_; + $response{node}->[0]->{name}->[0] = $_; if ($args[0] eq 'stat') { - $response{node}->[0]->{data}->[0]= getstate($_,$tftpdir); + $response{node}->[0]->{data}->[0] = getstate($_, $tftpdir); $callback->(\%response); } elsif ($args[0]) { #If anything else, send it on to the destiny plugin, then setstate - my $ent = $typehash->{$_}->[0]; - my $osimgname = $ent->{'provmethod'}; - my $linuximghash=undef; - unless($osimgname =~ /^(install|netboot|statelite)$/){ - $linuximghash = $linuximgtab->getAttribs({imagename => $osimgname}, 'boottarget', 'addkcmdline'); - } - - ($rc,$errstr) = setstate($_,$bphash,$chainhash,$machash,$tftpdir,$nrhash,$linuximghash); + my $ent = $typehash->{$_}->[0]; + my $osimgname = $ent->{'provmethod'}; + my $linuximghash = undef; + unless ($osimgname =~ /^(install|netboot|statelite)$/) { + $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); + } + + ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); if ($rc) { - $response{node}->[0]->{errorcode}->[0]= $rc; - $response{node}->[0]->{errorc}->[0]= $errstr; + $response{node}->[0]->{errorcode}->[0] = $rc; + $response{node}->[0]->{errorc}->[0] = $errstr; $callback->(\%response); } } - }# end of foreach node - + } # end of foreach node + my @normalnodeset = keys %normalnodes; - my @breaknetboot=keys %breaknetbootnodes; + my @breaknetboot = keys %breaknetbootnodes; + #print "grub2 :inittime=$inittime; normalnodeset=@normalnodeset; breaknetboot=@breaknetboot\n"; my %osimagenodehash; - for my $nn (@normalnodeset){ + for my $nn (@normalnodeset) { + #record the os version for node - my $ent = $typehash->{$nn}->[0]; - my $osimage=$ent->{'provmethod'}; - if($osimage =~ /^(install|netboot|statelite)$/){ - $osimage=($ent->{'os'}).'-'.($ent->{'arch'}).'-'.($ent->{'provmethod'}).'-'.($ent->{'profile'}); + my $ent = $typehash->{$nn}->[0]; + my $osimage = $ent->{'provmethod'}; + if ($osimage =~ /^(install|netboot|statelite)$/) { + $osimage = ($ent->{'os'}) . '-' . ($ent->{'arch'}) . '-' . ($ent->{'provmethod'}) . '-' . ($ent->{'profile'}); } - push @{$osimagenodehash{$osimage}}, $nn; + push @{ $osimagenodehash{$osimage} }, $nn; } - - my $do_dhcpsetup=1; - my @entries = xCAT::TableUtils->get_site_attribute("dhcpsetup"); - my $t_entry = $entries[0]; - if (defined($t_entry) ) { - if ($t_entry =~ /0|n|N/) { $do_dhcpsetup=0; } + + my $do_dhcpsetup = 1; + my @entries = xCAT::TableUtils->get_site_attribute("dhcpsetup"); + my $t_entry = $entries[0]; + if (defined($t_entry)) { + if ($t_entry =~ /0|n|N/) { $do_dhcpsetup = 0; } } - + #Don't bother to try dhcp binding changes if sub_req not passed, i.e. service node build time unless (($args[0] eq 'stat') || ($inittime) || ($args[0] eq 'offline')) { foreach my $osimage (keys %osimagenodehash) { + #TOTO check the existence of grub2 executable files for corresponding arch - my $osimgent = $osimagetab->getAttribs({imagename => $osimage },'osarch'); - my $validarch=undef; - if($osimgent and $osimgent->{'osarch'}) - { - $validarch = $osimgent->{'osarch'}; - } + my $osimgent = $osimagetab->getAttribs({ imagename => $osimage }, 'osarch'); + my $validarch = undef; + if ($osimgent and $osimgent->{'osarch'}) + { + $validarch = $osimgent->{'osarch'}; + } else - { - # Can not determine arch from osimage definition. This is most likely - # the case when nodeset is "shell" or "shutdown". Look at node definition, to - # figure out arch to use. - - # get nodename from osimagenodehash hash - my $node_name = $osimagenodehash{$osimage}[0]; - - # lookup node arch setting - my $node_entry = $typetab->getNodeAttribs($node_name,['arch']); - if ($node_entry and $node_entry->{'arch'}) - { - # Extracted arch from node definition - $validarch = $node_entry->{'arch'}; - } - else - { - # At this point we can not determine architecture either - # from osimage or node definition. - my $rsp; - push @{$rsp->{data}}, "Not able to determine architecture of node $node_name. Verify arch attribute setting.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - } + { + # Can not determine arch from osimage definition. This is most likely + # the case when nodeset is "shell" or "shutdown". Look at node definition, to + # figure out arch to use. + + # get nodename from osimagenodehash hash + my $node_name = $osimagenodehash{$osimage}[0]; + + # lookup node arch setting + my $node_entry = $typetab->getNodeAttribs($node_name, ['arch']); + if ($node_entry and $node_entry->{'arch'}) + { + # Extracted arch from node definition + $validarch = $node_entry->{'arch'}; } + else + { + # At this point we can not determine architecture either + # from osimage or node definition. + my $rsp; + push @{ $rsp->{data} }, "Not able to determine architecture of node $node_name. Verify arch attribute setting.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + } if ($validarch =~ /ppc64/i) - { - $validarch="ppc" - } - my $grub2 = "/boot/grub2/grub2.".$validarch; + { + $validarch = "ppc" + } + my $grub2 = "/boot/grub2/grub2." . $validarch; my $tftppath = $tftpdir . $grub2; unless (-e "$tftppath") { - my $rsp; - push @{$rsp->{data}}, - "stop configuration, missing $tftppath.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - return; - } + my $rsp; + push @{ $rsp->{data} }, + "stop configuration, missing $tftppath.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return; + } chdir("$tftpdir/boot/grub2/"); - foreach my $tmp_node (@{$osimagenodehash{$osimage}}) { + foreach my $tmp_node (@{ $osimagenodehash{$osimage} }) { unless (-e "grub2-$tmp_node") { - symlink("grub2.".$validarch, "grub2-$tmp_node"); + symlink("grub2." . $validarch, "grub2-$tmp_node"); } } if ($do_dhcpsetup) { if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@{$osimagenodehash{$osimage}}}, $callback); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@{ $osimagenodehash{$osimage} } }, $callback); } else { - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@{$osimagenodehash{$osimage}}},$callback); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@{ $osimagenodehash{$osimage} } }, $callback); } } - } #end of foreach osimagenodehash + } #end of foreach osimagenodehash foreach my $tmp_node (@breaknetboot) { if (-e "$tftpdir/boot/grub2/grub2-$tmp_node") { @@ -683,44 +700,45 @@ sub process_request { } } if ($do_dhcpsetup) { - if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@breaknetboot, - arg=>['-l']},$callback); - } else { - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@breaknetboot},$callback); - } - } - } - - #now run the end part of the prescripts - unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') - $errored=0; - if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runendpre request"); - $sub_req->({command=>['runendpre'], - node=>\@nodes, - arg=>[$args[0], '-l']},\&pass_along); - } else { #nodeset did not distribute to the service node, here we need to let runednpre to distribute the nodes to their masters - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runendpre request"); - $sub_req->({command=>['runendpre'], - node=>\@rnodes, - arg=>[$args[0]]},\&pass_along); + if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@breaknetboot, + arg => ['-l'] }, $callback); + } else { + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@breaknetboot }, $callback); + } } - if ($errored) { - my $rsp; - $rsp->{errorcode}->[0]=1; - $rsp->{error}->[0]="Failed in running end prescripts\n"; - $callback->($rsp); - return; + } + + #now run the end part of the prescripts + unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') + $errored = 0; + if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runendpre request"); + $sub_req->({ command => ['runendpre'], + node => \@nodes, + arg => [ $args[0], '-l' ] }, \&pass_along); + } else { #nodeset did not distribute to the service node, here we need to let runednpre to distribute the nodes to their masters + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runendpre request"); + $sub_req->({ command => ['runendpre'], + node => \@rnodes, + arg => [ $args[0] ] }, \&pass_along); + } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0] = 1; + $rsp->{error}->[0] = "Failed in running end prescripts\n"; + $callback->($rsp); + return; } } } #---------------------------------------------------------------------------- + =head3 getNodesetStates returns the nodeset state for the given nodes. The possible nodeset states are: netboot, install, boot and discover. @@ -732,18 +750,19 @@ sub process_request { Returns: (return code, error message) =cut + #----------------------------------------------------------------------------- sub getNodesetStates { - my $noderef=shift; + my $noderef = shift; if ($noderef =~ /xCAT_plugin::grub2/) { - $noderef=shift; + $noderef = shift; } - my @nodes=@$noderef; - my $hashref=shift; + my @nodes = @$noderef; + my $hashref = shift; my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories - my %nrhash = %{$noderestab->getNodesAttribs(\@nodes,[qw(tftpdir)])}; - - if (@nodes>0) { + my %nrhash = %{ $noderestab->getNodesAttribs(\@nodes, [qw(tftpdir)]) }; + + if (@nodes > 0) { foreach my $node (@nodes) { my $tftpdir; if ($nrhash{$node}->[0] and $nrhash{$node}->[0]->{tftpdir}) { @@ -751,15 +770,15 @@ sub getNodesetStates { } else { $tftpdir = $globaltftpdir; } - my $tmp=getstate($node, $tftpdir); - my @a=split(' ', $tmp); + my $tmp = getstate($node, $tftpdir); + my @a = split(' ', $tmp); $stat = $a[0]; if (exists($hashref->{$stat})) { - my $pa=$hashref->{$stat}; + my $pa = $hashref->{$stat}; push(@$pa, $node); } else { - $hashref->{$stat}=[$node]; + $hashref->{$stat} = [$node]; } } } From 80bee1d916697c54dcd6794e817f85257edad8b1 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 21 Apr 2016 02:41:12 -0400 Subject: [PATCH 48/52] fix a typo in rh/genimage --- xCAT-server/share/xcat/netboot/rh/genimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index fdb23ef93..1ece8362a 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -999,7 +999,7 @@ sub mkinitrd_dracut { # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - print $DRACUTCONF qq{dracutmodules+="$$dracutmodulelist"\n}; + print $DRACUTCONF qq{dracutmodules+="$dracutmodulelist"\n}; print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; close $DRACUTCONF; } else { From 52f3e0a1ec595f3c09f550133514c49f3712cd2d Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 22 Apr 2016 09:39:59 -0400 Subject: [PATCH 49/52] modify autotest case for issue 7.2 node can not renew dhcp lease #944 --- .../installation/reg_linux_diskfull_installation_flat | 4 ++++ .../installation/reg_linux_diskless_installation_flat | 4 ++++ .../installation/reg_linux_statelite_installation_flat | 4 ++++ 3 files changed, 12 insertions(+) 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 5c73b4917..c8f54d1b5 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -54,4 +54,8 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN end 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 705400a6a..812eb0daf 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -63,6 +63,10 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 check:output=~on / type tmpfs +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 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 c0ba9c8f8..a9759d66f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -117,6 +117,10 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~rootfs on / type tmpfs +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-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 d2475a918de3dcd5c21e7dd005052a464500abe2 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 25 Apr 2016 04:09:43 -0400 Subject: [PATCH 50/52] fix issue [DEV] RHEL 7.2 can't install on ppc64le Non-Virtualized --- xCAT-server/share/xcat/install/scripts/getinstdisk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 5520ab43b..6683a1693 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -97,7 +97,9 @@ if [ -z "$install_disk" ]; then fi # If there is kernel file, add partition's disk into disk_array - for i in $ker_dir/vmlinuz*; do + # It seems the kernel file in ubuntu and sles are named like vmlinux, but in RH it is called vmlinuz + # To check both vmlinux and vmlinuz, use regular expression "vmlinu*" to match them + for i in $ker_dir/vmlinu*; do disk_part=${partition%%[0-9]*} touch "$tmpfile$disk_part" disk_array=$disk_array"$disk_part " From 52061dd6623a8bf81dd9145653759428c1b89fd5 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 25 Apr 2016 03:08:59 -0400 Subject: [PATCH 51/52] Fix issue 942:[PCM] CN IP loss after 12 hours due to the dhcp.lease timeout value 43200 --- xCAT-server/share/xcat/install/scripts/post.rhels7 | 8 ++++++++ xCAT/postscripts/xcatinstallpost | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 index b34d7d012..3b36dfefe 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -20,3 +20,11 @@ do #nic name change during the install and first_reboot sed -i '/HWADDR/d' $i done + +# NetworkManager will conflict with the configuring xcat do later in postboot script, so disable it in postscript + +# There are 2 other service related to NetworkManager: NetworkManager-dispatcher and NetworkManager-wait-online +# Both of them are triggered by NetworkManager, so just disable NetworkManager here +if [ -f "/usr/lib/systemd/system/NetworkManager.service" ]; then + systemctl disable NetworkManager +fi diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index 0eee2be6a..83d9a8eb9 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -99,13 +99,6 @@ fi " >> /xcatpost/mypostscript.post fi -stopservice NetworkManager -stopservice NetworkManager-dispatcher -stopservice NetworkManager-wait-online - -disableservice NetworkManager -disableservice NetworkManager-dispatcher -disableservice NetworkManager-wait-online chmod +x /xcatpost/mypostscript.post if [ -x /xcatpost/mypostscript.post ];then msgutil_r "$MASTER_IP" "info" "running /xcatpost/mypostscript.post" "/var/log/xcat/xcat.log" From dabf1cd13888fdd757c409f9d422827eb22679c9 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Wed, 27 Apr 2016 04:55:45 -0400 Subject: [PATCH 52/52] delete stop labels --- .../testcase/installation/Diskless_installation_flat_p8_le | 1 - .../autotest/testcase/installation/Full_installation_flat_p8_le | 1 - .../testcase/installation/reg_linux_SN_installation_hierarchy | 1 - .../testcase/installation/reg_linux_diskfull_installation_flat | 1 - .../installation/reg_linux_diskfull_installation_hierarchy | 1 - .../testcase/installation/reg_linux_diskless_installation_flat | 1 - .../installation/reg_linux_diskless_installation_hierarchy | 1 - .../testcase/installation/reg_linux_statelite_installation_flat | 1 - .../reg_linux_statelite_installation_hierarchy_by_nfs | 1 - .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 1 - .../testcase/installation/ubuntu_diskless_installation_vm | 1 - .../autotest/testcase/installation/ubuntu_full_installation_vm | 1 - 12 files changed, 12 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index 876aad295..6e9c128d4 100644 --- a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -1,6 +1,5 @@ start:Diskless_installation_flat_p8_le os:Linux -stop:yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index c62cc0cac..749938977 100644 --- a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -1,6 +1,5 @@ start:Full_installation_flat_p8_le os:Linux -stop:yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index 5fd078f34..428b322fb 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -1,6 +1,5 @@ start:reg_linux_SN_installation_hierarchy os:Linux -stop:yes cmd:chtab key=nameservers site.value="" check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index c8f54d1b5..411c11e79 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,5 @@ start:reg_linux_diskfull_installation_flat os:Linux -stop:yes 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 ec28d5b86..ef0b19a63 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,5 @@ start:reg_linux_diskfull_installation_hierarchy os:Linux -stop:yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 812eb0daf..f6c69169d 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,5 @@ start:reg_linux_diskless_installation_flat os:Linux -stop:yes cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 7232133d4..9119eee1a 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,5 @@ start:reg_linux_diskless_installation_hierarchy os:Linux -stop:yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 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 a9759d66f..780d32e3b 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,5 @@ start:reg_linux_statelite_installation_flat os:Linux -stop:yes cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN 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 7e310aaa1..28260fdc0 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,5 @@ start:reg_linux_statelite_installation_hierarchy_by_nfs os:Linux -stop:yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN 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 8d4984708..c9b3af64f 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,5 @@ start:reg_linux_statelite_installation_hierarchy_by_ramdisk os:Linux -stop:yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index 569d7605d..c642ca7b3 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -1,6 +1,5 @@ start:Ubuntu_diskless_installation_flat_x86_vm os:Linux -stop:yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm index ff4d42ce6..e25d55a4c 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm @@ -1,6 +1,5 @@ start:Ubuntu_full_installation_flat_x86_vm os:Linux -stop:yes cmd:copycds $$ISO check:rc==0