diff --git a/releasenotes/notes/config-download-timeout-82ab8914f998631f.yaml b/releasenotes/notes/config-download-timeout-82ab8914f998631f.yaml new file mode 100644 index 000000000..bfbd98fc7 --- /dev/null +++ b/releasenotes/notes/config-download-timeout-82ab8914f998631f.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - The timeout specified with --timeout will now be honored with + config-download. An additional cli arg, --config-download-timeout is also + added that can be used to specify a specific timeout (in minutes) just for + the config-download part of the deployment. diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 53a88a02d..8a28c852d 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -24,6 +24,7 @@ import re import shutil import six import tempfile +import time import yaml from heatclient.common import template_utils @@ -820,6 +821,14 @@ class DeployOvercloud(command.Command): 'in the file will override any configuration used by ' 'config-download by default.') ) + parser.add_argument( + '--config-download-timeout', + action='store', + default=None, + help=_('Timeout (in minutes) to use for config-download steps. If ' + 'unset, will default to however much time is leftover ' + 'from the --timeout parameter after the stack operation.') + ) return parser def take_action(self, parsed_args): @@ -873,6 +882,8 @@ class DeployOvercloud(command.Command): print("Validation Finished") return + start = time.time() + if not parsed_args.config_download_only: self._deploy_tripleo_heat_templates_tmpdir(stack, parsed_args) @@ -895,6 +906,13 @@ class DeployOvercloud(command.Command): hosts, parsed_args.overcloud_ssh_user, parsed_args.overcloud_ssh_key) + + if parsed_args.config_download_timeout: + timeout = parsed_args.config_download_timeout * 60 + else: + used = int(time.time() - start) + timeout = (parsed_args.timeout * 60) - used + deployment.config_download(self.log, self.clients, stack, parsed_args.templates, parsed_args.overcloud_ssh_user, @@ -902,6 +920,7 @@ class DeployOvercloud(command.Command): parsed_args.overcloud_ssh_network, parsed_args.output_dir, parsed_args.override_ansible_cfg, + timeout, verbosity=self.app_args.verbose_level) # Force fetching of attributes diff --git a/tripleoclient/workflows/deployment.py b/tripleoclient/workflows/deployment.py index d1fda50cd..2509d97d1 100644 --- a/tripleoclient/workflows/deployment.py +++ b/tripleoclient/workflows/deployment.py @@ -243,15 +243,16 @@ def enable_ssh_admin(log, clients, hosts, ssh_user, ssh_key): def config_download(log, clients, stack, templates, - ssh_user, ssh_key, ssh_network, output_dir, - override_ansible_cfg, verbosity=1): + ssh_user, ssh_key, ssh_network, + output_dir, override_ansible_cfg, timeout, verbosity=1): workflow_client = clients.workflow_engine tripleoclients = clients.tripleoclient workflow_input = { 'verbosity': verbosity or 1, 'plan_name': stack.stack_name, - 'ssh_network': ssh_network + 'ssh_network': ssh_network, + 'config_download_timeout': timeout } if output_dir: workflow_input.update(dict(work_dir=output_dir))