Ironic SSH power manager.
Provides basic power control of virtual machines via SSH.
For use in dev and test environments.
Bases: ironic.drivers.base.ManagementInterface
Get the current boot device for the task’s node.
Provides the current boot device of the node. Be aware that not all drivers support this.
Parameters: | task – a task from TaskManager. | ||||
---|---|---|---|---|---|
Raises: | InvalidParameterValue if any connection parameters are incorrect. | ||||
Raises: | MissingParameterValue if a required parameter is missing | ||||
Raises: | SSHConnectFailed if ssh failed to connect to the node. | ||||
Raises: | SSHCommandFailed on an error from ssh. | ||||
Raises: | NodeNotFound if could not find a VM corresponding to any of the provided MACs. | ||||
Returns: | a dictionary containing:
|
Get sensors data.
Not implemented by this driver.
Parameters: | task – a TaskManager instance. |
---|
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 the boot device for the task’s node.
Set the boot device to use on next reboot of the node.
Parameters: |
|
---|---|
Raises: | InvalidParameterValue if an invalid boot device is specified or if any connection parameters are incorrect. |
Raises: | MissingParameterValue if a required parameter is missing |
Raises: | SSHConnectFailed if ssh failed to connect to the node. |
Raises: | SSHCommandFailed on an error from ssh. |
Raises: | NotImplementedError if the virt_type does not support setting the boot device. |
Raises: | NodeNotFound if could not find a VM corresponding to any of the provided MACs. |
Check that ‘driver_info’ contains SSH 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: | InvalidParameterValue if any connection parameters are incorrect. |
Raises: | MissingParameterValue if a required parameter is missing |
Bases: ironic.drivers.base.PowerInterface
SSH Power Interface.
This PowerInterface class provides a mechanism for controlling the power state of virtual machines via SSH.
NOTE: This driver supports VirtualBox and Virsh commands. NOTE: This driver does not currently support multi-node operations.
Get the current power state of the task’s node.
Poll the host for the current power state of the task’s node.
Parameters: | task – a TaskManager instance containing the node to act on. |
---|---|
Returns: | power state. One of ironic.common.states. |
Raises: | InvalidParameterValue if any connection parameters are incorrect. |
Raises: | MissingParameterValue when a required parameter is missing |
Raises: | NodeNotFound if could not find a VM corresponding to any of the provided MACs. |
Raises: | SSHCommandFailed on an error from ssh. |
Raises: | SSHConnectFailed if ssh failed to connect to the node. |
Cycles the power to the task’s node.
Power cycles a node.
Parameters: | task – a TaskManager instance containing the node to act on. |
---|---|
Raises: | InvalidParameterValue if any connection parameters are incorrect. |
Raises: | MissingParameterValue when a required parameter is missing |
Raises: | NodeNotFound if could not find a VM corresponding to any of the provided MACs. |
Raises: | PowerStateFailure if it failed to set power state to POWER_ON. |
Raises: | SSHCommandFailed on an error from ssh. |
Raises: | SSHConnectFailed if ssh failed to connect to the node. |
Turn the power on or off.
Set the power state of the task’s node.
Parameters: |
|
---|---|
Raises: | InvalidParameterValue if any connection parameters are incorrect, or if the desired power state is invalid. |
Raises: | MissingParameterValue when a required parameter is missing |
Raises: | NodeNotFound if could not find a VM corresponding to any of the provided MACs. |
Raises: | PowerStateFailure if it failed to set power state to pstate. |
Raises: | SSHCommandFailed on an error from ssh. |
Raises: | SSHConnectFailed if ssh failed to connect to the node. |
Check that the node’s ‘driver_info’ is valid.
Check that the node’s ‘driver_info’ contains the requisite fields and that an SSH connection to the node can be established.
Parameters: | task – a TaskManager instance containing the node to act on. |
---|---|
Raises: | InvalidParameterValue if any connection parameters are incorrect or if ssh failed to connect to the node. |
Raises: | MissingParameterValue if no ports are enrolled for the given node. |
Bases: ironic.drivers.base.ConsoleInterface
A ConsoleInterface that uses ssh and shellinabox.
Get the type and connection information about the console.
Parameters: | task – a task from TaskManager |
---|---|
Raises: | MissingParameterValue if required ssh parameters are missing |
Raises: | InvalidParameterValue if required parameter are invalid. |
Start a remote console for the node.
Parameters: | task – a task from TaskManager |
---|---|
Raises: | MissingParameterValue if required ssh parameters are missing |
Raises: | ConsoleError if the directory for the PID file cannot be created |
Raises: | ConsoleSubprocessFailed when invoking the subprocess failed |
Raises: | InvalidParameterValue if required parameters are invalid. |