ipmi¶
IPMI module.
Todo
replace with pyghmi.
- 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.
- class spicerack.ipmi.Ipmi(mgmt_fqdn: str, password: str, dry_run: bool = True)[source]¶
Bases:
object
Class to manage remote IPMI via ipmitool.
Initialize the instance.
- Parameters
- check_bootparams() None [source]¶
Check if the BIOS boot parameters are back to normal values.
- Raises
spicerack.ipmi.IpmiCheckError -- if the BIOS boot parameters are incorrect.
- check_connection() None [source]¶
Ensure that remote IPMI is working for the management console FQDN.
- Raises
spicerack.ipmi.IpmiError -- if unable to connect or execute a test command.
- command(command_parts: List[str], is_safe: bool = False) str [source]¶
Run an ipmitool command for a remote management console FQDN.
- Parameters
- Returns
the output of the ipmitool command.
- Return type
- Raises
spicerack.ipmi.IpmiError -- on failure.
- force_pxe() None [source]¶
Force PXE for the next boot and verify that the setting was applied.
- Raises
spicerack.ipmi.IpmiCheckError -- if unable to verify the PXE mode within the retries.
- power_status() str [source]¶
Get the current power status for the management console FQDN.
- Raises
spicerack.ipmi.IpmiError -- if unable to get the power status.
- reboot() None [source]¶
Reboot a host via IPMI, either performing a power cycle or a power on based on the power status.