Commit Graph

31 Commits

Author SHA1 Message Date
ramishra 35c509602e Remove all mistral actions from tripleo-common
This removes dependency with msitral-lib.

Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/778018
Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/777950
Change-Id: I3c94845b2aa484ac7b4e8f444509ceac40fa289d
2021-03-01 21:27:08 +05:30
ramishra 0b8717e0c8 Cleanup dead mistral actions and workbooks
- Removes unused mistral actions
- All mistral workbooks
- Custom filter for undercloud nova
- mistral entry points as we don't have mistral

Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/775749
Change-Id: I7f826da829bbc7d7a4fcde8afcea3f61742a316a
2021-02-17 20:32:01 +05:30
Sorin Sbarnea 4db1e72654 pylint: fixed conditions
Change-Id: I0e6bcebca55d89bdfb59944bf91f4f9949c95562
2021-01-11 17:14:06 +05:30
Dougal Matthews 3577e31b39 Split the action logic from the run method
This makes it easier to re-use this code externally as we don't need to
construct a Mistral context. We can instead pass in the Python clients.

Related-Bug: #1835230
Change-Id: Ia81fadfbca97cf887f857ef196af013747f4ce43
2019-11-04 12:41:30 +00:00
Derek Higgins 08b89e6c82 Stop setting boot_option=local on ironic nodes
This is now the default in ironic on tripleo and
redundant.

Change-Id: I249a1a9e30c06ea15b487e952b91949c606423c5
Depends-On: Ib793acc98641091bcde2580b725656976e5d6625
Related-Bug: #1803965
2018-11-19 16:05:07 +00:00
Zuul eb9f2f72c8 Merge "Add support for rescue mode in enrollment and node configuration workflows" 2018-05-03 16:02:41 +00:00
Zuul 3e538dac92 Merge "Use scheduler hints in derived_parameters workflow" 2018-05-03 15:53:34 +00:00
Alan Bishop e25e8564a4 Use scheduler hints in derived_parameters workflow
Update the tripleo.derive_params.v1.derived_parameters workflow to use
scheduler hints associated with a given role. The scheduler hints are
used to identify overcloud nodes associated with the role, and take
precedence over nodes identified by their profile/flavor. If a role does
not specify any scheduler hints then the workflow falls back to matching
nodes by profile/flavor.

Add a tripleo.baremetal.v1.nodes_with_node_id workflow that searches
for ironic nodes matching a node placement regex. This workflow is
analogous to the existing nodes_with_profile workflow that searches
for nodes that match a given profile.

Add a tripleo.baremetal.get_node_id Mistral action that returns the node
placement ID (e.g. "controller-0") for a given node, or None if a node
ID is not defined. This is analogous to the existing get_profile action
that returns the profile assigned to the node.

Fix the 'message' published when a derived parameter sub-workflow fails
so it just returns the sub-workflow 'message' and not the entire sub-
workflow result. The 'message' portion is the only part that is meaningful
to the user.

Closes-Bug: #1760659
Change-Id: I7eff355620aecaca49e77112ba491a5f3ce2eed6
2018-04-05 08:22:25 -04:00
Harald Jensås 4603ef678f Enrich integration with ironic networking features
The mac key in nodes_json is deprecated, replaced with
"ports" key. New ports key is list of dicts holding a
richer data set matching the properties of ports in the
Bare Metal service api. In addition to mac address the
physical_network and local_link_connection can be
defined for Bare Metal ports when registering nodes.

* address: (mandatory)
  The physical address (mac address) of the port.
* physical_network: (otional)
  Defaults to: ctlplane
* local_link_connection: (optional)
  This data enables the possibility for automatic
  configuration of switches via neutron plugins. e.g
  ML2 vendor plugins. Defaults to: None

Implements: enrich-ironic-networking-integration
Change-Id: I74d4178dbb0cfe8c934ce15e3e7c9bb1c469de10
2018-03-26 13:18:26 +02:00
Dmitry Tantsur 1e6fa0bfb0 Add support for rescue mode in enrollment and node configuration workflows
Change-Id: Ifed82bb0bc6bdfbfe5c89454187f00f347e5be45
Implements: blueprint ironic-rescue
2018-03-22 16:02:56 +01:00
Dmitry Tantsur c68cf6b10e Take wwn_with_extension into account, when configuring a boot device
Sometimes wwn is not enough to identify a device, and a vendor extension
has to be used. The wwn_with_extension field contains both, as it has
to be tried first.

Change-Id: Idf0ed93c8247d872735a4b49f7a6390c71514430
Closes-Bug: #1720780
2017-10-02 14:23:24 +02:00
Dmitry Tantsur be69f375b4 Add workflow for IPMI nodes discovery
New workflow discover_nodes works by trying to log into given IP addresses
with given set of credentials.

New workflow discover_and_enroll_nodes uses results of the previous workflow
to create new nodes and optionally move them to manageable.

Implements blueprint node-discovery-by-range

Change-Id: I158f0b8f5251d9d94e7e57b3fe24362316d26599
2017-07-19 09:38:48 +02:00
Adriano Petrich 76b3e025b7 use Result from mistral_lib instead of mistral
This is part of the ongoing change to remove the mistral
dependency from tripleo-common and use mistral_lib instead

In order to do that we are using the Result class from mistral_lib

Change-Id: I59ce8c6d68de9e9719d84cbaa82462fbd8d647e2
Depends-on: Icc0036bae3c969112f2f67c4a8264bae18f3cc73
2017-06-23 14:20:45 +01:00
Adriano Petrich fbfe481ee4 move mistral base action dependency to mistral_lib
mistral_lib base TripleoAction has a context in the run method
signature. These changes remove the mistral.context and make use
of the one provide by the default executor

Change-Id: Ib1a5aa8d5735b05f5308dc943ac088b5eeeec253
2017-05-17 23:51:05 +01:00
Jenkins 93558ac4e2 Merge "Workflow to select nodes matching a profile/role" 2017-04-21 17:37:38 +00:00
Steven Hardy e38bcc9f09 Workflow to select nodes matching a profile/role
As a first step to enabling parameter calculation based on introspection
data, we'll need to find the available nodes matching a particular role
(which is associated with a flavor, which matches a specific profile in
ironic).

The next step is to retrieve the introspection data for each node output
from this workflow, then define another workflow that does the
transformation between introspection data and parameters.

Partially-Implements: blueprint tripleo-derive-parameters
Change-Id: I4b13f2923caa055be979eda57f9d5009960d61ef
2017-04-10 20:45:54 +05:30
Dmitry Tantsur 53b48a3030 Validate nodes_json before trying to register or updates any nodes
This is a replacement for terribly outdated "validate instackenv"
command in tripleoclient. Does some basic sanity checks not involving Ironic.
Reuses as much registration logic as possible.

Change-Id: I262b718d29f2a91e390a183adbd8df6a242ce42f
2017-03-08 17:31:27 +01:00
Oliver Walsh f6c286dbe8 Fix race in undercloud cell_v2 host discovery
Ensure that the ironic nodes have been picked up by the nova resource tracker
before running nova-manage cell_v2 host discovery.

Also adds logging of the verbose command output to mistral engine log.

Change-Id: I4cc67935df8f37cdb2d8b0bfd96cf90eb7a6ce25
Closes-Bug: #1660160
2017-02-01 13:56:58 +00:00
Jenkins 54e51b0e6f Merge "Convert exceptions to strings when passing them to the Result class" 2016-12-13 12:57:11 +00:00
Dougal Matthews 0aee2ceb3c Convert exceptions to strings when passing them to the Result class
The Mistral Result class expects the error property to be either a
string or a dict. Other types, like exceptions, can cause errors in
mistral which in turn cause a critical failure. See the Mistral bug
report: https://bugs.launchpad.net/mistral/+bug/1645295

This change also updates one use of the Result class that doesn't use
kwargs.

Change-Id: Ia93f298e5181bae92d7a08468d33c255d38b996a
Closes-Bug: #1645296
2016-11-28 13:15:18 +00:00
Dougal Matthews 9d3d03436a Remove the underscore from the base action client methods
The underscore typically designates these methods as private, but
they are intended to be used by any/all of the subclasses. This
change clarifies the API.

Change-Id: I4dc95a0e1f84570b184f8b75f51a2c1456909fb9
2016-11-28 13:09:38 +00:00
Dougal Matthews b771918bba Use kwargs to pass in data and error to Mistral Result
This standardises how we create mistral.workflow.utils.Result instances.
Previously we used a combination of passing empty strings or None values
to pass errors only. Using kwargs makes this clearer and cleaner. This
is also means we use the Result class in the same way as the builtin
Mistral actions.

Change-Id: Ic94c0513b1fba030de70263ac1df32b4ab130e9a
2016-11-23 13:14:26 +00:00
Dmitry Tantsur a2e6c7d603 Remove unused bits from node management code in utils/node.py
* Removed set_nodes_state and wait_for_provision_state functions
  as this code was moved to workflows
* Removed "provide", "keystone_client" and "blocking" arguments and
  default value for "client" argument from register_all_nodes.
* Removed "blocking" argument and default value for "client" argument
  from register_ironic_node.

Change-Id: I23896b649958fdabf5cc0e2488101e56c4d5b313
Related-Bug: #1637310
2016-11-08 17:32:29 +01:00
Ana Krivokapic 30d023702a Support node untagging
The tag_nodes workflow now takes two lists of nodes: nodes to tag, and
nodes to clear, and of course a role.  First, the workflow tags nodes
with a role, then it clears the other node tags, and finally it updates
the role count.

Calling update_node_capability with a value of None will clear the tag
from the node.

Change-Id: I1e2988297d56fb4726cd3cae79e79dda889471e1
Closes-bug: #1625264
Co-Authored-By: Honza Pokorny <hpokorny@redhat.com>
2016-10-05 09:50:23 -03:00
Derek Higgins f5fce80783 Don't set node state during node registration
The state is being set in "manageable" later in the workflow and
then to available when tripleoclient calls the "provide" workflow.

Change-Id: I42164d57ec37ad666698f9757f7eeab45f01cbcd
Closes-Bug: #1628935
2016-09-29 15:14:36 +01:00
Dougal Matthews 7d8c9acde4 Remove the unused service_host arg from node registration
Change-Id: Icc627c245e8b6aafb12c90fc42564e36f4370bf3
Depends-On: Ide8b7753829170f503ef962b4ad4fde388cbb0ba
2016-09-27 07:05:28 +00:00
Honza Pokorny 15c97e63c0 Add node tagging workflow
Co-Authored-By: Ana Krivokapic <akrivoka@redhat.com>
Implements: blueprint assign-nodes-workflow
Change-Id: I7c148f55b76caa1e6fba64af063de82f8064be65
2016-09-16 20:50:04 +00:00
Julie Pichon cbe0dbf32d Add Mistral action & workflow for root device configuration
The root device configuration code and unit tests come from the
python-tripleoclient project. By moving them into a common Mistral
action, they can be reused by other clients like the UI. The workflows
will also be used for the new 'overcloud node configure' command in the
client.

Change-Id: I5ba0a3710012c44822dd3b8e69662bbef04d3787
Related-Bug: #1595205
2016-08-25 20:07:56 +01:00
Julie Pichon a9c8ffb655 Add Mistral action for boot configuration
The boot configuration code mainly comes from the python-tripleoclient
project. By moving it into a common Mistral action, it can be reused by
other clients like the UI. This will also be used for the new
'overcloud node configure' command in the client.

Change-Id: Ica936fb96cfca025b3cc29edb2cc81f2170ae4ed
Related-Bug: #1595205
2016-08-25 20:07:55 +01:00
Julie Pichon aaecd1c968 Add boot option argument to the Node Registration Mistral workflow
This adds the 'instance-boot-option' parameter present in "openstack
baremetal import" to the workflow and sets it to the same default. This
is the first step for moving out some client code that belongs better
here [1].

[1] http://git.openstack.org/cgit/openstack/python-tripleoclient/tree/tripleoclient/v1/baremetal.py?id=defa3f3dbd17a40dbfd86a8e76426cca3cd46ef8#n213

Change-Id: Iea9b7f3b49f99f810ce759f65b45b88c1c40f010
Related-Bug: #1595205
2016-08-25 20:07:55 +01:00
Dan Prince 3397094dde Add RegisterNodesAction action
This patch adds a custom wrapper around the tripleo-common
utils/nodes.py register_all_nodes function so that we can
call it in a workflow to help register nodes.

Co-Authored-By: Ryan Brady <rbrady@redhat.com>
Co-Authored-By: Dougal Matthews <dougal@redhat.com>

Change-Id: Ibd5b2f12b453b70c54272e43ae31195895bd4a20
Depends-On: I17116c0f995ab76ed79bd8b2df57629c1ed4e4d0
2016-06-18 19:36:47 -04:00