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
Since Nova was removed from undercloud, baremetal node should be
always pre-provisioned.
Depends-on: https://review.opendev.org/848695
Change-Id: If837d30b5d22a7ba0c3b0ffe8eb641d9ce9f6b55
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
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>
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
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
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
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
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>
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>
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
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
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
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
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
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
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
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>
Relevant logic was altered to comply with the rule
while preserving the function.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I8363336463dc170087924b2f7cc3fa56609f848e
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
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
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
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
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
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>
--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
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
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
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
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
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
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
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