forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IH-621: Add IPMI host power on support and remove DRAC
DRAC power on support relies upon a Dell supplemental pack which is no longer available, so remove it. Add IPMI power on support using ipmitool, which should work with virtually any modern server which has a BMC, regardless of vendor. Signed-off-by: Alex Brett <[email protected]>
- Loading branch information
Showing
5 changed files
with
53 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os.path | ||
import sys | ||
|
||
import xcp.cmd as cmd | ||
|
||
|
||
class IPMI_POWERON_FAILED(Exception): | ||
"""IPMI Poweron exception""" | ||
pass | ||
|
||
ipmi_path = "/usr/bin/ipmitool" | ||
|
||
def IPMI(power_on_ip, user, password): | ||
(rc, stdout, stderr) = cmd.runCmd( | ||
[ | ||
ipmi_path, | ||
"-H", | ||
power_on_ip, | ||
"-I", "lanplus", | ||
"-U", | ||
user, | ||
"-P", | ||
password, | ||
"chassis", "power", "on" | ||
], | ||
with_stdout=True, | ||
with_stderr=True, | ||
) | ||
if rc != 0: | ||
raise IPMI_POWERON_FAILED(stderr) | ||
return stdout | ||
|
||
|
||
def main(): | ||
if len(sys.argv) < 3: | ||
exit(0) | ||
ip = sys.argv[1] | ||
user = sys.argv[2] | ||
password = sys.argv[3] | ||
print(IPMI(ip, user, password)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters