The ironic.drivers.modules.oneview.power
Module¶
-
class
ironic.drivers.modules.oneview.power.
OneViewPower
[source]¶ Bases:
ironic.drivers.base.PowerInterface
-
get_power_state
(*args, **kwargs)[source]¶ Gets the current power state.
Parameters: task – a TaskManager instance. Returns: one of ironic.common.states
POWER_OFF, POWER_ON or ERROR.Raises: OneViewError if fails to retrieve power state of OneView resource
-
reboot
(*args, **kwargs)[source]¶ Reboot the node
Parameters: task – a TaskManager instance. 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.
- 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
(*args, **kwargs)[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. It validates if the node is being used by 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 Raises: InvalidParameterValue if the node in use by OneView. Raises: OneViewError if not possible to get OneView’s information for the given node, if not possible to retrieve Server Hardware from OneView.
-