ironic.drivers.modules.agent_base_vendor.
AgentDeployMixin
[source]¶Bases: ironic.drivers.modules.agent_base_vendor.HeartbeatMixin
Mixin with deploy methods.
configure_local_boot
(**kwargs)[source]¶Helper method to configure local boot on the node.
This method triggers bootloader installation on the node. On successful installation of bootloader, this method sets the node to boot from disk.
Parameters: |
|
---|---|
Raises: | InstanceDeployFailure if bootloader installation failed or on encountering error while setting the boot device on the node. |
continue_cleaning
(**kwargs)[source]¶Start the next cleaning step if the previous one is complete.
In order to avoid errors and make agent upgrades painless, the agent compares the version of all hardware managers at the start of the cleaning (the agent’s get_clean_steps() call) and before executing each clean step. If the version has changed between steps, the agent is unable to tell if an ordering change will cause a cleaning issue so it returns CLEAN_VERSION_MISMATCH. For automated cleaning, we restart the entire cleaning cycle. For manual cleaning, we don’t.
Additionally, if a clean_step includes the reboot_requested property set to True, this method will coordinate the reboot once the step is completed.
prepare_instance_to_boot
(**kwargs)[source]¶Prepares instance to boot.
Parameters: |
|
---|---|
Raises: | InvalidState if fails to prepare instance |
reboot_and_finish_deploy
(**kwargs)[source]¶Helper method to trigger reboot on the node and finish deploy.
This method initiates a reboot on the node. On success, it marks the deploy as complete. On failure, it logs the error and marks deploy as failure.
Parameters: | task – a TaskManager object containing the node |
---|---|
Raises: | InstanceDeployFailure, if node reboot failed. |
refresh_clean_steps
(**kwargs)[source]¶Refresh the node’s cached clean steps from the booted agent.
Gets the node’s clean steps from the booted agent and caches them. The steps are cached to make get_clean_steps() calls synchronous, and should be refreshed as soon as the agent boots to start cleaning or if cleaning is restarted because of a cleaning version mismatch.
Parameters: | task – a TaskManager instance |
---|---|
Raises: | NodeCleaningFailure if the agent returns invalid results |
ironic.drivers.modules.agent_base_vendor.
HeartbeatMixin
[source]¶Bases: object
Mixin class implementing heartbeat processing.
continue_cleaning
(task)[source]¶Start the next cleaning step if the previous one is complete.
Parameters: | task – a TaskManager instance |
---|
continue_deploy
(task)[source]¶Continues the deployment of baremetal node.
This method continues the deployment of the baremetal node after the ramdisk have been booted.
Parameters: | task – a TaskManager instance |
---|
deploy_has_started
(task)[source]¶Check if the deployment has started already.
Returns: | True if the deploy has started, False otherwise. |
---|
deploy_is_done
(task)[source]¶Check if the deployment is already completed.
Returns: | True if the deployment is completed. False otherwise |
---|
heartbeat
(**kwargs)[source]¶Process a heartbeat.
Parameters: |
|
---|
heartbeat_allowed_states
¶Define node states where heartbeating is allowed
in_core_deploy_step
(task)[source]¶Check if we are in the deploy.deploy deploy step.
Assumes that we are in the DEPLOYWAIT state.
Parameters: | task – a TaskManager instance |
---|---|
Returns: | True if the current deploy step is deploy.deploy. |
ironic.drivers.modules.agent_base_vendor.
log_and_raise_deployment_error
(*args, **kwargs)[source]¶Helper method to log the error and raise exception.
Parameters: |
|
---|
ironic.drivers.modules.agent_base_vendor.
post_clean_step_hook
(*args, **kwargs)[source]¶Decorator method for adding a post clean step hook.
This is a mechanism for adding a post clean step hook for a particular clean step. The hook will get executed after the clean step gets executed successfully. The hook is not invoked on failure of the clean step.
Any method to be made as a hook may be decorated with @post_clean_step_hook mentioning the interface and step after which the hook should be executed. A TaskManager instance and the object for the last completed command (provided by agent) will be passed to the hook method. The return value of this method will be ignored. Any exception raised by this method will be treated as a failure of the clean step and the node will be moved to CLEANFAIL state.
Parameters: |
|
---|---|
Returns: | A method which registers the given method as a post clean step hook. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.