Merge "Document how to implement a new deploy step"
This commit is contained in:
commit
1ca9d154dd
@ -33,6 +33,11 @@ is a higher priority. If the same priority is used by deploy steps on different
|
|||||||
interfaces, the following resolution order is used: Power, Management, Deploy,
|
interfaces, the following resolution order is used: Power, Management, Deploy,
|
||||||
BIOS, and RAID interfaces.
|
BIOS, and RAID interfaces.
|
||||||
|
|
||||||
|
Writing a Deploy Step
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Please refer to :doc:`/contributor/deploy-steps`.
|
||||||
|
|
||||||
FAQ
|
FAQ
|
||||||
===
|
===
|
||||||
|
|
||||||
|
62
doc/source/contributor/deploy-steps.rst
Normal file
62
doc/source/contributor/deploy-steps.rst
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
Developing a new Deploy Step
|
||||||
|
============================
|
||||||
|
|
||||||
|
To support customized deployment step, implement a new method in an interface
|
||||||
|
class and use the decorator ``deploy_step`` defined in
|
||||||
|
``ironic/drivers/base.py``. For example, we will implement a ``do_nothing``
|
||||||
|
deploy step in the ``AgentDeploy`` class.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class AgentDeploy(AgentDeployMixin, base.DeployInterface):
|
||||||
|
...
|
||||||
|
|
||||||
|
@base.deploy_step(priority=200, argsinfo={
|
||||||
|
'test_arg': {
|
||||||
|
'description': (
|
||||||
|
"This is a test argument."
|
||||||
|
),
|
||||||
|
'required': True
|
||||||
|
}
|
||||||
|
})
|
||||||
|
def do_nothing(self, task, **kwargs):
|
||||||
|
return None
|
||||||
|
|
||||||
|
After deployment of the baremetal node, check the updated deploy steps::
|
||||||
|
|
||||||
|
openstack baremetal node show $node_ident -f json -c driver_internal_info
|
||||||
|
|
||||||
|
The above command outputs the ``driver_internal_info`` as following::
|
||||||
|
|
||||||
|
{
|
||||||
|
"driver_internal_info": {
|
||||||
|
...
|
||||||
|
"deploy_steps": [
|
||||||
|
{
|
||||||
|
"priority": 200,
|
||||||
|
"interface": "deploy",
|
||||||
|
"step": "do_nothing",
|
||||||
|
"argsinfo":
|
||||||
|
{
|
||||||
|
"test_arg":
|
||||||
|
{
|
||||||
|
"required": True,
|
||||||
|
"description": "This is a test argument."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"priority": 100,
|
||||||
|
"interface": "deploy",
|
||||||
|
"step": "deploy",
|
||||||
|
"argsinfo": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"deploy_step_index": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Similarly, clean steps can be implemented using the ``clean_step``
|
||||||
|
decorator.
|
@ -65,6 +65,7 @@ the developer community about any implementation using this functionality.
|
|||||||
Writing "vendor_passthru" methods <vendor-passthru>
|
Writing "vendor_passthru" methods <vendor-passthru>
|
||||||
Creating new BIOS interfaces <bios_develop>
|
Creating new BIOS interfaces <bios_develop>
|
||||||
Third party continuous integration testing <third-party-ci>
|
Third party continuous integration testing <third-party-ci>
|
||||||
|
Writing Deploy or Clean Steps <deploy-steps>
|
||||||
|
|
||||||
Testing Network Integration
|
Testing Network Integration
|
||||||
---------------------------
|
---------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user