power on the server before pxe using ipmitool 27/11327/2
authorbaigk <baiguoku@huawei.com>
Mon, 15 Feb 2016 16:09:04 +0000 (00:09 +0800)
committerJustin chi <chigang@huawei.com>
Tue, 15 Mar 2016 08:54:03 +0000 (08:54 +0000)
JIRA: COMPASS-314

Change-Id: Iff6910412217a7daff3e93370075747abcd3ac38
Signed-off-by: baigk <baiguoku@huawei.com>
(cherry picked from commit 85308a67a409694de2eca3f89ef3fbcc390416a9)

deploy/template/power/ipmitool.tmpl

index 73278e4..a297e00 100644 (file)
@@ -27,7 +27,19 @@ exit 1
 #else
     #set interface='lan'
 #end if
-
+for i in {1..5}; do
+    if ipmitool -I $interface -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis power on >/dev/null 2>&1
+    then
+        break
+    elif [[ i -lt 5 ]]
+    then
+        sleep 1
+    else
+        log_error "$ipmiIp power on fail"
+        exit 1
+    fi
+done
+sleep 1
 for i in {1..5}; do
     if ipmitool -I $interface -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis bootdev pxe >/dev/null 2>&1
     then