Commit Graph

342 Commits

Author SHA1 Message Date
Ghanshyam Mann 120ef346df Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: I73e76d203878ef213816bf886b8172a0cff3bf28
2024-02-24 11:42:34 -08:00
Zuul 4642098b40 Merge "Omit empty environment files" 2022-11-11 08:24:14 +00:00
Zuul 0cba88a0c1 Merge "Remove logic to detect legacy network resources" 2022-10-27 21:54:18 +00:00
Takashi Kajinami 57ddfddbca Omit empty environment files
The following two environment files are now empty, after we updated
the default in tht to support only pre-provisioned nodes
 - deployed-server-environment(.j2).yaml
 - deployed-server-noop-ctlplane.yaml

This drops usage of these two files so that we can remove these empty
files completely.

Depends-on: https://review.opendev.org/861547
Change-Id: If2a3f1d2d332a930ea9a529088b3a2ab91d50b53
2022-10-20 14:52:45 +09:00
Takashi Kajinami 1846d14a2c overcloud-deploy: Only support pre-provisioned node
Since Nova was removed from undercloud, baremetal node should be
always pre-provisioned.

Depends-on: https://review.opendev.org/848695
Change-Id: If837d30b5d22a7ba0c3b0ffe8eb641d9ce9f6b55
2022-10-14 10:12:06 +09:00
Takashi Kajinami 8d5d3a93b7 Remove logic to detect legacy network resources
The legacy resources were already removed so usage of these resources
should fail at stack creation.

Depends-on: https://review.opendev.org/859521
Change-Id: I4210c959d303f651166a81e24db4f07c7043fca8
2022-09-29 11:48:41 +09:00
Zuul d1a2ea1790 Merge "Derive parameters clean up" 2022-09-08 00:31:40 +00:00
Jaganathan Palanisamy e5e8450333 Derive parameters clean up
This change is to remove derive parameters code for OvS DPDK,
SRIOV and HCI parameters.

Change-Id: Ifca04e4abfec5ceb0b84a57116e529a84d31c96a
2022-09-01 14:48:06 +05:30
James Slagle 43c2810d65 Add cell export to overcloud deploy
Run the equivalent of cell export after the stack is deployed.
The difference between overcloud export and cell export is that
should_filter=True when running cell export. As either of these exports
might be needed later to deploy other stacks, go ahead and make sure
both are always run.

Change-Id: Idceeb31609533b78034f0b25c4b0fbc6d47c19fb
Signed-off-by: James Slagle <jslagle@redhat.com>
2022-08-08 15:28:45 +09:00
Rabi Mishra 40abe6c7ac Stop using heat-admin as ansible_ssh_user
We use tripleo-admin when running config-downloaded
playbooks with overcloud deploy, update and upgrade.
We used to generate the inventory with tripleo-admin
as the default ansible_ssh_user. After we moved to
generate inventory with node provision the default
ansible_ssh_user has changed to heat-admin. This
patch drops heat-admin user completely as we don't
need it anymore.

Depends-On: https://review.opendev.org/c/openstack/tripleo-quickstart/+/849807
Change-Id: I51c3d6af40b6b268bb8e3fb26fe4c2833254549f
2022-07-14 11:33:54 +00:00
rabi 5a6c8fc0c3 Refactor deploy validations for ephemeral heat
All these validations are not executed with ephemeral
heat. With this we'll save stack environment to disk
and validate using it in the next deployment.

Note: Some of these validations have been changed to
not use saved stack environment as we don't update
the stack anymore.

Also cleans up some usage of existing stack in code.

Change-Id: I791407490dcdddb927d488aa73856cd3ef7191bb
2022-06-22 09:16:22 +05:30
Zuul 196dcf5d06 Merge "Mocking utils.check_deploy_backups in OvercloudDeploy tests" 2022-05-06 08:15:28 +00:00
Jiri Podivin 1a59023772 Mocking utils.check_deploy_backups in OvercloudDeploy tests
The `check_deploy_backups` makes calls to `stat` which can potentially
lead to I/O error in testing scenarios when the relevant file is
removed after path retrieval but before `stat` is called.

This can lead to tox test failure, in both CI and local environments.
Mocking the utils.check_deploy_backups in tests where it is indirectly
called should alleviate the problem.

Long term solution would be mocking all built in functions performing I/O calls by default.

Closes-Bug: #1969425

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I96d4bfce84ffe36d476e3383ee264cea6fd93c24
2022-05-03 14:55:58 +02:00
Zuul 16984a5b1c Merge "Remove --heat-type=installed support" 2022-05-02 06:25:39 +00:00
rabi eb3d238d4a Set deployment_status during config generation
We should update the deployment status during config
generation using ephemeral heat stack.

As we cleanup the heat/stack at the end, there is no way
to know if the last config generation has failed (no stack).
Also, earlier deployment_status used to check for stack status.

Change-Id: I8b358444b1ce2b31c40a0994ba955c7baab9e6ac
2022-04-21 08:57:53 +05:30
James Slagle 60d17b2fa1 Remove --heat-type=installed support
Remove support for using an undercloud installed Heat, as it no longer
needs to be supported.

Change-Id: I39150aa6771a32318ad2cbcd50b6dddcd97b4663
Signed-off-by: James Slagle <jslagle@redhat.com>
2022-04-18 16:28:22 -04:00
James Slagle 2843b447dc Consolidate ephemeral Heat interaction to single try/finally
Ephemeral Heat interaction was spread across several areas of the
overcloud deploy, including the entire config-download execution. To
reduce the amount of time that ephemeral Heat needs
to stay running, consolidate all the Heat interaction to a single
try/finally block. The overcloud export is moved earlier in the
execution since it no longer requires Heat API access. This also makes
the shutdown of ephemeral Heat and database backup in just a single
location.

Change-Id: Ia424b2eb251b2d31a97256b5e8882c70058d6a0b
Signed-off-by: James Slagle <jslagle@redhat.com>
2022-04-18 16:28:22 -04:00
Zuul 467ea5b877 Merge "Fix deploy templates arg validation" 2022-01-06 18:20:02 +00:00
Alex Schultz 6e0f514c8f Fix deploy templates arg validation
With the addition of the vip file validation, we broke the check for
the templates arg resulting in a stack trace if templates is not
provided rather then a user friendly error message. This change moves
the vip file validation to it's own check later in the process once the
working directory has been created. The working directory is not created
until after the validation of params.

Change-Id: I67b7dc71542533607e3280b4fac3acfb95203b41
Closes-Bug: #1955573
2021-12-22 08:21:35 -07:00
rabi f797e15dcf Make --deployed-server the default
Now that ephemeral-heat is the default deployment mode, this
option with default False is confusing.

Also, we don't get EndpointNotFound exception when instantiating
clients, if the client library is present.

Change-Id: I3ffc591989b619e534ff1d1574ffe841c8573357
2021-11-03 16:06:02 +05:30
Zuul ce6a55509f Merge "Use unittest.mock instead of third party mock" 2021-10-27 13:12:28 +00:00
James Slagle 1cd6f2829f Refactor --stack-only, --setup-only, --config-download-only
Refactors the --stack-only, --setup-only, --config-download-only, to work
with ephemeral-heat. The arguments now do the expected behavior and work
with how they previously worked prior to ephemeral heat.

--stack-only: create the stack, download the config. no overcloud node
              changes
--setup-only: ssh admin authorization setup.
--config-download-only: run config-download playbook(s) to configure the
                        overcloud.

Signed-off-by: James Slagle <jslagle@redhat.com>
Depends-On: Ie47abe2d7c5d7891aceb88d9008d45d7922dea15
Change-Id: Ia765c2c2ea548a1dcd20f592eda8741f40a1cf16
2021-10-25 12:13:19 -06:00
James Slagle 276a6def10 Save needed stack outputs in working_dir
With ephemeral-heat, we need to save the needed stack outputs in the
working_dir so that the values can be used when needed if the stack is
no longer around.

With the outputs saved, the stack object no longer needs to be passed to
workflows.deployment.config_download and
workflows.deployment.get_hosts_and_enable_ssh_admin, only the stack name
and output values are needed.

Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: I3cc61bfee94227045909a4b0ccf84a8d595b2cea
2021-10-25 12:11:41 -06:00
Brendan Shephard 437c064ee3 Remove cyclic import
roles.py imports utils.py and utils.py is importing roles.py.
This change removes that cycle by moving the required function
to utils.py and removing the import of roles in utils.

Change-Id: I03c67636cb43332c79cbed77399af09c421bb4df
2021-10-18 10:09:38 +00:00
Sandeep Yadav 5084da8196 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Change-Id: I642a46b31586f2791c510645f475effd52ce304e
2021-10-12 14:29:21 -06:00
Alex Schultz 4d511679e8 Drop six
Since we're python3 only, we don't need six anymore.

Change-Id: I82c35f364315129a41dd5cbea64c0c5a50662026
2021-09-30 08:48:40 -06:00
Harald Jensås 81cd105620 Dynamic defaults for roles, networks, vips and bm
When running 'overcloud deploy' command look for dynamic
defaults file for these options:
  --roles-file, --network-file, --vip-file and
  --baremetal-deployment

When the option is set by the user, use the user provided
file and make sure a copy is created in the working
directory. If the argument is not set look in the working
directory for the file used previously and use that file.

overclod node, and overcloud network commands require the
user input. But will place a copy in the working_dir for
overcloud deploy.

The depends-on creates these "defaults" by running the
different nova-less/network-v2 export commands when
upgrading the undercloud. With this change the next
'overcloud deploy' after the undercloud upgrade will use
the correct files (unless the user set the args ...)

Depends-On: https://review.opendev.org/795773
Change-Id: I53ba631dc80428c6f1fe71c2bbfb0b5a36dd8f01
2021-09-07 13:11:21 +02:00
James Slagle b7b934b6ea Update playbooks to use consistent working dir
Updates the cli-enable-ssh-admin.yaml and cli-grant-local-access.yaml
ansible playbook executions to use the consistent working directory
instead of a temporary directory. Adds reproduce_command=True to the
calls to utils.run_ansible_playbook so that the workflows can be re-run
out of the deployment for reproducability.

Change-Id: Id4880be3a0d936e67bfc77ed28145eb1b9de162e
Signed-off-by: James Slagle <jslagle@redhat.com>
2021-08-10 10:44:03 -04:00
Zuul 8031acb16b Merge "Fail the overcloud deploy is ceph-ansible.yaml is included" 2021-08-05 12:03:49 +00:00
Zuul ee634743fd Merge "Implement protected resource types" 2021-08-03 02:35:04 +00:00
Jiri Podivin d7e8bfb053 Enabling pylint no-else-return
Relevant logic was altered to comply with the rule
while preserving the function.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I8363336463dc170087924b2f7cc3fa56609f848e
2021-07-23 16:57:18 +02:00
Francesco Pantano c455a4142c Fail the overcloud deploy is ceph-ansible.yaml is included
TripleO recently concluded the migration to the new ceph deployment
tool (cephadm). The ceph-ansible.yaml environment file, however, is
still relevant in an upgrade context, where ceph-ansible rolling
update playbook is executed.
For this reason, this patch introduces a new validation to make sure
this environment file and the related registry resources can be used
during the update/upgrade context but not when a regular overcloud
deploy or stack updates are executed.

Change-Id: Iec23801a9eec1830469a53ab5ffc641125b5d3ff
2021-07-22 07:03:59 +00:00
Zuul 20d234fe39 Merge "Always run growvols playbook after provision" 2021-07-09 02:52:13 +00:00
Harald Jensås b3bcf63fa5 Deprecate --network-ports, enable it by default
The argument to enable disable node port management
when provisioning or unprovisioning baremetal nodes can
be enabled by default.

It is needed to have an ansible inventory generated,
which is required for whole-disk-image growpart execution
in change: I085ab9da30e1e1a7d2b9a9f230dd0275bd40480d.
Growpart should always run.

Change-Id: Ia0df205ea568f089c7cb7e5464bde76d294f4c36
2021-07-06 21:37:38 +02:00
Harald Jensås 86522255e3 Implement protected resource types
When using the oc deploy command with the options
--baremetal-provision, --vip-file and network-v2
version networks definition the heat environment
files are added to user environments internally.
Including the legacy environment files, such as
`network-isolation.yaml` would result in overriding
the internally defined resource types and a failed
deployment.

This patch implements a check that will detect
resource type conflicts and raise error if a
protected resource type is overriden.

For users that may still want/need to override the
resource types, the protection can be disabled by
setting: `--disable-protected-resource-types`

NOTE: Parameter's are left unprotected since
  traditionally THT interfaces always allowed
  overriding anything and everything.

Also refactor the process_multiple_environments
method by splitting part of method to the new
rewrite_env_path method, so that it can be used
also when checking for prohibited overrides.

Depends-On: I8008344f215be6a54e00d7d27b697375b7f88f0f
Change-Id: I8e0f2762d744b21ec1555faa1e9bbe6e2d00f67b
2021-06-30 22:03:10 +02:00
Harald Jensås 9c997ff094 Add '--templates' arg to node and net provision
Allow setting '--templates', the path tot the THT root
directory. Environment files created by the node and
network provision commands will be created with the user
specified path to the THT root. Defaults to:
 /usr/share/openstack-tripleo-heat-templates/

Closes-Bug: #1932079
Depends-On: I9decd8fb9860cd17dc9e69b9970d9f9dabf11428
Change-Id: I5dd81788c08bb0d797190a5fb8bb120b7d8b4f32
2021-06-30 19:29:21 +00:00
Steve Baker 3f303b907b Always run growvols playbook after provision
Just like cli-overcloud-node-network-config.yaml,
cli-overcloud-node-growvols.yaml will be run by the "openstack
overcloud node provision" directly after provisioning so that whole
disk images will have their /var volume grown to 100%.

This default growvols behaviour can be overridden by adding an
ansible_playbooks entry which sets different arguments:

- count: 3
  name: Controller
  ansible_playbooks:
  - playbook: /usr/share/ansible/tripleo-playbooks/cli-overcloud-node-growvols.yaml
    extra_vars:
      growvols_args: /var=50% /srv=50%

Other changes in this commit include:
- Always call run_role_playbooks and pass network_config as an
  argument
- Full unit test coverage on run_role_playbooks
- Fix run_role_playbook using os.path.basename instead of os.path.dirname

Change-Id: I085ab9da30e1e1a7d2b9a9f230dd0275bd40480d
Blueprint: whole-disk-default
Depends-On: I0a847ad4077a02a02ad817dd189a6a31c3637a93
2021-06-24 11:19:33 +12:00
James Slagle 4cf79c5c3a Copy the deployment archive to /var/lib/tripleo
Save a copy of the deployment archive to /var/lib/tripleo to avoid
accidental deletion by a normal user.

Change-Id: I9f5dc697dd1cd7895723d4c23ce89a00631b310f
Signed-off-by: James Slagle <jslagle@redhat.com>
2021-06-22 08:20:13 -04:00
Harald Jensås 05b47bc07e overcloud deploy - net ports with baremetal deploy
--network-ports
  Deploy network ports during baremetal node provisioning.

--network-config (implies --network-ports)
  Deploy network ports and apply the network configuration
  by applying the tripleo_network_config role on the nodes.

Change-Id: Ib0c57e57fe5771d914ffd2a93c911cb325152f8b
2021-06-16 15:21:54 +02:00
Harald Jensås ef077696a0 overcloud deploy - provision virtual ips
When the --vip-file argument provides the vip_data.yaml
provision Virtual IPs and include the deployed network
environment file in user environments.

Depends-On: https://review.opendev.org/795080
Change-Id: I1e4f8dde9f56311bed8dcbe1b08ade09225fd595
2021-06-16 15:16:00 +02:00
Zuul 15f2539428 Merge "Refactor _validate_args and _update_args_from_answers_file" 2021-06-16 11:29:35 +00:00
James Slagle 030e9f0b57 Use ephemeral Heat by default
Switches to use ephemeral Heat by default for all overcloud operations
and defaults enable_heat to False in undercloud.conf. Stack data will be
migrated to the ephemeral Heat model (to use the consistent working
directory) as part of the upgrade with the inclusion of the depends-on.

To improve the UX when using ephemeral Heat, "stack resource list" is
now run after "stack failures list" automaticaly in the case of Heat
stack failures.

Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: I22b2ec530f8b888a94a88e1726792a8afef227ab
2021-06-11 07:53:10 -04:00
Harald Jensås dc8b39adf0 Refactor _validate_args and _update_args_from_answers_file
Make the methods functions, as they do not need the
class properties.

_validate_args:
  Move the checks for non environment files outside the
  'parsed_args.environment_files' condition. We want to
  check for plan_environment_file, networks_file and
  answers_file even if no environment files are provided.

_update_args_from_answers_file:
  Rename the variable to s/args/parsed_args/ to use the
  same name as elsewhere.

Change-Id: I9b541cebf45a155653b39d94994016b44e29f9ac
2021-06-09 20:55:00 +02:00
Harald Jensås bf03fe4a9c Simplify validate_args_environment_dir
Make the method a function since it does not need
the class properties. Use list comprehension, and
a shorter more descriptive variable name.

Change-Id: Ieda25ce82808276461c74944befa96faccd95301
2021-06-09 20:53:50 +02:00
Harald Jensås 8ba7a7a808 Move get_undercloud_host_entry to utils
Also move the cleanup_host_entry method.

Change-Id: Icfbcd400583ec1c24e171c44a3b71fd99f208bef
2021-06-09 20:46:55 +02:00
Harald Jensås 78190843e3 Move get_ctlplane_attrs to utils
Change-Id: Icf1189d78ccccac303d42ae9b35a532a7ecf226f
2021-06-09 20:44:24 +02:00
Harald Jensås 2b2e52c882 overcloud deploy - provision networks
When the network file provided as input to the overcloud
deploy command is a network-v2 format file. Provision
networks and include the deployed network environment
file in user environments.

Change-Id: I20da47f8dfbf48f6ee46e60a07c00482545cb444
2021-06-07 10:44:31 +02:00
ramishra 4243df7de1 Don't download configs twice for --setup-only
Also fixes to download the contents to the consistent
working directory by default.

Change-Id: I33944b3d21a4448a5d89f6d5f1bf539f0b7c9cd1
2021-05-26 11:09:55 +05:30
Jiri Podivin a1aadd37d7 Too broad exceptions replaced with altenatives.
Blocks catching base Exception were replaced
with more constrained alternatives where possible.

Alternatives were chosen based on exceptions possibly
raised by calls within the `try` clause.

Logs were altered to reflect new situation.
string method format was used for new log calls.

Unit tests were adjusted accordingly.

This patch may cause uptick in unhadled exceptions,
as previously "hidden" issues become apparent.

Increase in the number of exceptions capture,
including potential hunk revert should be done with care however.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I24612700bcbd3e17685ae7a33a27f38a2055a0fb
2021-05-14 16:37:29 +02:00
ramishra 0b9e9a43c8 Allow user environments override generated ones
We generate some parameters using the user environments like
the one for image parameters. However, user environments may
have parameters to override some of those. Make sure the ones
in user environments takes precedence by adding the user
environments at the end.

Additional changes:

- Refactors to use the correct image for ephemeral heat
- Removes ntp server check as we never checked for
  ControllerCount in all environment files and also use
  a hard-coded role name.

Related-Bug: #1926758
Change-Id: I6e6ee98cb6a06bd830eb712f67e1cd0d9c13a1f4
2021-05-06 21:08:26 +05:30