diff --git a/releasenotes/notes/ephemeral-heat-by-default-4ed05e8b82f41c4b.yaml b/releasenotes/notes/ephemeral-heat-by-default-4ed05e8b82f41c4b.yaml new file mode 100644 index 000000000..25637c52d --- /dev/null +++ b/releasenotes/notes/ephemeral-heat-by-default-4ed05e8b82f41c4b.yaml @@ -0,0 +1,10 @@ +--- +features: + - An ephemeral Heat process is now used by default for overcloud deployment. + On each overcloud management operation (deploy/update/upgrade), a + containerized Heat process will be started, the stack will be created new, + and then the Heat process will be stopped. The enable_heat option is + undercloud.conf is now defaulted to False. +deprecations: + - Setting enable_heat=True in undercloud.conf is deprecated. + - Using --heat-type=installed is deprecated with the openstack overcloud commands. diff --git a/tripleoclient/config/undercloud.py b/tripleoclient/config/undercloud.py index 8adfd16d7..e4ed44363 100644 --- a/tripleoclient/config/undercloud.py +++ b/tripleoclient/config/undercloud.py @@ -72,7 +72,7 @@ class UndercloudConfig(StandaloneConfig): def get_undercloud_service_opts(self): return super(UndercloudConfig, self).get_enable_service_opts( cinder=False, - heat=True, + heat=False, ironic=True, ironic_inspector=True, mistral=False, diff --git a/tripleoclient/tests/config/test_config_undercloud.py b/tripleoclient/tests/config/test_config_undercloud.py index c719ec77d..550293047 100644 --- a/tripleoclient/tests/config/test_config_undercloud.py +++ b/tripleoclient/tests/config/test_config_undercloud.py @@ -169,7 +169,7 @@ class TestUndercloudConfig(base.TestCase): ret = self.config.get_undercloud_service_opts() expected = {'enable_cinder': False, 'enable_frr': False, - 'enable_heat': True, + 'enable_heat': False, 'enable_ironic': True, 'enable_ironic_inspector': True, 'enable_mistral': False, diff --git a/tripleoclient/tests/fixture_data/deployment.py b/tripleoclient/tests/fixture_data/deployment.py index ce11168f6..493d652aa 100644 --- a/tripleoclient/tests/fixture_data/deployment.py +++ b/tripleoclient/tests/fixture_data/deployment.py @@ -75,3 +75,19 @@ class UtilsFixture(fixtures.Fixture): self.mock_run_ansible_playbook = self.useFixture(fixtures.MockPatch( 'tripleoclient.utils.run_ansible_playbook') ).mock + self.mock_get_heat_launcher = self.useFixture(fixtures.MockPatch( + 'tripleoclient.utils.get_heat_launcher') + ).mock + self.mock_launch_heat = self.useFixture(fixtures.MockPatch( + 'tripleoclient.utils.launch_heat') + ).mock + self.mock_kill_heat = self.useFixture(fixtures.MockPatch( + 'tripleoclient.utils.kill_heat') + ).mock + self.mock_rm_heat = self.useFixture(fixtures.MockPatch( + 'tripleoclient.utils.rm_heat') + ).mock + self.mock_export_overcloud = self.useFixture(fixtures.MockPatch( + 'tripleoclient.utils.export_overcloud') + ).mock + self.mock_export_overcloud.return_value = {} diff --git a/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py b/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py index cb561068e..06a28d598 100644 --- a/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py +++ b/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py @@ -118,7 +118,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): @mock.patch('tripleoclient.utils.check_service_vips_migrated_to_service') @mock.patch('tripleoclient.utils.build_stack_data', autospec=True) @mock.patch('tripleo_common.utils.plan.default_image_params', - autospec=True) + autospec=True, return_value={}) @mock.patch('tripleoclient.utils.get_rc_params', autospec=True) @mock.patch('tripleo_common.utils.plan.generate_passwords', @@ -169,9 +169,11 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): orchestration_client.stacks.get.return_value = mock_stack utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) - arglist = ['--templates'] + arglist = ['--templates', + '--heat-type', 'installed'] verifylist = [ ('templates', '/usr/share/openstack-tripleo-heat-templates/'), + ('heat_type', 'installed'), ] clients = self.app.client_manager @@ -288,9 +290,11 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): self.useFixture(utils_fixture) utils_overcloud_fixture = deployment.UtilsOvercloudFixture() self.useFixture(utils_overcloud_fixture) - arglist = ['--templates', '--no-cleanup'] + arglist = ['--templates', '--no-cleanup', + '--heat-type', 'installed'] verifylist = [ ('templates', '/usr/share/openstack-tripleo-heat-templates/'), + ('heat_type', 'installed'), ] mock_stack_data.return_value = {'environment_parameters': {}, 'heat_resource_tree': {}} @@ -420,7 +424,13 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): } mock_get_template_contents.return_value = [{}, "template"] - mock_process_env.return_value = {}, {} + mock_env = {} + mock_env['parameter_defaults'] = {} + mock_env['parameter_defaults']['ContainerHeatApiImage'] = \ + 'container-heat-api-image' + mock_env['parameter_defaults']['ContainerHeatEngineImage'] = \ + 'container-heat-engine-image' + mock_process_env.return_value = {}, mock_env parsed_args = self.check_parser(self.cmd, arglist, verifylist) baremetal = clients.baremetal @@ -486,9 +496,11 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) - arglist = ['--templates', '/home/stack/tripleo-heat-templates'] + arglist = ['--templates', '/home/stack/tripleo-heat-templates', + '--heat-type', 'installed'] verifylist = [ ('templates', '/home/stack/tripleo-heat-templates'), + ('heat_type', 'installed'), ] clients = self.app.client_manager @@ -573,6 +585,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): self.useFixture(fixture) utils_overcloud_fixture = deployment.UtilsOvercloudFixture() self.useFixture(utils_overcloud_fixture) + utils_fixture = deployment.UtilsFixture() + self.useFixture(utils_fixture) clients = self.app.client_manager clients = self.app.client_manager @@ -591,6 +605,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): 'Test': 'OS::Heat::None', 'resources': {'*': {'*': { 'UpdateDeployment': {'hooks': []}}}}}} + env['parameter_defaults']['ContainerHeatApiImage'] = \ + 'container-heat-api-image' + env['parameter_defaults']['ContainerHeatEngineImage'] = \ + 'container-heat-engine-image' mock_process_env.return_value = {}, env with open(test_env, 'w') as temp_file: @@ -612,7 +630,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): env_files_tracker=None, deployment_options=None): assertEqual( - {'parameter_defaults': {}, + {'parameter_defaults': { + 'ContainerHeatApiImage': 'container-heat-api-image', + 'ContainerHeatEngineImage': 'container-heat-engine-image', + }, 'resource_registry': { 'Test': 'OS::Heat::None', 'resources': {'*': {'*': { @@ -621,7 +642,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_rc_params.return_value = {'password': 'password', 'region': 'region1'} mock_deploy_heat.side_effect = _fake_heat_deploy - mock_create_env.return_value = [] + mock_create_env.return_value = {} parsed_args = self.check_parser(self.cmd, arglist, verifylist) self.cmd.take_action(parsed_args) mock_copy.assert_called_once() @@ -792,7 +813,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): orchestration_client = clients.orchestration mock_stack = fakes.create_tht_stack() orchestration_client.stacks.get.return_value = mock_stack - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) clients = self.app.client_manager @@ -844,7 +867,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): self.cmd.take_action(parsed_args) self.assertTrue(mock_heat_deploy.called) - self.assertTrue(utils_fixture.mock_deploy_tht.called) + self.assertTrue(utils_oc_fixture.mock_deploy_tht.called) # Check that Heat was called with correct parameters: call_args = mock_heat_deploy.call_args[0] @@ -856,7 +879,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): self.assertIn('Test', call_args[7]['resource_registry']) self.assertIn('Test2', call_args[7]['resource_registry']) - utils_fixture.mock_deploy_tht.assert_called_with( + utils_oc_fixture.mock_deploy_tht.assert_called_with( output_dir=self.cmd.working_dir) mock_copy.assert_called_once() @@ -866,7 +889,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): '_provision_networks', autospec=True) @mock.patch('tripleoclient.utils.build_stack_data', autospec=True) @mock.patch('tripleo_common.utils.plan.default_image_params', - autospec=True) + autospec=True, + return_value=dict( + ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image')) @mock.patch('tripleoclient.utils.get_rc_params', autospec=True) @mock.patch('tripleo_common.utils.plan.generate_passwords', return_value={}) @@ -944,6 +970,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): "id": "network id" } mock_env = fakes.create_env_with_ntp() + mock_env['parameter_defaults']['ContainerHeatApiImage'] = \ + 'container-heat-api-image' + mock_env['parameter_defaults']['ContainerHeatEngineImage'] = \ + 'container-heat-engine-image' mock_process_env.return_value = [{}, mock_env] mock_get_template_contents.return_value = [{}, "template"] @@ -973,6 +1003,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): '192.168.0.1 uc.ctlplane.localhost uc.ctlplane' ], 'CtlplaneNetworkAttributes': {}, + 'ContainerHeatApiImage': 'container-heat-api-image', + 'ContainerHeatEngineImage': 'container-heat-engine-image', } def _custom_create_params_env(parameters, tht_root, @@ -1009,7 +1041,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_copy, mock_rc_params): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) arglist = ['--templates', '--deployed-server', '--disable-validations'] verifylist = [ @@ -1025,13 +1059,16 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): clients.compute = mock.Mock() orchestration_client = clients.orchestration orchestration_client.stacks.get.return_value = fakes.create_tht_stack() - mock_create_env.return_value = ({}, []) + mock_create_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) parsed_args = self.check_parser(self.cmd, arglist, verifylist) self.cmd.take_action(parsed_args) self.assertTrue(mock_deploy.called) self.assertNotCalled(clients.baremetal) self.assertNotCalled(clients.compute) - self.assertTrue(utils_fixture.mock_deploy_tht.called) + self.assertTrue(utils_oc_fixture.mock_deploy_tht.called) mock_copy.assert_called_once() @mock.patch('tripleoclient.utils.get_rc_params', autospec=True) @@ -1049,7 +1086,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_copy, mock_rc_params): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) clients = self.app.client_manager orchestration_client = clients.orchestration @@ -1063,7 +1102,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): parsed_args = self.check_parser(self.cmd, arglist, verifylist) mock_rc_params.return_value = {'password': 'password', 'region': 'region1'} - mock_create_env.return_value = ({}, []) + mock_create_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) self.cmd.take_action(parsed_args) self.assertTrue(mock_deploy.called) self.assertTrue(fixture.mock_get_hosts_and_enable_ssh_admin.called) @@ -1090,12 +1132,18 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_copy, mock_rc_params): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) clients = self.app.client_manager orchestration_client = clients.orchestration orchestration_client.stacks.get.return_value = fakes.create_tht_stack() mock_create_env.return_value = ({}, []) + mock_create_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) arglist = ['--templates', '--config-download', '--setup-only'] verifylist = [ @@ -1131,12 +1179,17 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_create_parameters_env): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) clients = self.app.client_manager orchestration_client = clients.orchestration orchestration_client.stacks.get.return_value = fakes.create_tht_stack() - mock_create_parameters_env.return_value = (mock.Mock(), mock.Mock()) + mock_create_parameters_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) arglist = ['--templates', '--config-download-only'] verifylist = [ @@ -1178,10 +1231,15 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_create_parameters_env): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) + utils_fixture = deployment.UtilsFixture() + self.useFixture(utils_fixture) clients = self.app.client_manager orchestration_client = clients.orchestration orchestration_client.stacks.get.return_value = fakes.create_tht_stack() - mock_create_parameters_env.return_value = (mock.Mock(), mock.Mock()) + mock_create_parameters_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) arglist = ['--templates', '--config-download-only'] verifylist = [ @@ -1220,7 +1278,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_copy, mock_rc_params): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) clients = self.app.client_manager orchestration_client = clients.orchestration @@ -1236,7 +1296,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_rc_params.return_value = {'password': 'password', 'region': 'region1'} - mock_create_env.return_value = ({}, []) + mock_create_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) self.cmd.take_action(parsed_args) self.assertTrue(fixture.mock_get_hosts_and_enable_ssh_admin.called) self.assertTrue(fixture.mock_config_download.called) @@ -1282,7 +1345,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_create_parameters_env): fixture = deployment.DeploymentWorkflowFixture() self.useFixture(fixture) - utils_fixture = deployment.UtilsOvercloudFixture() + utils_oc_fixture = deployment.UtilsOvercloudFixture() + self.useFixture(utils_oc_fixture) + utils_fixture = deployment.UtilsFixture() self.useFixture(utils_fixture) clients = self.app.client_manager orchestration_client = clients.orchestration @@ -1295,7 +1360,14 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): ('templates', '/usr/share/openstack-tripleo-heat-templates/'), ('overcloud_ssh_port_timeout', 42), ('timeout', 451) ] - mock_process_env.return_value = {}, {} + + mock_env = {} + mock_env['parameter_defaults'] = {} + mock_env['parameter_defaults']['ContainerHeatApiImage'] = \ + 'container-heat-api-image' + mock_env['parameter_defaults']['ContainerHeatEngineImage'] = \ + 'container-heat-engine-image' + mock_process_env.return_value = {}, mock_env parsed_args = self.check_parser(self.cmd, arglist, verifylist) mock_rc_params.return_value = {'password': 'password', @@ -1303,12 +1375,19 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): # assuming heat deploy consumed a 3m out of total 451m timeout with mock.patch('time.time', side_effect=[1585820346, 12345678, 0, 0, - 1585820526]): + 1585820526, 0]): self.cmd.take_action(parsed_args) - self.assertIn( - [mock.call(mock.ANY, mock.ANY, 'overcloud', mock.ANY, - mock.ANY, 451, mock.ANY, mock.ANY, False, None, - deployment_options={}, env_files_tracker=mock.ANY)], + self.assertIn([ + mock.call( + mock.ANY, mock.ANY, 'overcloud', mock.ANY, + mock.ANY, 451, mock.ANY, + {'parameter_defaults': { + 'ContainerHeatApiImage': 'container-heat-api-image', + 'ContainerHeatEngineImage': + 'container-heat-engine-image'}}, + False, None, + env_files_tracker=mock.ANY, + deployment_options={})], mock_hd.mock_calls) self.assertIn( [mock.call(mock.ANY, mock.ANY, mock.ANY, 'ctlplane', @@ -1325,6 +1404,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): fixture.mock_config_download.assert_called() mock_copy.assert_called_once() + @mock.patch('tripleoclient.workflows.deployment.create_overcloudrc', + autospec=True) @mock.patch('tripleoclient.workflows.deployment.make_config_download_dir') @mock.patch('tripleoclient.utils.get_rc_params', autospec=True) @mock.patch('tripleoclient.utils.copy_clouds_yaml') @@ -1340,7 +1421,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): def test_config_download_only_timeout( self, mock_deploy, mock_create_env, mock_get_undercloud_host_entry, mock_update, - mock_copyi, mock_rc_params, mock_cd_dir): + mock_copyi, mock_rc_params, mock_cd_dir, + mock_create_overcloudrc): utils_fixture = deployment.UtilsOvercloudFixture() self.useFixture(utils_fixture) utils_fixture2 = deployment.UtilsFixture() @@ -1351,6 +1433,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): stack.output_show.return_value = {'output': {'output_value': []}} orchestration_client = clients.orchestration orchestration_client.stacks.get.return_value = stack + utils_fixture2.mock_launch_heat.return_value = orchestration_client arglist = ['--templates', '--config-download-only', '--overcloud-ssh-port-timeout', '42', @@ -1365,7 +1448,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud): mock_rc_params.return_value = {'password': 'password', 'region': 'region1'} - mock_create_env.return_value = ({}, []) + mock_create_env.return_value = ( + dict(ContainerHeatApiImage='container-heat-api-image', + ContainerHeatEngineImage='container-heat-engine-image'), + []) self.cmd.take_action(parsed_args) playbook = os.path.join(os.environ.get( 'HOME'), self.cmd.working_dir, diff --git a/tripleoclient/tests/v1/undercloud/test_install_upgrade.py b/tripleoclient/tests/v1/undercloud/test_install_upgrade.py index 32f21041a..b3894254e 100644 --- a/tripleoclient/tests/v1/undercloud/test_install_upgrade.py +++ b/tripleoclient/tests/v1/undercloud/test_install_upgrade.py @@ -92,6 +92,8 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -153,6 +155,8 @@ class TestUndercloudInstall(TestPluginV1): '/home/stack/foo.yaml', '-e', '/usertht/environments/services/ironic.yaml', '-e', '/usertht/environments/services/ironic-inspector.yaml', '-e', + '/usertht/environments/' + 'disable-heat.yaml', '-e', '/usertht/environments/services/' 'undercloud-remove-novajoin.yaml', '-e', '/usertht/environments/' @@ -315,6 +319,8 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -379,6 +385,8 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -439,6 +447,8 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -496,6 +506,8 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -589,6 +601,8 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -677,6 +691,8 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -741,6 +757,8 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -804,6 +822,8 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -865,6 +885,8 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', @@ -932,6 +954,8 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' + 'disable-heat.yaml', '-e', + '/usr/share/openstack-tripleo-heat-templates/environments/' 'services/undercloud-remove-novajoin.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'disable-telemetry.yaml', '-e', diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 98ed18866..a101bd320 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -390,10 +390,6 @@ class DeployOvercloud(command.Command): # check migration to service vips managed by servce utils.check_service_vips_migrated_to_service(stack, env) - if parsed_args.heat_type != 'installed': - self.setup_ephemeral_heat( - parsed_args, env.get('parameter_defaults')) - self._try_overcloud_deploy_with_compat_yaml( new_tht_root, stack, parsed_args.stack, env_files, @@ -689,17 +685,14 @@ class DeployOvercloud(command.Command): return [output_path] - def setup_ephemeral_heat(self, parsed_args, parameters): + def setup_ephemeral_heat(self, parsed_args): self.log.info("Using ephemeral heat for stack operation") - api_container_image = parameters['ContainerHeatApiImage'] - engine_container_image = \ - parameters['ContainerHeatEngineImage'] restore_db = (parsed_args.setup_only or parsed_args.config_download_only) self.heat_launcher = utils.get_heat_launcher( parsed_args.heat_type, - api_container_image=api_container_image, - engine_container_image=engine_container_image, + api_container_image=parsed_args.heat_container_api_image, + engine_container_image=parsed_args.heat_container_engine_image, heat_dir=os.path.join(self.working_dir, 'heat-launcher'), use_tmp_dir=False, @@ -1048,7 +1041,7 @@ class DeployOvercloud(command.Command): parser.add_argument( '--heat-type', action='store', - default='installed', + default='pod', choices=['installed', 'pod', 'container', 'native'], help=_('The type of Heat process to use to execute ' 'the deployment.\n' @@ -1058,6 +1051,26 @@ class DeployOvercloud(command.Command): 'container: Use an ephemeral Heat container.\n' 'native: Use an ephemeral Heat process.') ) + parser.add_argument( + '--heat-container-api-image', + metavar='', + dest='heat_container_api_image', + default=constants.DEFAULT_HEAT_API_CONTAINER, + help=_('The container image to use when launching the heat-api ' + 'process. Only used when --heat-type=pod. ' + 'Defaults to: {}'.format( + constants.DEFAULT_HEAT_API_CONTAINER)) + ) + parser.add_argument( + '--heat-container-engine-image', + metavar='', + dest='heat_container_engine_image', + default=constants.DEFAULT_HEAT_ENGINE_CONTAINER, + help=_('The container image to use when launching the heat-engine ' + 'process. Only used when --heat-type=pod. ' + 'Defaults to: {}'.format( + constants.DEFAULT_HEAT_ENGINE_CONTAINER)) + ) parser.add_argument( '--rm-heat', action='store_true', @@ -1150,6 +1163,13 @@ class DeployOvercloud(command.Command): created_env_files = self.create_env_files( stack, parsed_args, new_tht_root, user_tht_root) + if parsed_args.heat_type != 'installed': + self.setup_ephemeral_heat(parsed_args) + else: + self.log.warning( + ("DEPRECATED: Using --heat-type=installed is deprecated " + "and will be removed in a future release.")) + try: if not (parsed_args.config_download_only or parsed_args.setup_only): diff --git a/tripleoclient/workflows/deployment.py b/tripleoclient/workflows/deployment.py index c99345cc4..f6cab6d39 100644 --- a/tripleoclient/workflows/deployment.py +++ b/tripleoclient/workflows/deployment.py @@ -91,7 +91,8 @@ def deploy_without_plan(clients, stack, stack_name, template, create_result = utils.wait_for_stack_ready( orchestration_client, stack_name, marker, action) if not create_result: - shell.OpenStackShell().run(["stack", "failures", "list", stack_name]) + shell.OpenStackShell().run( + ["stack", "failures", "list", '--long', stack_name]) set_deployment_status( stack_name, status='DEPLOY_FAILED',