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.openstack.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
This commit is contained in:
@@ -44,6 +44,14 @@ parameters:
|
||||
type: string
|
||||
description: Specifies the default CA cert to use if TLS is used for
|
||||
services in the internal network.
|
||||
ODLUpdateLevel:
|
||||
default: 1
|
||||
description: Specify the level of update
|
||||
type: number
|
||||
constraints:
|
||||
- allowed_values:
|
||||
- 1
|
||||
- 2
|
||||
|
||||
conditions:
|
||||
|
||||
@@ -167,23 +175,25 @@ outputs:
|
||||
- opendaylight_enabled.rc == 0
|
||||
service: name=opendaylight state=stopped enabled=no
|
||||
# Containarised deployment upgrade steps
|
||||
- name: remove journal and snapshots
|
||||
when: step|int == 0
|
||||
file:
|
||||
path: /var/lib/opendaylight/{{item}}
|
||||
state: absent
|
||||
with_items:
|
||||
- snapshots
|
||||
- journal
|
||||
- name: Set ODL upgrade flag to True
|
||||
copy:
|
||||
dest: /var/lib/opendaylight/etc/opendaylight/datastore/initial/config/genius-mdsalutil-config.xml
|
||||
content: |
|
||||
<config xmlns="urn:opendaylight:params:xml:ns:yang:mdsalutil">
|
||||
<upgradeInProgress>true</upgradeInProgress>
|
||||
</config>
|
||||
when: step|int == 1
|
||||
post_upgrade_tasks:
|
||||
- name: ODL container L2 update and upgrade tasks
|
||||
block: &odl_container_upgrade_tasks
|
||||
- name: remove journal and snapshots
|
||||
when: step|int == 0
|
||||
file:
|
||||
path: /var/lib/opendaylight/{{item}}
|
||||
state: absent
|
||||
with_items:
|
||||
- snapshots
|
||||
- journal
|
||||
- name: Set ODL upgrade flag to True
|
||||
copy:
|
||||
dest: /var/lib/opendaylight/etc/opendaylight/datastore/initial/config/genius-mdsalutil-config.xml
|
||||
content: |
|
||||
<config xmlns="urn:opendaylight:params:xml:ns:yang:mdsalutil">
|
||||
<upgradeInProgress>true</upgradeInProgress>
|
||||
</config>
|
||||
when: step|int == 1
|
||||
post_upgrade_tasks: &odl_container_post_upgrade_tasks
|
||||
- name: Unset upgrade flag in ODL
|
||||
shell:
|
||||
str_replace:
|
||||
@@ -192,7 +202,20 @@ outputs:
|
||||
-H "Content-Type: application/json" \
|
||||
$ODL_URI/restconf/config/genius-mdsalutil:config'
|
||||
params:
|
||||
$ODL_USERNAME: {get_param: [OpenDaylightBase, OpenDaylightUsername]}
|
||||
$ODL_PASSWORD: {get_param: [OpenDaylightBase, OpenDaylightPassword]}
|
||||
$ODL_USERNAME: {get_attr: [OpenDaylightBase, role_data, config_settings, 'opendaylight::username']}
|
||||
$ODL_PASSWORD: {get_attr: [OpenDaylightBase, role_data, config_settings, 'opendaylight::password']}
|
||||
$ODL_URI: {get_param: [EndpointMap, OpenDaylightInternal, uri]}
|
||||
when: step|int == 0
|
||||
update_tasks:
|
||||
- name: Get ODL update level
|
||||
block: &get_odl_update_level
|
||||
- name: store update level to update_level variable
|
||||
set_fact:
|
||||
odl_update_level: {get_param: ODLUpdateLevel}
|
||||
- name: Run L2 update tasks that are similar to upgrade_tasks when update level is 2
|
||||
block: *odl_container_upgrade_tasks
|
||||
when: odl_update_level == 2
|
||||
post_update_tasks:
|
||||
- block: *get_odl_update_level
|
||||
- block: *odl_container_post_upgrade_tasks
|
||||
when: odl_update_level == 2
|
||||
Reference in New Issue
Block a user