The ironic.drivers.modules.ipminative Module

Ironic Native IPMI power manager.

class ironic.drivers.modules.ipminative.NativeIPMIManagement[source]

Bases: ironic.drivers.base.ManagementInterface

get_boot_device(*args, **kwargs)[source]

Get the current boot device for the task’s node.

Returns the current boot device of the node.

Parameters:task – a task from TaskManager.
Raises:MissingParameterValue if required IPMI parameters are missing.
Raises:IPMIFailure on an error from pyghmi.
Returns:a dictionary containing:
boot_device:the boot device, one of ironic.common.boot_devices or None if it is unknown.
persistent:Whether the boot device will persist to all future boots or not, None if it is unknown.
get_properties()[source]
get_sensors_data(*args, **kwargs)[source]

Get sensors data.

Parameters:task – a TaskManager instance.
Raises:FailedToGetSensorData when getting the sensor data fails.
Raises:MissingParameterValue if required ipmi parameters are missing
Returns:returns a dict of sensor data group by sensor type.
get_supported_boot_devices(task)[source]

Get a list of the supported boot devices.

Parameters:task – a task from TaskManager.
Returns:A list with the supported boot devices defined in ironic.common.boot_devices.
set_boot_device(*args, **kwargs)[source]

Set the boot device for the task’s node.

Set the boot device to use on next reboot of the node.

Parameters:
  • task – a task from TaskManager.
  • device – the boot device, one of ironic.common.boot_devices.
  • persistent – Boolean value. True if the boot device will persist to all future boots, False if not. Default: False.
Raises:

InvalidParameterValue if an invalid boot device is specified or required ipmi credentials are missing.

Raises:

MissingParameterValue when required ipmi credentials are missing.

Raises:

IPMIFailure on an error from pyghmi.

validate(*args, **kwargs)[source]

Check that ‘driver_info’ contains IPMI credentials.

Validates whether the ‘driver_info’ property of the supplied task’s node contains the required credentials information.

Parameters:task – a task from TaskManager.
Raises:MissingParameterValue when required ipmi credentials are missing.
class ironic.drivers.modules.ipminative.NativeIPMIPower[source]

Bases: ironic.drivers.base.PowerInterface

The power driver using native python-ipmi library.

get_power_state(*args, **kwargs)[source]

Get the current power state of the task’s node.

Parameters:task – a TaskManager instance containing the node to act on.
Returns:power state POWER_ON, POWER_OFF or ERROR defined in ironic.common.states.
Raises:MissingParameterValue when required ipmi credentials are missing.
Raises:IPMIFailure when the native ipmi call fails.
get_properties()[source]
reboot(*args, **kwargs)[source]

Cycles the power to the task’s node.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:IPMIFailure when the native ipmi call fails.
Raises:MissingParameterValue when required ipmi credentials are missing.
Raises:PowerStateFailure when invalid power state is returned from ipmi.
set_power_state(*args, **kwargs)[source]

Turn the power on or off.

Parameters:
  • task – a TaskManager instance containing the node to act on.
  • pstate – a power state that will be set on the task’s node.
Raises:

IPMIFailure when the native ipmi call fails.

Raises:

MissingParameterValue when required ipmi credentials are missing.

Raises:

InvalidParameterValue when an invalid power state is specified

Raises:

PowerStateFailure when invalid power state is returned from ipmi.

validate(*args, **kwargs)[source]

Check that node[‘driver_info’] contains IPMI credentials.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:MissingParameterValue when required ipmi credentials are missing.
class ironic.drivers.modules.ipminative.NativeIPMIShellinaboxConsole[source]

Bases: ironic.drivers.base.ConsoleInterface

A ConsoleInterface that uses pyghmi and shellinabox.

get_console(*args, **kwargs)[source]

Get the type and connection information about the console.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:MissingParameterValue when required IPMI credentials or the IPMI terminal port are missing
Raises:InvalidParameterValue when the IPMI terminal port is not an integer.
get_properties()[source]
start_console(*args, **kwargs)[source]

Start a remote console for the node.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:MissingParameterValue when required ipmi credentials are missing.
Raises:InvalidParameterValue when the IPMI terminal port is not an integer.
Raises:ConsoleError if unable to start the console process.
stop_console(*args, **kwargs)[source]

Stop the remote console session for the node.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:ConsoleError if unable to stop the console process.
validate(*args, **kwargs)[source]

Validate the Node console info.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:MissingParameterValue when required IPMI credentials or the IPMI terminal port are missing
Raises:InvalidParameterValue when the IPMI terminal port is not an integer.
class ironic.drivers.modules.ipminative.VendorPassthru[source]

Bases: ironic.drivers.base.VendorInterface

bmc_reset(*args, **kwargs)[source]

Reset BMC via IPMI command.

Parameters:
  • task – a TaskManager instance.
  • http_method – the HTTP method used on the request.
  • warm – boolean parameter to decide on warm or cold reset.
Raises:

IPMIFailure on an error from native IPMI call.

Raises:

MissingParameterValue if a required parameter is missing.

Raises:

InvalidParameterValue when an invalid value is specified

get_properties()[source]
send_raw(*args, **kwargs)[source]

Send raw bytes to the BMC. Bytes should be a string of bytes.

Parameters:
  • task – a TaskManager instance.
  • http_method – the HTTP method used on the request.
  • raw_bytes – a string of raw bytes to send, e.g. ‘0x00 0x01’
Raises:

IPMIFailure on an error from native IPMI call.

Raises:

MissingParameterValue if a required parameter is missing.

Raises:

InvalidParameterValue when an invalid value is specified.

validate(*args, **kwargs)[source]

Validate vendor-specific actions.

Parameters:
  • task – a task from TaskManager.
  • method – method to be validated
  • kwargs – info for action.
Raises:

InvalidParameterValue when an invalid parameter value is specified.

Raises:

MissingParameterValue if a required parameter is missing.

Project Source

This Page