Commit Graph

59 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
Kevin Carter 5d940effe7 Remove invalid mistral envocation and references
This change removes the use of a mistral workflow from our deployment process
which assertains the ansible deployment status. This is being removed because
deployments are not longer executed via mistral so any data provided by mistral
would be wrong.

This change also removes the mistral workflow reference in our documentation
strings so it does not confuse folks maintaining the code.

Story: 2007212
Task: 38962
Task: 38961

Change-Id: I94fed2dd4968879d0ac3ea775dd498de20b78130
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-04-08 13:05:42 +00:00
Rabi Mishra 438be97dce Remove GenerateFencingParametersAction and CreateContainerAction
These are not used anymore. Moves the plan container creation
tests to utils.

Change-Id: Iaaf4e58f44d82a6af67c08a08df1c8a6bac2c49e
2020-04-03 12:47:25 +05:30
Rabi Mishra c09343933c Move ListRolesAction functionality to utils
This moves ListRolesAction functionality to utils and also
adds a flag to filter only valid roles.

Change-Id: I04a653c04459768d0af48687fc025e2f602fb0ba
2020-03-30 11:55:17 +05:30
Rabi Mishra 903e3497d7 Move plan container creation to utils
Moves the logic from the custom action to utils. Once we have a
new tripleo-common release, we can get rid of the action by
calling the util method directly from python-tripleoclient.

Change-Id: Ib0b0a95dbad8a79e850ba079774491ab433bf674
2020-02-20 10:40:29 +05:30
Rabi Mishra af5931f01b Remove unused tripleo.networks.v1 workbook
Not used in python-tripleoclient, possibly was there for
tripleo-ui. It also removes the related tripleo.plan.update_networks
action plugin.

Task: 38596
Task: 38597
Change-Id: I98a0071e8b9abdd9ccd6205eb109204d293177c8
2020-02-01 17:58:34 +05:30
Dougal Matthews f22413ebab Remove the unused tripleo.plan.update_from_dir Mistral action
This action was unused and untested.

Change-Id: Id26f594a16745993c83b493994b340ac861805f3
2019-09-09 07:38:29 +00:00
Dougal Matthews 6cb8048a25 Remove the unused tripleo.plan.update_plan_environment Mistral action
This action isn't used or tested.

Change-Id: Iaa57ce63e2ec9b3c72312500f53f35d3ca1a2849
2019-09-09 07:38:04 +00:00
Dougal Matthews 2ec71e3a53 Remove the unused tripleo.plan.gather_roles Mistral action
Change-Id: I19f4b2a789a5e0996b18afa52d7a8443964f6e1f
2019-08-22 09:21:47 +01:00
Alex Schultz 550537acf4 Handle swift interactions are strings as necessary
To properly handle the differences between python2/python3 we need to
ensure that when we interact with swift and are dealing with string data
that we handle the types correctly. This change adds a swift utils
helper to call to get the string data from an object out of swift. For
example our json and yaml files are all strings so if we try to use
something like json.dumps() from data we pull from swift, it errors
because we're given a bytes like object in python3.

Change-Id: I7996cc08cdd3bddf3f4ba0fb2e48f926f944c0dd
Related-Blueprint: python3-support
2019-03-01 15:45:56 -07:00
Thomas Herve e3bcc2440a Don't resolve Heat stack output when unnecessary
Retrieving the overcloud stack with its outputs is expensive for Heat,
let's skip it where we can.

Change-Id: Ifacdff939f7a8dedbcf2685595ebeb9340af092a
2018-10-30 09:23:22 +01:00
Alex Schultz b02e32964b Revert "Use swift bulk-delete when deleting a plan"
This reverts commit f6891826c9.

Change-Id: I8de39d5f9ce4c64fa3327ca45a7abcbe774852c0
Closes-Bug: #1791120
2018-09-10 21:06:50 +00:00
Dan Prince f6891826c9 Use swift bulk-delete when deleting a plan
Deleting swift containers (plans) with large numbers of files can
take longer than we'd like.

This patch uses the SwiftService API which contains an implementation
of bulk delete used by the swift CLI which speeds up delete operations.

Change-Id: I8362a7986e2e4ff0aecaf867faf47c24b658d15b
Closes-bug: #1615825
2018-08-29 07:10:41 -04:00
Martin André 025905d5bd Delete messages container on plan deletion
The new config-download workflow creates a XXX-messages swift container
to persist the zaqar messages for the UI to consume. We should delete
the container when the plan is removed.

Implements: blueprint config-download-workflows
Change-Id: Iff21b810faafad2a0920bf1e7218c39270b7ab88
2018-06-14 17:00:29 +02:00
Steven Hardy 0fa557c40c UpdatePlanEnvironmentAction enable overwrite or merge
Currently it's only possible to merge which doesn't work well
for non dict keys, and probably isn't what we want when updating
e.g the list of environments from the CLI.

Co-Authored-By: Mike Fedosin <mfedosin@redhat.com>

Change-Id: I0f32ca1029430579312b9130eccebe2bf7d1db56
2018-06-11 15:40:17 +00:00
Zuul a2bd0dcd26 Merge "Update swift plan in UpdatePlanEnvironmentAction" 2018-06-08 19:53:08 +00:00
Zuul 1624d8f79f Merge "Remove no-ops from user-env too" 2018-05-04 16:37:12 +00:00
Carlos Camacho 13f2704c8e Allow uploading big files to swift (5GB)
This patch enables the swift upload for big files (+5GB)
in TripleO.
Also, adds support to the undercloud backup CLI to upload
big backups to swift.

Change-Id: I80163c8df15377dd3b5a44b5439a23223d8cccee
Depends-On: Iff73833f1d470750862873f70a4a9aaba50bd164
Closes-Bug: 1761412
2018-04-23 16:48:30 +02:00
Steven Hardy 4c215518fe Update swift plan in UpdatePlanEnvironmentAction
Currently this doesn't update anything, despite the name,
possibly something got lost in translation when we moved
the plan data to swift.

Change-Id: I7c43a67e6a7f8123e60f9ab6f333e1fc54f5ed64
Closes-Bug: #1754103
2018-04-11 09:23:09 +01:00
Zuul 9aad28b691 Merge "Deprecates tripleo.roles.list action" 2018-04-09 16:01:10 +00:00
Ryan Brady 29d5b5aa8f Deprecates tripleo.roles.list action
The tripleo.roles.list action is deprecated.  Please use the
tripleo.plan_management.v1.list_roles workflow instead.  Calling actions
directly is no longer supported.

This patch adds a deprecation notice to the action code, the file
where the action is registered and an associated release note.

Change-Id: I233be93b5a22008fbbfae8a49f24c3a79b9e2df2
2018-04-06 09:45:08 -04:00
Jiri Stransky 5b98699b18 Remove no-ops from user-env too
Only removing them from plan-env could get the no-ops re-inserted by
accident from user-env on next plan update, if the next plan-update
action would be done with user-env persistence (any of update/upgrade
operations).

Change-Id: Ib9cfff3e38cb05ffe03b6ba06498d0655119b97d
Closes-Bug: #1761499
2018-04-05 15:12:52 +02:00
Mathieu Bultel a40f1517a4 Check if plan_env has resource_registry key
To avoid keyerror failure is the plan_env has no
resource_registry element.

Change-Id: I4310a90a087d33f504850e456eac47f97ce66aff
2018-03-22 15:54:39 +01:00
Mathieu Bultel 426f4aa6d8 Remove the noop deploystep for upgrade converge step
The noop deploystep is set during the prepare step for
upgrade. It put in the plan_env directly, so since we are
keeping the user-env / plan-env for upgrade the noop
steps are never removed.
This patch aim to trigger a mistral action to remove all
the OS::Heat::None for the deploystep/pre/post

Change-Id: If7eb342a84b530b07db513146e85916f2d5c1370
2018-03-13 21:59:43 +01:00
Michele Baldessari 28751a5048 Fix overcloud export plan
Currently exporting the plan for the overcloud gives us (note the
spurious 3600 argument there):
(undercloud) [stack@undercloud t]$ openstack overcloud plan export overcloud
Exporting plan overcloud...
Started Mistral Workflow tripleo.plan_management.v1.export_deployment_plan. Execution ID: 19da7423-ff44-4785-9f1f-237289b60dda
Error while creating a tarball: Unexpected error while running command.
Command: /usr/bin/tar -C /tmp/tmpiBEE9d 3600 /tmp/tmpOST_qM --exclude .git --exclude .tox --exclude *.pyc --exclude *.pyo .
Exit code: 2
Stdout: u''
Stderr: u"/usr/bin/tar: You must specify one of the `-Acdtrux' or `--test-label' options\nTry `/usr/bin/tar --help' or `/usr/bin/tar --usage' for more information.\n"
Exception exporting plan: Error while creating a tarball: Unexpected error while running command.
Command: /usr/bin/tar -C /tmp/tmpiBEE9d 3600 /tmp/tmpOST_qM --exclude .git --exclude .tox --exclude *.pyc --exclude *.pyo .
Exit code: 2
Stdout: u''
Stderr: u"/usr/bin/tar: You must specify one of the `-Acdtrux' or `--test-label' options\nTry `/usr/bin/tar --help' or `/usr/bin/tar --usage' for more information.\n"

The reason is that in tripleo_common/actions/plan.py we call the
following:
swiftutils.create_and_upload_tarball(
  swift, tmp_dir, self.exports_container, tarball_name,
  self.delete_after)

The reason is that in
tripleo_common/utils/swift.py:create_and_upload_tarball() we added
'tarball_options' as an option but we did not add it at the end and we
had a caller using a positional argument.

Let's make sure that 'delete_after' is passed as a named argument.

Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>

Change-Id: Idda2f6da3d84d1c448d941c962a07616863d61bf
Closes-Bug: #1749204
2018-02-13 16:04:41 +01:00
Ryan Brady f70830b425 Select Roles Workflow
This patch adds a workflow that takes a list of role names as
input and populates roles_data.yaml in container in Swift with
respective roles from 'roles directory'.

Change-Id: I6c2a0d120d3e362df1ce1b701597d062783a48a4
Implements: blueprint tripleo-common-select-roles-workflow
2018-01-26 14:27:53 -05:00
Ryan Brady a9e26a8d77 Adds UpdateRoles Workflow
This patch adds a workflow and associated actions to update
roles in a deployment plan.

Implements: blueprint update-roles-action

Change-Id: I42d66da37dcb07c1be112623d89769377bb23284
2018-01-26 14:27:43 -05:00
Brad P. Crochet bb8a3e18b8 Add UpdateNetworks workflow
Change-Id: I3faddc2af372ae34bed127efb89e41c667fecfe6
Implements: blueprint update-networks-action
Depends-On: Icfdebe0728051607c0519ddb00ea7e54630dc06c
2018-01-26 01:18:57 +00:00
Dougal Matthews 117bacd599 Log any exceptions that occur in the tripleo.plan.update_from_dir action
Previously the action would return a string representation of the
exception. It will be unlikely that this would contain enough
information, so it is useful to log the full exception traceback.

Change-Id: Ibb5438470f7c4843c59a03640909bb82623f4046
2018-01-05 12:11:15 +00:00
Mike Fedosin a15c10ef1a Remove "overcloud-swift-rings" container during overcloud deletion
Trying to re-run `openstack overcloud deploy` now fails with
"A container with the name overcloud-swift-rings already exists."
It happens because Ьistral doesn't remove the container during the
deletion process.

This patch adds the removal of the container to the corresponding
action.

Change-Id: I3f62fc61758cb817c45df8e67ed3639934edd038
Closes-bug: #1738437
2017-12-21 13:15:44 +01:00
Mathieu Bultel 3a9337bb60 Add exclude list to not override user data
Add an exclude list of file which can possibly
contains user data.
When those files are modified by the user, we should
not erased those when we update the plan during the
upgrade

Change-Id: I4e53d8f95170c25b32a6d714a7620c2c9d2596f3
Closes-Bug: #1734108
2017-11-23 23:11:54 +01:00
Mathieu Bultel 35e7c136cd Update ceph-ansible playbook path in parameter default for update
We need to provide an option to let the user change the default
ansible playbook path for ceph-ansible update.
Closes-Bug: #1723428

Change-Id: I42f1583acfb10747d447372001b1a046d68d7577
2017-11-21 08:28:12 +01:00
Julie Pichon 4212883acb Remove Pike-only migration steps
In Pike, plans were migrated from using Mistral environments for
storing parameters values to using a plan-environment.yaml file stored
together with the plan in Swift. New plans created from THT have this
file included automatically from Pike, and the migration step is no
longer necessary starting in Queens.

Change-Id: I0eb46b78266352eb36ceb9fa9be46a91eaa4a6b8
2017-10-31 15:40:16 +00:00
Ryan Brady 9bd54ab664 Enhances Roles List
This patch enhances the ListRolesAction by adding a detail argument
that toggles whether the names or all role data will be returned.

Change-Id: Ib1755bcf5c1361a3e5616014bf063f69e49687c6
Implements: blueprint tripleo-common-enhance-list-roles-action
2017-10-06 14:05:30 +00:00
Mathieu Bultel e9a4156ddd Execute minor update via ansible on mistral
This review implement the minor update workflow
which does:
- a noop heat stack deployment to set and refresh
  the heat config output.
- download the heat config and put them in a ansible
  playbooks
- run the playbooks with the mistral action

It adds actions for the config download and update
deployment
Adds the config download as a library for being call
either, by the client or mistral

Closes-Bug: #1715557
Change-Id: I199b35f865c0e68d28c5ddd82e5b8fe61abb5f33
2017-10-02 06:41:18 +00:00
Honza Pokorny 4cd60846af Add GUI logging workflows
The workflow works like this:

1.  Drain the tripleo Zaqar queue
2.  Format the messages as a log string
3.  Publish the string to a swift object

If the swift object exceeds 10MB, we rotate it.

This patch also includes a workflow to download the latest log via a temporary
url.  The download log action shares a lot of code with the plan export action,
so the common bits were extracted.

Implements: spec gui-logging
Implements: blueprint websocket-logging
Change-Id: I2affd39e85ccfdbaa18590de182104715cfbbed4
2017-08-08 08:55:55 +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
Ana Krivokapic a05e4510bf Fix plan export
Plan export is currently failing due to the `get_object_client()`
method being called without the mandatory `context` argument.

This change also fixes another instance of the missing `context` argument
to the `get_object_client()` method in the SwiftInformationAction action.

Change-Id: I70f522f85dbbbabb5d50d202001017ab0473385a
Closes-bug: #1698811
2017-06-19 15:22:43 +02:00
Ana Krivokapic bd4e26e823 Use Swift to store Plan environment
Start using the plan environment file in Swift for plan environment
storage instead of Mistral.

Add util functions to get/update environment data.

Remove CreatePlanAction and UpdatePlanAction as all they did was
sync between Mistral and Swift environments. Amend the corresponding
workflows to account for removal of these actions.

Implements: blueprint stop-using-mistral-env
Co-Authored-By: Julie Pichon <jpichon@redhat.com>
Depends-On: I3bcef27413e685c498165b43a8b59c8c9cc5cf5e
Change-Id: Ieedecf92113142e43925131dcbccc4c0cd5b1a18
2017-06-07 16:51:28 +02:00
Julie Pichon c824b58a22 Parse roles from roles_data.yaml directly
roles_data.yaml is the source of truth for the roles available in a
deployment.

Change-Id: I599bf5675caa4650a8eb647e8c50e0fc64fdc923
Implements blueprint: get-roles-action
2017-05-29 10:11:10 +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
Adriano Petrich 78807dff26 add caching the GetParametersAction
This caching in swift changes the time for the GetParametersAction from
15s to 3s

Added tests for plan.UpdatePlanAction as there were none there.

Change-Id: I0b543e082a3b02a35e3e979339698ae237b32ce4
Closes-Bug: #1647301
2017-04-12 14:49:04 +01:00
Ana Krivokapic a3e0464657 Add plan export action and workflow
Implements: blueprint plan-export-action

Change-Id: I789c960f61a30ccd4b076fcae4b3e1b80e825585
2017-03-27 11:00:58 +02:00
Ana Krivokapic 71ca8096fe Enhance plan creation and update with plan-environment
This change enhances the plan creation and update workflows to consume
the plan environment file and import its contents into the Mistral
environment. It also removes importing the root template and root
environment from the capabilities map file, as these fields will
now be imported from the plan environment file.

Implements: blueprint enhance-plan-creation-with-plan-environment
Depends-On: I95e3e3a25104623d6fcf38e99403cebbd591b92d
Change-Id: I961624723d127aebbaacd0c2b481211d83dde3f6
2017-03-15 21:43:08 +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
Ana Krivokapic cd87bc60f2 Add utility functions for deleting/emptying swift containers
Change-Id: I5ae14eba2cc6707fa8e5273bdd93fcc10ac9d15a
2017-01-26 15:40:47 +01:00
Jenkins e36ffd416d Merge "Adds output for failure cases to delete plan action" 2016-12-21 16:37:22 +00:00
Ryan Brady 745b4b88c4 Adds output for failure cases to delete plan action
When a plan was deleted, no feedback to the user was provided in
the cases where a container does not exist or exists but does not
contain metadata identifying it as a deployment plan container.

This patch adds feedback to the user in the above cases by adding
error text that will be returned in the resulting action failure.

Change-Id: I47267d283c35ef517b4ff2530fd662f81ed0dc88
2016-12-21 11:13:40 +00:00
Adriano Petrich 3f718ad23f Validate the plan name before running
By default the plan name is used on the creation of the node name
in the form of plan_name + role + index

Forcing the plan name to be only letters and numbers removes the
possibility of a failed deploy due to an invalid node name

I've included a pattern validator to verify that those names are valid
and a constant for node and plan name validation

Change-Id: I111d0ba43d810657aa0b76b6ea4afd5175be1d30
Closes-Bug: #1644587
2016-12-21 09:22:58 +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