Commit 7a670a30 by Heechul Kim

ipmi reset using ipmitool

parent 0ad34fa4
Showing with 9 additions and 7 deletions
......@@ -394,8 +394,6 @@ def install_machine(data):
update_machine(d['name'], d)
l_ipmi.append(d['ipmi_ip'])
# delete s_tmp
os.unlink(s_tmp)
#if not len(l_ipmi):
# return (False, 'No IPMI IP is found.')
......@@ -425,14 +423,18 @@ def install_machine(data):
# power on the physical machines if any.
if len(l_ipmi):
s_hosts = ",".join(l_ipmi)
# /usr/sbin/ipmipower -h 192.168.24.18 -u root -p xxxx --cycle
s_cmd = "{} -h {} -u {} -p '{}' --cycle"\
.format(IPMIPOWER, s_hosts, IPMIUSER, IPMIPASS)
for ipmi_ip in l_ipmi:
s_cmd = "{} -I lanplus -H {} -U {} -f {} chassis power reset"\
.format(IPMITOOL, ipmi_ip, IPMIUSER, s_tmp)
(b_ret, l_out) = cmd(s_cmd)
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)
......
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