ipmi¶
IPMI module.
TODO: replace with pyghmi.
-
class
spicerack.ipmi.
Ipmi
(password, dry_run=True)[source]¶ Bases:
object
Class to manage remote IPMI via ipmitool.
-
_get_boot_parameter
(mgmt_hostname, param_label)[source]¶ Get a specific boot parameter of the host.
Parameters: Raises: spicerack.ipmi.IpmiError
-- if unable to find the given label or to extract its value.Returns: the value of the parameter.
Return type:
-
check_bootparams
(mgmt_hostname)[source]¶ Check if the BIOS boot parameters are back to normal values.
Parameters: mgmt_hostname (str) -- the FQDN of the management interface of the host to target. Raises: spicerack.ipmi.IpmiCheckError
-- if the BIOS boot parameters are incorrect.
-
check_connection
(mgmt_hostname)[source]¶ Ensure that remote IPMI is working for the managment console hostname.
Parameters: mgmt_hostname (str) -- the FQDN of the management interface of the host to target. Raises: spicerack.ipmi.IpmiError
-- if unable to connect or execute a test command.
-
command
(mgmt_hostname, command_parts, is_safe=False)[source]¶ Run an ipmitool command for a remote managment console hostname.
Parameters: Returns: the output of the ipmitool command.
Return type: Raises: spicerack.ipmi.IpmiError
-- on failure.
-
force_pxe
(mgmt_hostname)[source]¶ Force PXE for the next boot and verify that the setting was applied.
Parameters: mgmt_hostname (str) -- the FQDN of the management interface of the host to target. Raises: spicerack.ipmi.IpmiCheckError
-- if unable to verify the PXE mode within the retries.
-
-
exception
spicerack.ipmi.
IpmiCheckError
[source]¶ Bases:
spicerack.exceptions.SpicerackCheckError
Custom exception class for check errors of the Ipmi class.
-
exception
spicerack.ipmi.
IpmiError
[source]¶ Bases:
spicerack.exceptions.SpicerackError
Custom exception class for errors of the Ipmi class.