Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
jijisa
/
porch
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7a670a30
authored
Mar 29, 2017
by
Heechul Kim
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ipmi reset using ipmitool
parent
0ad34fa4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
porch/api/machine/bizlogic.py
porch/api/machine/bizlogic.py
View file @
7a670a30
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment