The ironic.drivers.modules.oneview.power Module

class ironic.drivers.modules.oneview.power.OneViewPower[source]

Bases: ironic.drivers.base.PowerInterface

get_power_state(task)[source]

Gets the current power state.

Parameters:
  • task – a TaskManager instance.
  • node – The Node.
Returns:

one of ironic.common.states POWER_OFF, POWER_ON or ERROR.

Raises:

OneViewError if fails to retrieve power state of OneView

resource

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

Reboot the node

Parameters:
  • task – a TaskManager instance.
  • node – The Node.
Raises:

PowerStateFailure if the final state of the node is not POWER_ON.

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

Turn the current power state on or off.

Parameters:
  • task – a TaskManager instance.
  • node – The Node.
  • power_state – The desired power state POWER_ON, POWER_OFF or REBOOT from ironic.common.states.
Raises:

InvalidParameterValue if an invalid power state was specified.

Raises:

PowerStateFailure if the power couldn’t be set to power_state.

Raises:

OneViewError if OneView fails setting the power state.

validate(task)[source]

Checks required info on ‘driver_info’ and validates node with OneView

Validates whether the ‘oneview_info’ property of the supplied task’s node contains the required info such as server_hardware_uri, server_hardware_type, server_profile_template_uri and enclosure_group_uri. Also, checks if the server profile of the node is applied, if NICs are valid for the server profile of the node, and if the server hardware attributes (ram, memory, vcpus count) are consistent with OneView.

Parameters:task – a task from TaskManager.
Raises:MissingParameterValue if a required parameter is missing.
Raises:InvalidParameterValue if parameters set are inconsistent with

resources in OneView

Project Source

This Page