From 98faacad44e39a456d9fe1a1d21f5a65e8de4fc1 Mon Sep 17 00:00:00 2001 From: Janki Chhatbar Date: Tue, 23 Jan 2018 22:43:49 +0530 Subject: [PATCH] Minor update steps for ODL Updating OpenStack (within release) means updating ODL from v1 to v1.1. This is done by "openstack overcloud update" which collects update_tasks. ODL needs 2 different steps to achieve this minor update. These are called Level1 and Level2. L1 is simple - stop ODL, update, start. This is taken care by paunch and no separate implementation is needed. L2 has extra steps which are implemented in update_tasks and post_update_tasks. Updating ODL within the same major release (1->1.1) consists of either L1 or L2 steps. These steps are decided from ODLUpdateLevel parameter specified in environments/services-docker/update-odl.yaml. Upgrading ODL to the next major release (1.1->2) requires only the L2 steps. These are implemented as upgrade_tasks and post_upgrade_tasks in https://review.opendev.org/489201. Steps involved in level 2 update are 1. Block OVS instances to connect to ODL 2. Set ODL upgrade flag to True 3. Start ODL 4. Start Neutron re-sync and wait for it to finish 5. Delete OVS groups and ports 6. Stop OVS 7. Unblock OVS ports 8. Start OVS 9. Unset ODL upgrade flag These steps are exactly same as upgrade_tasks. The logic implemented is: follow upgrade_tasks; when update_level == 2 Change-Id: Ie532800663dd24313a7350b5583a5080ddb796e7 --- diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 595e16c..c4fb05f 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -23,6 +23,7 @@ {% set post_upgrade_steps_max = 4 -%} {% set fast_forward_upgrade_steps_max = 9 -%} {% set fast_forward_upgrade_prep_steps_max = 3 -%} +{% set post_update_steps_max = 4 -%} heat_template_version: queens @@ -590,3 +591,15 @@ - include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml when: role_name == '{{role.name}}' and ansible_hostname == {{role.name}}[0] {%- endfor %} + post_update_steps_tasks: | +{%- for role in roles %} + - include: {{role.name}}/post_update_tasks.yaml + when: role_name == '{{role.name}}' +{%- endfor %} + post_update_steps_playbook: | + - hosts: overcloud + tasks: + - include: post_update_steps_tasks.yaml + with_sequence: start=0 end={{post_update_steps_max-1}} + loop_control: + loop_var: step diff --git a/common/services.yaml b/common/services.yaml index 2a62c1b..c197b05 100644 --- a/common/services.yaml +++ b/common/services.yaml @@ -283,6 +283,16 @@ expression: coalesce($.data, []).where($ != null).select($.get('update_tasks')).where($ != null).flatten().distinct() data: {get_attr: [ServiceChain, role_data]} + PostUpdateTasks: + type: OS::Heat::Value + properties: + type: comma_delimited_list + value: + yaql: + # Note we use distinct() here to filter any identical tasks, e.g yum update for all services + expression: coalesce($.data, []).where($ != null).select($.get('post_update_tasks')).where($ != null).flatten().distinct() + data: {get_attr: [ServiceChain, role_data]} + UpgradeBatchTasks: type: OS::Heat::Value properties: @@ -349,6 +359,7 @@ upgrade_tasks: {get_attr: [UpgradeTasks, value]} post_upgrade_tasks: {get_attr: [PostUpgradeTasks, value]} update_tasks: {get_attr: [UpdateTasks, value]} + post_update_tasks: {get_attr: [PostUpdateTasks, value]} upgrade_batch_tasks: {get_attr: [UpgradeBatchTasks, value]} service_metadata_settings: {get_attr: [ServiceServerMetadataHook, metadata]} diff --git a/docker/services/opendaylight-api.yaml b/dock
Copyright (c) 2015 Ericsson AB and others.

All rights reserved. This program and the accompanying materials
are made available under the terms of the Apache License, Version 2.0
which accompanies this distribution, and is available at
http://www.apache.org/licenses/LICENSE-2.0


This license is related to the following files included in this directory:

- ez_setup-py
- setup.py