Browse Source

Merge "Move ephemeral heat upgrade to the service"

changes/16/799916/1
Zuul 12 months ago committed by Gerrit Code Review
parent
commit
4bdfe08038
  1. 52
      deployment/heat/heat-ephemeral-container-ansible.yaml
  2. 69
      deployment/undercloud/undercloud-upgrade-ephemeral-heat.yaml
  3. 1
      environments/lifecycle/undercloud-upgrade-prepare.yaml
  4. 1
      overcloud-resource-registry-puppet.j2.yaml
  5. 9
      releasenotes/notes/undercloud-upgrade-ephemeral-heat-c838a9c61fc742a3.yaml
  6. 1
      roles/Undercloud.yaml
  7. 1
      roles_data_undercloud.yaml
  8. 6
      scripts/undercloud-upgrade-ephemeral-heat.py

52
deployment/heat/heat-ephemeral-container-ansible.yaml

@ -42,13 +42,19 @@ parameters:
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
OvercloudStackRoleDataFileMap:
default: {}
description: |
Mapping of overcloud stack name, and the absolute path to the
roles data file used when deploying/updating the stack.
For example: {'overcloud': '/home/stack/roles_data.yaml'}
type: json
outputs:
role_data:
description: Role data for the Heat Ephemeral
value:
service_name: heat_ephemeral
upgrade_tasks: []
deploy_steps_tasks:
- name: Tag Ephemeral Heat Containers for Overcloud Deploy
when:
@ -72,3 +78,47 @@ outputs:
vars:
container_image: {get_param: ContainerHeatApiImage}
container_image_latest: "localhost/tripleo/openstack-heat-api:ephemeral"
upgrade_tasks:
- name: Convert to Ephemeral Heat
when:
- step|int == 1
block:
- name: Create /var/lib/tripleo-config/scripts dir
file:
path: /var/lib/tripleo-config/scripts
state: directory
recurse: true
- name: Copy undercloud-upgrade-ephemeral-heat.py to /var/lib/tripleo-config/scripts
copy:
dest: /var/lib/tripleo-config/scripts/undercloud-upgrade-ephemeral-heat.py
content: {get_file: ../../scripts/undercloud-upgrade-ephemeral-heat.py}
mode: 0755
- name: Check if heat engine is still running
shell: systemctl is-active tripleo_heat_engine.service || systemctl is-enabled tripleo_heat_engine.service
failed_when: false
become: true
register: heat_engine_enabled
- name: Store OvercloudStackRoleDataFileMap on file
vars:
role_data_file_map: {get_param: OvercloudStackRoleDataFileMap}
copy:
dest: /var/lib/tripleo-config/overcloud-stack-role-data-file-map.yaml
content: "{{ role_data_file_map | to_nice_yaml }}"
- name: Run undercloud-upgrade-ephemeral-heat.py
shell: /var/lib/tripleo-config/scripts/undercloud-upgrade-ephemeral-heat.py
register: upgrade_ephemeral_result
when:
- heat_engine_enabled.rc is defined
- heat_engine_enabled.rc == 0
- name: Tear down previous Heat containers
include_role:
name: tripleo_container_rm
vars:
tripleo_container_cli: "{{ container_cli }}"
tripleo_containers_to_rm:
- heat_api
- heat_api_cfn
- heat_engine
when:
- upgrade_ephemeral_result.rc is defined
- upgrade_ephemeral_result.rc == 0

69
deployment/undercloud/undercloud-upgrade-ephemeral-heat.yaml

@ -1,69 +0,0 @@
heat_template_version: wallaby
description: >
Upgrade an undercloud to use ephemeral Heat
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
OvercloudStackRoleDataFileMap:
default: {}
description: |
Mapping of overcloud stack name, and the absolute path to the
roles data file used when deploying/updating the stack.
For example: {'overcloud': '/home/stack/roles_data.yaml'}
type: json
outputs:
role_data:
description: Role data for the TripleO Undercloud Upgrade Ephemeral Heat service.
value:
service_name: undercloud_upgrade_ephemeral_heat
upgrade_tasks:
- name: Create /var/lib/tripleo-config/scripts dir
file:
path: /var/lib/tripleo-config/scripts
state: directory
recurse: true
when:
- step|int == 1
- name: Copy undercloud-upgrade-ephemeral-heat.py to /var/lib/tripleo-config/scripts
copy:
dest: /var/lib/tripleo-config/scripts/undercloud-upgrade-ephemeral-heat.py
content: {get_file: ../../scripts/undercloud-upgrade-ephemeral-heat.py}
mode: 0755
when:
- step|int == 1
- name: Store OvercloudStackRoleDataFileMap on file
vars:
role_data_file_map: {get_param: OvercloudStackRoleDataFileMap}
copy:
dest: /var/lib/tripleo-config/overcloud-stack-role-data-file-map.yaml
content: "{{ role_data_file_map | to_nice_yaml }}"
when:
- step|int == 1
- name: Run undercloud-upgrade-ephemeral-heat.py
shell: /var/lib/tripleo-config/scripts/undercloud-upgrade-ephemeral-heat.py
when:
- step|int == 1

1
environments/lifecycle/undercloud-upgrade-prepare.yaml

@ -2,7 +2,6 @@
resource_registry:
OS::TripleO::Services::UndercloudUpgrade: ../../deployment/undercloud/undercloud-upgrade.yaml
OS::TripleO::Services::UndercloudUpgradeEphemeralHeat: ../../deployment/undercloud/undercloud-upgrade-ephemeral-heat.yaml
parameter_defaults:
UndercloudUpgrade: true

1
overcloud-resource-registry-puppet.j2.yaml

@ -238,7 +238,6 @@ resource_registry:
OS::TripleO::Services::MasqueradeNetworks: OS::Heat::None
OS::TripleO::Services::TripleoValidations: OS::Heat::None
OS::TripleO::Services::UndercloudUpgrade: OS::Heat::None
OS::TripleO::Services::UndercloudUpgradeEphemeralHeat: OS::Heat::None
OS::TripleO::Services::Collectd: OS::Heat::None
OS::TripleO::Services::ManilaApi: OS::Heat::None
OS::TripleO::Services::ManilaScheduler: OS::Heat::None

9
releasenotes/notes/undercloud-upgrade-ephemeral-heat-c838a9c61fc742a3.yaml

@ -1,8 +1,5 @@
---
features:
- A new service, OS::TripleO::Services::UndercloudUpgradeEphemeralHeat is
added to the Undercloud role. The service is mapped to OS::Heat::None by
default, but when environments/lifecycle/undercloud-upgrade-prepare.yaml is
included, the service will be enabled and will migrate any already deployed
stacks in the undercloud's Heat instance to be able to be used with the
ephemeral Heat deployment option from tripleoclient.
- Added Heat container tear down to the HeatEphemeral service to occur during
upgrades. This will convert an undercloud from non-ephemeral heat to
ephemeral heat when the service is enabled.

1
roles/Undercloud.yaml

@ -99,6 +99,5 @@
- OS::TripleO::Services::TripleoFirewall
- OS::TripleO::Services::Tuned
- OS::TripleO::Services::UndercloudUpgrade
- OS::TripleO::Services::UndercloudUpgradeEphemeralHeat
- OS::TripleO::Services::TripleoValidations
- OS::TripleO::Services::Zaqar

1
roles_data_undercloud.yaml

@ -102,6 +102,5 @@
- OS::TripleO::Services::TripleoFirewall
- OS::TripleO::Services::Tuned
- OS::TripleO::Services::UndercloudUpgrade
- OS::TripleO::Services::UndercloudUpgradeEphemeralHeat
- OS::TripleO::Services::TripleoValidations
- OS::TripleO::Services::Zaqar

6
scripts/undercloud-upgrade-ephemeral-heat.py

@ -354,9 +354,9 @@ def main():
_heatclient = Client('1', endpoint=conn.endpoint_for('orchestration'),
token=conn.auth_token)
except keystoneauth1.exceptions.catalog.EndpointNotFound:
LOG.warning("No Heat endpoint found, won't migrate any "
"existing stack data.")
return
LOG.error("No Heat endpoint found, won't migrate any "
"existing stack data.")
raise
try:
stacks = args.stack or [s.name for s in heat.stacks()]

Loading…
Cancel
Save