Use ephemeral Heat by default
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
This commit is contained in:
@@ -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.
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
@@ -115,7 +115,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',
|
||||
@@ -165,9 +165,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
|
||||
@@ -283,9 +285,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': {}}
|
||||
@@ -412,7 +416,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
|
||||
@@ -474,9 +484,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
|
||||
@@ -561,6 +573,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
|
||||
@@ -579,6 +593,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:
|
||||
@@ -600,7 +618,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': {'*': {'*': {
|
||||
@@ -609,7 +630,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()
|
||||
@@ -776,7 +797,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
|
||||
@@ -828,7 +851,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]
|
||||
@@ -840,7 +863,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()
|
||||
|
||||
@@ -848,7 +871,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={})
|
||||
@@ -924,6 +950,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"]
|
||||
|
||||
@@ -953,6 +983,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,
|
||||
@@ -988,7 +1020,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 = [
|
||||
@@ -1004,13 +1038,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)
|
||||
@@ -1027,7 +1064,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
|
||||
@@ -1041,7 +1080,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)
|
||||
@@ -1067,12 +1109,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 = [
|
||||
@@ -1107,12 +1155,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 = [
|
||||
@@ -1153,10 +1206,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 = [
|
||||
@@ -1194,7 +1252,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
|
||||
@@ -1210,7 +1270,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)
|
||||
@@ -1255,7 +1318,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
|
||||
@@ -1268,7 +1333,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',
|
||||
@@ -1276,12 +1348,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',
|
||||
@@ -1298,6 +1377,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')
|
||||
@@ -1312,7 +1393,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()
|
||||
@@ -1323,6 +1405,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',
|
||||
@@ -1337,7 +1420,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,
|
||||
|
||||
@@ -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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -151,6 +153,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/public-tls-undercloud.yaml',
|
||||
@@ -311,6 +315,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -373,6 +379,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -431,6 +439,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -486,6 +496,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/'
|
||||
'services/barbican.yaml', '-e',
|
||||
@@ -577,6 +589,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -663,6 +677,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -725,6 +741,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -786,6 +804,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -845,6 +865,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
@@ -910,6 +932,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/'
|
||||
'public-tls-undercloud.yaml',
|
||||
|
||||
@@ -299,10 +299,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,
|
||||
@@ -526,17 +522,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,
|
||||
@@ -882,7 +875,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'
|
||||
@@ -892,6 +885,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='<HEAT_CONTAINER_API_IMAGE>',
|
||||
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='<HEAT_CONTAINER_ENGINE_IMAGE>',
|
||||
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',
|
||||
@@ -974,6 +987,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):
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user