From bce8cb749653edae40b10dd6d982f86a7136eab7 Mon Sep 17 00:00:00 2001 From: rabi Date: Wed, 3 Nov 2021 15:12:04 +0530 Subject: [PATCH] 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 (cherry picked from commit f797e15dcfac7a6cae0335508af3d4a0944f8945) --- ...loyed_server_default-0c2267c7588056fc.yaml | 7 +++++ .../overcloud_deploy/test_overcloud_deploy.py | 5 +++- tripleoclient/v1/overcloud_deploy.py | 27 +++++++++---------- 3 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 releasenotes/notes/deployed_server_default-0c2267c7588056fc.yaml diff --git a/releasenotes/notes/deployed_server_default-0c2267c7588056fc.yaml b/releasenotes/notes/deployed_server_default-0c2267c7588056fc.yaml new file mode 100644 index 000000000..b3bf52ed0 --- /dev/null +++ b/releasenotes/notes/deployed_server_default-0c2267c7588056fc.yaml @@ -0,0 +1,7 @@ +--- +deprecations: + - Ephemeral heat is now used as default for overcloud deployment + and assumes the nodes are pre-provisioned using metalsmith. Deprecates + existing ``--deployed-server`` option and adds an additional option + ``--provision-nodes`` for using installed heat and provisioning + nodes with heat. diff --git a/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py b/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py index 206b4b506..4541cfc0c 100644 --- a/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py +++ b/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py @@ -804,7 +804,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_roles_data, mock_image_prepare, mock_generate_password, mock_rc_params, mock_check_service_vip_migr, - mock_provision_networks, mock_provision_virtual_ips): + mock_provision_networks, + mock_provision_virtual_ips): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) clients = self.app.client_manager @@ -837,6 +838,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): os.makedirs(self.tmp_dir.join('tripleo-heat-templates')) reg_file = self.tmp_dir.join( 'tripleo-heat-templates/overcloud-resource-registry-puppet.yaml') + with open(reg_file, 'w+') as temp_file: temp_file.write('resource_registry:\n Test2: OS::Heat::None') @@ -853,6 +855,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): arglist = ['--answers-file', test_answerfile, '--environment-file', test_env2, '--disable-password-generation', + '--provision-nodes', '--working-dir', self.tmp_dir.path] verifylist = [ ('answers_file', test_answerfile), diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index c4fe7eea4..22ec3dd82 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -27,7 +27,6 @@ import urllib import yaml from heatclient.common import template_utils -from keystoneauth1.exceptions.catalog import EndpointNotFound from osc_lib import exceptions as oscexc from osc_lib.i18n import _ from tripleo_common.image import kolla_builder @@ -54,13 +53,8 @@ class DeployOvercloud(command.Command): self.clients = self.app.client_manager self.orchestration_client = self.clients.orchestration if not parsed_args.deployed_server: - try: - self.compute_client = self.clients.compute - self.baremetal_client = self.clients.baremetal - except EndpointNotFound: - self.log.warning('WARNING: Nova endpoint not available. ' - 'Assuming --deployed-server') - parsed_args.deployed_server = True + self.compute_client = self.clients.compute + self.baremetal_client = self.clients.baremetal def _update_args_from_answers_file(self, args): if args.answers_file is None: @@ -780,7 +774,7 @@ class DeployOvercloud(command.Command): parser.add_argument( '--disable-validations', action='store_true', - default=False, + default=True, help=_('DEPRECATED. Disable the pre-deployment validations ' 'entirely. These validations are the built-in ' 'pre-deployment validations. To enable external ' @@ -847,11 +841,16 @@ class DeployOvercloud(command.Command): parser.add_argument( '--deployed-server', action='store_true', - default=False, - help=_('Use pre-provisioned overcloud nodes. Removes baremetal,' - 'compute and image services requirements from the' - 'undercloud node. Must only be used with the' - '--disable-validations.') + default=True, + help=_('DEPRECATED: Use pre-provisioned overcloud nodes.' + 'Now the default and this CLI option has no effect.') + ) + parser.add_argument( + '--provision-nodes', + action='store_false', + dest='deployed_server', + default=True, + help=_('Provision overcloud nodes with heat.') ) parser.add_argument( '--config-download',