diff options
author | baigk <baiguoku@huawei.com> | 2016-02-16 00:09:04 +0800 |
---|---|---|
committer | baigk <baiguoku@huawei.com> | 2016-02-16 00:09:04 +0800 |
commit | 85308a67a409694de2eca3f89ef3fbcc390416a9 (patch) | |
tree | 5d1f14394df26d83de20bfbd1c567072631427d6 /deploy/template/power/ipmitool.tmpl | |
parent | 935ac00a28a1e265473079e5028a964b9720adf0 (diff) |
power on the server before pxe using ipmitool
JIRA: COMPASS-314
Change-Id: Iff6910412217a7daff3e93370075747abcd3ac38
Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/template/power/ipmitool.tmpl')
-rw-r--r-- | deploy/template/power/ipmitool.tmpl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/deploy/template/power/ipmitool.tmpl b/deploy/template/power/ipmitool.tmpl index 73278e45..a297e001 100644 --- a/deploy/template/power/ipmitool.tmpl +++ b/deploy/template/power/ipmitool.tmpl @@ -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 |