ovn: Fix minor update failure with OVN db pacemaker HA resource

If an OVN deployment doesn't have this fix [1] in the ovn-northd docker image,
the if the image is not tagged with pcmklatest (see [2]), then during
step 5 of minor update of controllers (on the bootstrap node) the
'pacemaker_resource' ansible module fails for the "state: disable" task.

It is observed in my testing that 'pacemaker_resource - state: disable' ansible
tasks fails if the resource is already in stopped state. It also fails
for the task 'pacemaker_resource - state: enable' if the resource is already
enabled. This probably needs a fix in 'pacemaker_resource' ansible module.

To fix the stack update failure issue with OVN, this patch removes these
tasks - disable and enable of ovn-dbs-bundle before and after running the
command "pcs resource bundle update ovn-dbs-bundle container
image={{ovn_dbs_docker_image_latest}}". Since updating the bundle triggers
the resource restart, probably we don't need to explicitly disable and
enable the resource.

[1] - 9b46d3f609 (diff-9c26550f1dff9ce66cf9c3c510b47864)
[2] - See commit with change id - Idbda3bedff57376b74269ab3470d2324b804ffd4

Change-Id: I3f47fd019ca6b2ccb378c97751a11cb12ffed521
Closes-bug: #1784863
This commit is contained in:
Numan Siddique 2018-08-01 19:18:17 +05:30
parent 5cf975c2f4
commit 8a432537d0

View File

@ -269,24 +269,8 @@ outputs:
shell: "pcs resource show ovn-dbs-bundle | grep image | awk '{ split($2, image, \"=\"); print image[2] }'" shell: "pcs resource show ovn-dbs-bundle | grep image | awk '{ split($2, image, \"=\"); print image[2] }'"
register: ovn_dbs_current_image register: ovn_dbs_current_image
- block: &ovn_dbs_update_bundle_with_new_image - block: &ovn_dbs_update_bundle_with_new_image
- name: Disable the ovn-dbs-bundle resource before updating the image
pacemaker_resource:
resource: ovn-dbs-bundle
state: disable
wait_for_resource: true
register: output
retries: 5
until: output.rc == 0
- name: Update the ovn-dbs-bundle to use the new container image name - name: Update the ovn-dbs-bundle to use the new container image name
command: "pcs resource bundle update ovn-dbs-bundle container image={{ovn_dbs_docker_image_latest}}" command: "pcs resource bundle update ovn-dbs-bundle container image={{ovn_dbs_docker_image_latest}}"
- name: Enable the ovn-dbs-bundle resource
pacemaker_resource:
resource: ovn-dbs-bundle
state: enable
wait_for_resource: true
register: output
retries: 5
until: output.rc == 0
when: when:
- ovn_dbs_current_image.stdout != ovn_dbs_docker_image_latest - ovn_dbs_current_image.stdout != ovn_dbs_docker_image_latest
upgrade_tasks: upgrade_tasks: