Commit 7a670a30 by Heechul Kim

ipmi reset using ipmitool

parent 0ad34fa4
Showing with 11 additions and 9 deletions
...@@ -394,8 +394,6 @@ def install_machine(data): ...@@ -394,8 +394,6 @@ def install_machine(data):
update_machine(d['name'], d) update_machine(d['name'], d)
l_ipmi.append(d['ipmi_ip']) l_ipmi.append(d['ipmi_ip'])
# delete s_tmp
os.unlink(s_tmp)
#if not len(l_ipmi): #if not len(l_ipmi):
# return (False, 'No IPMI IP is found.') # return (False, 'No IPMI IP is found.')
...@@ -425,14 +423,18 @@ def install_machine(data): ...@@ -425,14 +423,18 @@ def install_machine(data):
# power on the physical machines if any. # power on the physical machines if any.
if len(l_ipmi): if len(l_ipmi):
s_hosts = ",".join(l_ipmi) for ipmi_ip in l_ipmi:
# /usr/sbin/ipmipower -h 192.168.24.18 -u root -p xxxx --cycle s_cmd = "{} -I lanplus -H {} -U {} -f {} chassis power reset"\
s_cmd = "{} -h {} -u {} -p '{}' --cycle"\ .format(IPMITOOL, ipmi_ip, IPMIUSER, s_tmp)
.format(IPMIPOWER, s_hosts, IPMIUSER, IPMIPASS)
(b_ret, l_out) = cmd(s_cmd) (b_ret, l_out) = cmd(s_cmd)
if not b_ret: if not b_ret:
log.error('IPMI POWER is failed.') log.error('IPMI Reset is failed: {}'.format(l_out))
else:
log.info('IPMI Reset is succeeded: {}'.format(l_out))
# delete s_tmp
os.unlink(s_tmp)
return (True, s_date) return (True, s_date)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment