Commit Graph

31 Commits

Author SHA1 Message Date
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
Gael Chamoulaud 8ea44dbd94 Remove Validations Mistral Workflows
This patch removes the following Validations workflows:
- tripleo.validations.list_groups
- tripleo.validations.list_validations
- tripleo.validations.run_validation
- tripleo.validations.upload

The following workflows still remain in charge and will be migrated
in a follow up patch:
- tripleo.validation.get_pubkey
- tripleo.validation.get_privkey
- tripleo.validation.enable

Depends-On: https://review.rdoproject.org/r/#/c/23700/
Change-Id: Ie36926e47cc46d5852a098f9e583169e7b1dcd7d
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2020-06-22 13:29:43 +00:00
Rabi Mishra f27d6bebe8 Remove upload_validations workflow and related action
Its only usage was remved in https://review.opendev.org/#/c/694287/.
That patch incorrectly mentions that it's removed from
tripleo-common.

Task: #38839
Change-Id: I491aac723d58426b912c1b51873421b7077ed9da
2020-02-21 09:52:47 +05:30
Gael Chamoulaud 5762772fdf Make validation inputs configurable via Mistral
The validations have certain values (e.g. the amount of RAM necessary
for the undercloud node) configurable, but these were not exposed
through Mistral.

This adds a new `--inputs` parameter to the `run-validation` script
which takes a path to a YAML or JSON file with the additional
inputs (i.e. Ansible extra-args) defined.

And the `run_validation` action now optionally takes an `inputs`
dictionary which gets passed to `run-validation`.

Closes-Bug: #1625547
Implements: blueprint validation-framework
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>

Change-Id: I8944cf7133d47869d26974fd123cd93c98425f17
Co-authored: Tomas Sedovic <tsedovic@redhat.com>
2019-04-01 10:43:11 +00:00
Florian Fuchs ec26073d14 Fix validation runs in a containerized environment
This fix addresses the following issues:
- No validations user present in the mistral-executor container
- The ssh_keys environment isn't initially created

Change-Id: I53078723b0995d6cd9590f119b28a7ca2b95dafd
Closes-Bug: #1789886
2018-08-31 22:24:59 +02:00
Ana Krivokapic 8f88e78778 Add support for custom validations
This patch introduces support for running custom validations by changing
the behavior of the validations actions ListValidationsAction,
ListGroupsAction and RunValidationAction.

Until now, these actions sourced validations from a directory on disk.
Now, these action are sourcing validations from the plan container
subdirectory (custom validations), or, if this is not available, from
the Swift container holding the default validations.

Change-Id: I9e9131b355312c53f12d154976d5d9cd706cc338
Implements: blueprint custom-validations
Depends-On: I338e139fa770ebb7bdcc1c0afb79eec062fada8b
2018-08-10 11:21:29 +02:00
Brad P. Crochet 05a84782c4 Remove validations that moved to tripleo-validations
These validations are now in tripleo-validations, implemented in
Ansible. These can be removed from workflows.

Change-Id: I27121bac81c6e90004bb1b8b20b92bb2075b1303
Implements: blueprint workflow-move-validations
Depends-On: Id5c0692e3a1d3f551dcd55822de968ca8753a4eb
2018-06-28 09:09:27 -04:00
Ana Krivokapic 2b6204f1d8 Add an action to upload validations to Swift
This will be used to upload validations to Swift on undercloud deploy.

Implements: blueprint store-validations-in-swift

Change-Id: Ia08d5eea17450db94279c95078453831c0017a67
2018-05-18 17:19:29 +02:00
Jiri Stransky 8ceb4e2b78 Fix broken validations on stack update
Patch I3be30ed8bb61d8ed514991a2f55c5c4e36c56411 fixed a confusing
message on initial deploy (bug #1703942) but broke stack update for
cases when there are no extra free nodes available (even though they
are not needed).

This patch reverts the earlier one and fixes the confusing message in
an alternative way -- we first validate available node count (a
validation for this already exists), and only if it succeeds we
proceed to validate the availability of nodes matching particular
flavors.

Change-Id: I91ddc03e5ac22494f5276f08f87011074483d5c6
Closes-Bug: #1745997
Related-Bug: #1703942
2018-02-23 13:35:21 +01:00
Mark Hamzy 6d3ce6329d Add error message if no bare metal nodes available
Change-Id: I3be30ed8bb61d8ed514991a2f55c5c4e36c56411
Closes-Bug: 1703942
2017-07-18 16:09:56 +00: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
Juan Antonio Osorio Robles bc66ed96c7 Write action to get private key from the validations keypair
Currently there's only the action to get the public key, however
it's useful to get the private key as well. For instance, in cases
where we're using an ansible playbook. This way, we can use the
existing utilities to copy the public keys to the nodes, and then
use the private key for running ansible.

Change-Id: Ia44651d3d5908fa7ecd7e7ea2e288f4fe9faa7cf
2017-06-20 06:45:40 +00: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
Brad P. Crochet 6d487c39fd Move the gathering of flavors into the CollectFlavors action
The imported actions from Mistral (namely, the nova.flavors_list)
will return dictionaries. The nova api returns a Flavor, which has
additional methods (get_keys) that have further properties that are
not returned in the main api call. This works around that.

Change-Id: I3ac99bc5abbae62bfc4352db708e25f5fa551095
Closes-Bug: #1685177
2017-04-28 09:14:43 -04:00
Brad P. Crochet d4517cd9cd Implement check node counts as a custom action
Adds a custom action to check the statistics of the hypervisors and
check the node counts of the stack.

Change-Id: I4a0576801ffbf8d29135966d7181f277ad2f8db0
Partial-Bug: #1638697
2017-04-11 08:29:19 -04:00
Brad P. Crochet 65a1e19a6d Implement verify profiles as a custom action
Adds a custom action to verify the number of nodes with proper profiles
exist in the baremetal inventory.

Change-Id: If6460877188af4d006df5f75ab5a921b411088e2
Partial-Bug: #1638697
2017-04-11 08:29:18 -04:00
Brad P. Crochet f6f1ac9838 Implement check ironic boot configuration as a custom action
Add a custom action and workflow for checking the configuration of the
available Ironic nodes.

Change-Id: I74d1c242d0d06c5aff8f6d3533399745d6d8d9f3
Partial-Bug: #1638697
2017-04-11 08:29:17 -04:00
Brad P. Crochet c33b81aa31 Implement check flavors as a custom action
Adds a custom action to check the flavors passed against the defined
flavors.

Change-Id: Ia0751ec4c63692ceda97d3845edcde1c26f9a3a8
Partial-Bug: #1638697
2017-04-08 07:23:38 -04:00
Brad P. Crochet bc99748ff0 Implement check boot images as a custom action
Adds a custom action to check the status of the boot images in glance.

Change-Id: I3e16989a788177c4fb5b102d280d212a2c8f754b
Partial-Bug: #1638697
2017-04-08 07:23:38 -04:00
Oliver Walsh 5f136811d6 Add MigrationSshKey to generated passwords
This reuses the existing password generation mistral action to generate an ssh
keypair to be used for nova cold migration

Paramiko is used to generate the ssh key, based on the existing approach in the
nova keypair api.

Also update validation ssh key generation to reuse the same method.

Change-Id: I9e7a1862911312ad942233ac8fc828f4e1be1dcf
2017-04-03 09:22:10 +01:00
Ana Krivokapic 59e79c1cea Fix class constructors
Some constructor methods were missing the super call to the parent
class. This change adds the missing calls.

Some constructor methods only had the super calls to the parent class,
which makes them redundant. This change removes those methods.

Change-Id: I3bdda1a1f1bcfa19d166b994d3d3ae2218b95c43
2017-01-27 12:40:09 +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
Jenkins 6f3095bf1b Merge "Handle missing mistral environment" 2016-09-19 09:09:52 +00:00
Tomas Sedovic 653d8a4b12 Run copy_ssh_keys after overcloud finishes
This introduces a new action that indicates whether the validations are
enabled. And we update the deployment workflow to upload the validation
SSH keys on the overcloud nodes if the validations are enabled.

Change-Id: I3bb61f5e09fb55888ea8222a1daeedaed6105ff5
Closes-Bug: #1621047
2016-09-09 11:48:11 +02:00
Martin André 8ff8e560be Handle missing mistral environment
Catch the mistralclient.api.base.APIException error that is raised when
the requested environment doesn't exist and report error to workflow so
it fails gracefully.

Change-Id: Ied6e193cff1d2111c1d8c37dcd38fc98733e63d6
Closes-Bug: #1620493
2016-09-06 13:57:07 +02:00
Martin André 778f8b2fae Fix error when identity file is missing
When the ssh_keys mistral environment was not present or missing the
'private_key' variable the RunValidationAction would fail with
UnboundLocalError.

This commit makes sure the identity_file variable is assigned before
being referenced in the finally block.

Change-Id: I60507fb0589127ca7dd9e8490f14edf558e994e6
Closes-Bug: #1620476
2016-09-06 08:51:43 +02:00
Martin André 16cdf9cf36 Allow running validation against different plans
This commit adds support for selecting plan (overcloud) against which
to run validations, configurable with the `plan` variable in relevant
mistral actions.

The `run-validation` wrapper now accept the plan name as a second
argument and pass it to Ansible dynamic inventory script via
TRIPLEO_PLAN_NAME variable. The default plan remains `overcloud`.

Change-Id: Icebf91360f387d7f558c2b5a6a5a4decb5a89093
2016-08-29 13:56:49 +02:00
Martin André d43f124804 Workflows to run validations
This commit adds a workflow to run ansible validations.

Validations can be run individually or by group, and the result is sent
over the specified zaqar queue.

Change-Id: Iba8b210c83e94eaa340d34e17ad2b0278ecc4e53
Depends-On: I807fed12e9a42a71c130f393370ff4152831c27b
2016-08-29 13:56:49 +02:00
Martin André ceecdadbf4 Workflows to load validations
This commit adds workflow to list available validations and validation
groups.

Change-Id: I85fb6c1939e711887b2ee91c9cefa41a3da681a3
2016-08-29 13:56:49 +02:00
Martin André c31ed3db3b Workflow to setup validations
The new tripleo.validations.v1.copy_ssh_keys workflow copies the
provided public key to the overcloud nodes in preparation for running
ansible validations.

When no public key exists, a new one will be generated and stored in
a dedicated mistral environment.

Change-Id: I93972b34186ac3aaf54fa6aebd14bf48b5247266
2016-08-25 16:19:49 +02:00