summaryrefslogtreecommitdiffstats
path: root/deploy/template
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-09-14 15:05:26 +0800
committerbaigk <baiguoku@huawei.com>2015-09-15 09:45:52 +0800
commitb40d47e921a9af9685329ce8a4bfcdc2aa81af4a (patch)
tree171bb7b716b09d871d3cd9d0df7a206df168c9ab /deploy/template
parent86af3f1897f0cc9b1231e6cbd9e302f5daf3f64c (diff)
bug fix: prepare to install ipmitool and retry reset baremetal using ipmi
JIRA: COMPASS-50 Change-Id: Ib6525ef5fba6a56da1dde652f18afcdc9dfe15ad Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/template')
-rw-r--r--deploy/template/power/ipmitool.tmpl30
1 files changed, 28 insertions, 2 deletions
diff --git a/deploy/template/power/ipmitool.tmpl b/deploy/template/power/ipmitool.tmpl
index a3157132..5d2630af 100644
--- a/deploy/template/power/ipmitool.tmpl
+++ b/deploy/template/power/ipmitool.tmpl
@@ -1,3 +1,4 @@
+source \${COMPASS_DIR}/util/log.sh
#set default_ipmiUser=$getVar('ipmiUser', '')
#set default_ipmiPass=$getVar('ipmiPass', '')
#set hosts=$getVar('hosts', [])
@@ -19,7 +20,32 @@ exit 1
#set ipmiIp=$host.get('ipmiIp', '')
#set ipmiUser=$host.get('ipmiUser', $default_ipmiUser)
#set ipmiPass=$host.get('ipmiPass', $default_ipmiPass)
-ipmitool -I lan -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis bootdev pxe
-ipmitool -I lan -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis power reset
+for i in {1..5}; do
+ if ipmitool -I lan -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis bootdev pxe >/dev/null 2>&1
+ then
+ break
+ elif [[ i -lt 5 ]]
+ then
+ sleep 1
+ else
+ log_error "set $ipmiIp pxe fail"
+ exit 1
+ fi
+done
+sleep 1
+for i in {1..5}; do
+ if ipmitool -I lan -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis power reset >/dev/null 2>&1
+ then
+ break
+ elif [[ i -lt 5 ]]
+ then
+ sleep 1
+ else
+ log_error "reset $ipmiIp fail"
+ exit 1
+ fi
+done
+log_info "set pxe and reset $ipmiIp successsully"
+sleep 1
#end for
#end if