Change the constant OVERCLOUD_NETWORKS_FILE to point
to network_data_default.yaml in THT. (The new v2 default).
Add check, and prompt the user for confirmation in case
legacy networks definition is provided. The check and prompt
can be disabled with the '--allow-deprecated-network-data'
argument.
Also add the '--yes' in 'OvercloudDeploy' and remove it in the
Update nad Upgrade classes that will now inherit it.
blueprint network-data-v2
Depends-On: I618c0a0d99c934fb65a6af30bc76096d52d4679d
Depends-On: I759402fb22a9a3fd0fc06c8e107eee6eb5798c51
Change-Id: I2d14d9e587fce28ea0897bb235c9dedc8f68fa12
Currently, "openstack overcloud status" without debug
returns nothing if overcloud stack is not available.
~~~
$ openstack overcloud status
$
~~~
This was not the case in ussuri[0] and older branches,
Till ussuri :-
~~~
$ openstack overcloud status
No deployment was found for overcloud
~~~
With this patch, We are improvining the user experience
incase no overcloud deployment is found.
[0] https://opendev.org/openstack/python-tripleoclient/src/branch/stable/ussuri/tripleoclient/v1/overcloud_deploy.py#L1198-L1200
Closes-bug: #1943855
Change-Id: Ice40c5000fa3ef22cacdb4ddb0c32bda245245b0
In patch[1], we have changed the default heat type to be ephermal
heat. We missed to change the help section.
To avoid confusion to users, Updating with this patch.
[1] https://review.opendev.org/c/openstack/python-tripleoclient/+/789930
Change-Id: Iae5ca17dbca64d5b0594138843c99d23797c331d
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
When using ephemeral Heat, the Neutron service is not available to Heat.
This change adds a check on the resource_registry to see if any
resources map to Neutron types. If any are found, an exception is
raised.
Change-Id: I0836f8c0e8265a1b3f273d445c4eb41850028efd
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>
With the current way, the ending message is a bit too similar when we
get a success or a failure:
"with error" compared to "without error" is too close, and it's easy to
overlook an potential issue.
This change changes "without error" to "successfully", making a clear
difference.
This issue was reported as-is on Red Hat Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1937226
Change-Id: I059de98ef3fbb8f39a4119dbf334be4b14d989ad
In previously versions, if you wanted to manually run the playbooks you
could use --stack-only to generate them and have them created for you.
This appears to be broken as the condition is now based on --setup-only
which attempts to restore a previously existing stack. This moves the
download config playbooks back to also being dependent on --stack-only
or --no-config-download
Change-Id: Ie810f9fbaabfff98595a3aaaf1878a348b17dfb4
Closes-Bug: #1934009
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
Because export imports utils and utils imports export
there is a cyclic import so pylint objects PEP8 R0401.
overcloud_deploy and overcloud_export need the function
export_overcloud which depends on export. The function
export_overcloud was added to utils for that import but
this created the cyclic import. To work around this,
redefine the export_overcloud function in export and
have overcloud_deploy and overcloud_export import it
from export, not utils. Then remove the utils import
of export.
Change-Id: I8bab41ee9af9729cd63ed7132928cfbc1770887a
This change updates the exception call when using the new `vip_file`
argument. Presently there's no CommandError within tripleoclient,
which results in an AttributeError, so we move the call to osc_lib which
has what we're expecting.
Change-Id: I94e00ed3000982c2563c54d73e0c1cfd0ac7c6a3
Signed-off-by: Kevin Carter <kecarter@redhat.com>
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
This change removes some redundant definitions of default values
according to the following three points.
- The get method returns None by default if the key doesn't exist,
so it is unnecessary to define None explicitly.
- Setting '' as parameter defaults is redundant because we always use
"if CONF.get('<name>'):" to check whether the parameter is set.
- In oslo.config all options default to None unless the default
parameter is explicitly set. Thus defining default=None is redundant.
Change-Id: Ib14b24b9054fe4d0efc3e03f9c6683ae999e3202
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
In I9f5dc697dd1cd7895723d4c23ce89a00631b310f this was added.
But we don't call the function to create the archive_dir
before copying.
Fails with "Exception archiving deploy artifacts: RuntimeError: sudo
failed: b"cp: cannot create regular file '/var/lib/tripleo/archive"
Change-Id: Ie7445a691f06fce5349d2fc571e65a78671b3098
Add an option '--skip-nodes-and-networks', when this
is set the _provision_networks, _provision_virtual_ips
and _provision_baremetal steps will be skipped.
Change-Id: I2fa073863f2d292575ee1dbdc0da271434f219f6
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
Use the defaults from container image prepare to set the default values
for the standalone and undercloud heat api and engine images. This will
allow the default upstream or downstream defaults from the right branch
to be used.
Additionally this patch splits out the ephemeral heat containers to a
special namespace and tag that we use in THT to setup the containers for
the overcloud deploy command on an undercloud.
related-bug: 1931995
Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/796617
Change-Id: I55fb9816e2b0a54717938b7a094bde6780811305
Signed-off-by: James Slagle <jslagle@redhat.com>
Signed-off-by: Alex Schultz <aschultz@redhat.com>
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>
This would ensure that we don't build service chains for
not enabled roles and cip would not try to pull images
for services mapped to OS::Heat::None.
Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/797173
Change-Id: I8f2f7700d0dd5a6c7459c8bc69d7937d72d23687
--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
We would need the stack to be updated for newly provisioned
nodes. Therefore --config-download-only and --setup-only
would not work with --baremetal-deployment.
Change-Id: I307bbf28dc3ee447a6ed704b5f956118d2099e07
Currently it prints "overcloud deployed successfully"
after you hit ctrl-c and deployment has been aborted.
Also fixes message logged for ephemeral heat.
Change-Id: I9a9dd37b3197f268f8f2aaab0976ee6d6cc1c21d
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
Adds a wait before utils.launch_heat returns to ensure that the
necessary rabbitmq queues have been created. Without the wait, there is
a race condition between the queues being created and the first
heatclient command being executed, which can lead to a
oslo_messaging.exceptions.MessagingTimeout exception.
Also fixes a minor issue in the choices for the --heat-type option for
overcloud deploy. The choice should be "installed" and not "system".
Change-Id: Ib63813b63c37fa2cee57a211535d43d605131529
Signed-off-by: James Slagle <jslagle@redhat.com>
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
Also moves deployed-server-environment.yaml before
the user environments as it resets
OS::TripleO::DeployedServer::ControlPlanePort.
Regression from I8fb6ca088b1052488ff4f9ada4d3ab29c0be4735
Closes-Bug: #1926758
Change-Id: I1a6da2e92cc994240f53e8d702f61d941b6a37f7
As per [1] RGW is now deployed by default when the cephadm envs
are included. However, during the upgrade procedure we should
warn users if both services are enabled, failing early during
the update or upgrade prepare step and suggesting that the
cephadm-rbd-only env should be added to make sure Swift is kept
and RGW is not automatically included in the heat stack.
This change introduces this kind of check, and an exception is
raised if the stack already exists, Ceph is deployed by TripleO
and swift is found in the previosly created stack.
[1] https://review.opendev.org/786827
Change-Id: I32387f19346697655355e15b3cf4ff41bd303b08
Instead of using tmp dirs for ansible-runner, use the consistent working
directory, which allows for saving the output for debugging and
reproducability.
Change-Id: I83ad02817ace364eb4bc596127cfd7d6699c32aa
Signed-off-by: James Slagle <jslagle@redhat.com>
The "finally" clause for overcloud deploy is updated to handle
exceptions raised by statements so that later code in the block will be
assured of executing.
Change-Id: I7a94e0f72ed42b70468a361536bfbf88d158dc14
Signed-off-by: James Slagle <jslagle@redhat.com>
The overcloud export environment will be automatically created when
using ephemeral heat. Since the stack is ephemeral, we need to go ahead
and do the export before stopping Heat. While we backup the heat db so
we have the stack saved if needed, it's just eaiser and eliminates a
manual step to do the export if we do it automatically.
Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: Idc326cb7baa54a7d2d01a2be002dfffa6a59ef6a
These new configuration options can be used to optionally disable these
services when using ephemeral Heat.
Depends-On: I2c9cf50363579d4e18aaeaf783770ca7a4266622
Change-Id: I5503a0bb632e7ab03e2c6c5fecec617899179525
Signed-off-by: James Slagle <jslagle@redhat.com>
Add a database restore/backup. to when heat launcher is
started/stopped. The behavior is toggled with the class parameters
restore_db/backup_db.
Change-Id: I195743213b931460b9a1addf2ffd590679a5495b
Signed-off-by: James Slagle <jslagle@redhat.com>
This patch begins to add support for using the ephemeral Heat process
to the overcloud deploy command.
The functionality is enabled with the newly added --heat-type cli arg,
which can be used to select the heat type to be used by the deployment
playbooks and modules. The options are:
installed: current behavior using Heat installed on the undercloud
pod: ephemeral Heat podman pod (heat-api/engine)
container: ephemeral Heat podman container (heat-all)
native: ephemeral Heat native heat-all process
The default is "installed" initially to preserve the existing
functionality.
Signed-off-by: James Slagle <jslagle@redhat.com>
Implements: blueprint ephemeral-heat-overcloud
Change-Id: I8fb6ca088b1052488ff4f9ada4d3ab29c0be4735
In the depends-on change the Redis and OvnDBs VIP is
refactored to the respective service templates.
This adds a validation to raise a ConfigurationError
in case the resource registry contains the deprecated
resoirce definitions:
OS::TripleO::Network::Ports::RedisVipPort
OS::TripleO::Network::Ports::OVNDBsVipPort
Depends-On: https://review.opendev.org/777259
Change-Id: Id5415a94f71cbed5fad9856fd68e109979ffd491
--disable-container-prepare was not being honored within overcloud
deploy. Even though kolla_builder..container_images_prepare_multi is
called with dry_run=True, it should still be skipped when
--disable-container-prepare is passed.
Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: I2703ec683a2fd5b965433cd453af3a0d2357610d