mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Merge pull request #1170 from caomengmeng/avoid_rnetboot_CN_status_not_changed_issue
To avoid rnetboot cn status not changed issue
This commit is contained in:
		| @@ -297,6 +297,12 @@ sub mn_install { | ||||
|  | ||||
|         &runcmd("makedhcp -n"); | ||||
|         &runcmd("makedns -n"); | ||||
|         &runcmd("chdef $confkeys{$mn} status="); | ||||
|         if($?){ | ||||
|             send_msg(0, "[$mn->$confkeys{$mn}][mn_install] Failed to change MN status in current control node"); | ||||
|             return 1; | ||||
|         } | ||||
|  | ||||
|  | ||||
| 	&runcmd("nodeset $confkeys{$mn} osimage=$osimage"); | ||||
| 	if( $arch =~ /x86_64/ || $arch =~ /ppc64le/ || $arch =~ /ppc64el/){ | ||||
| @@ -305,12 +311,15 @@ sub mn_install { | ||||
| 	    &runcmd("rnetboot $confkeys{$mn}"); | ||||
| 	} | ||||
| 	 | ||||
| 	if($mn !~ /ubuntu/){ | ||||
| 	    &runcmd("sleep 300"); | ||||
| 	    &runcmd("a=0;while ! `lsdef -l $confkeys{$mn}|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ \$a -gt 200 ];then break;fi done");} | ||||
| 	else{ | ||||
| 	    &runcmd("sleep 1800");	 | ||||
| 	} | ||||
|          &runcmd("sleep 600"); | ||||
|          &runcmd("a=0;while ! `lsdef -l $confkeys{$mn}|grep status|grep booted >/dev/null`; do sleep 30;((a++));if [ \$a -gt 100 ];then break;fi done"); | ||||
|  | ||||
| #	if($mn !~ /ubuntu/){ | ||||
| #	    &runcmd("sleep 300"); | ||||
| #	    &runcmd("a=0;while ! `lsdef -l $confkeys{$mn}|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ \$a -gt 200 ];then break;fi done");} | ||||
| #	else{ | ||||
| #	    &runcmd("sleep 1800");	 | ||||
| #	} | ||||
| 	 | ||||
| 	&runcmd("lsdef -l $confkeys{$mn}|grep status|grep booted >/dev/null"); | ||||
| 	if($?){ | ||||
|   | ||||
| @@ -24,6 +24,8 @@ 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:chdef $$CN status= | ||||
| 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 | ||||
|   | ||||
| @@ -20,7 +20,7 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ins | ||||
| check:rc==0 | ||||
| cmd:rpower $$CN boot | ||||
| check:rc==0 | ||||
| cmd:sleep 300 | ||||
| cmd:sleep 600 | ||||
| cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done | ||||
| cmd:ping $$CN -c 3 | ||||
| check:output=~64 bytes from $$CN | ||||
|   | ||||
| @@ -67,8 +67,8 @@ check:rc==0 | ||||
| cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "ppc64" ]]; then rnetboot $$SN;elif [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rpower $$SN boot; fi | ||||
| check:rc==0 | ||||
|  | ||||
| cmd:sleep 1800 | ||||
| cmd:a=0;while ! `lsdef -l $$SN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 400 ];then break;fi done | ||||
| cmd:sleep 600 | ||||
| cmd:a=0;while ! `lsdef -l $$SN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 70 ];then break;fi done | ||||
|  | ||||
| cmd:ping $$SN -c 3 | ||||
| check:rc==0 | ||||
|   | ||||
| @@ -20,8 +20,8 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ins | ||||
| check:rc==0 | ||||
| cmd:rpower $$CN boot | ||||
| check:rc==0 | ||||
| cmd:sleep 300 | ||||
| cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done | ||||
| cmd:sleep 600 | ||||
| cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done | ||||
| cmd:ping $$CN -c 3 | ||||
| check:output=~64 bytes from $$CN | ||||
| cmd:lsdef -l $$CN | grep status | ||||
|   | ||||
| @@ -19,7 +19,8 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ins | ||||
| check:rc==0 | ||||
| cmd:rpower $$CN boot | ||||
| check:rc==0 | ||||
| cmd:sleep 3000 | ||||
| cmd:sleep 600 | ||||
| cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done | ||||
| cmd:ping $$CN -c 3 | ||||
| check:output=~64 bytes from $$CN | ||||
| cmd:lsdef -l $$CN | grep status | ||||
|   | ||||
| @@ -19,7 +19,8 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ins | ||||
| check:rc==0 | ||||
| cmd:rpower $$CN boot | ||||
| check:rc==0 | ||||
| cmd:sleep 3000 | ||||
| cmd:sleep 600 | ||||
| cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done | ||||
| cmd:ping $$CN -c 3 | ||||
| check:output=~64 bytes from $$CN | ||||
| cmd:lsdef -l $$CN | grep status | ||||
|   | ||||
		Reference in New Issue
	
	Block a user