From 42c9892594b81272c803d6f0a102c7a0a7aec855 Mon Sep 17 00:00:00 2001 From: dhoogfr Date: Sat, 26 Feb 2022 10:32:10 +0100 Subject: [PATCH] Add delay after patching the current host, before continuing with the next host Add delay after patching the current host, before continuing with the next host After patching a host, it takes some time before that host (after rebooting) is a valid target again for guests to be migrated to. With a 2 node cluster, this can cause the patching of the second host to fail because the guests cannot be migrated of that host or to cause the guests to be shutdown (depending on the used parameters). This can be avoided by adding a delay (controlled by the wait_before_next_upgrade parameter, defaulting to 5 minutes) before continuing with the next host --- roles/cluster_upgrade/README.md | 1 + roles/cluster_upgrade/defaults/main.yml | 1 + roles/cluster_upgrade/tasks/upgrade.yml | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/roles/cluster_upgrade/README.md b/roles/cluster_upgrade/README.md index 8a17c050..f7c25de6 100644 --- a/roles/cluster_upgrade/README.md +++ b/roles/cluster_upgrade/README.md @@ -20,6 +20,7 @@ Role Variables | healing_in_progress_checks | 6 | Maximum number of attempts to check if gluster healing is still in progress. | | healing_in_progress_check_delay | 300 | The delay in seconds between each attempt to check if gluster healing is still in progress. | | wait_to_finish_healing | 5 | Delay in minutes to wait to finish gluster healing process after successful host upgrade. | +| wait_before_next_upgrade| 5 | Delay in minutes to wait for the currrent patched host to get to a good state, before continuing with the next | | engine_correlation_id | UNDEF | The correlation id with which be the role run. | Example Playbook diff --git a/roles/cluster_upgrade/defaults/main.yml b/roles/cluster_upgrade/defaults/main.yml index 25c50b80..d7892b46 100644 --- a/roles/cluster_upgrade/defaults/main.yml +++ b/roles/cluster_upgrade/defaults/main.yml @@ -14,3 +14,4 @@ pinned_vms_names: [] healing_in_progress_checks: 6 healing_in_progress_check_delay: 300 wait_to_finish_healing: 5 +wait_before_next_upgrade: 5 diff --git a/roles/cluster_upgrade/tasks/upgrade.yml b/roles/cluster_upgrade/tasks/upgrade.yml index aaa2c13f..32dde9a6 100644 --- a/roles/cluster_upgrade/tasks/upgrade.yml +++ b/roles/cluster_upgrade/tasks/upgrade.yml @@ -133,6 +133,12 @@ - cluster_info.ovirt_clusters[0].gluster_service | bool - host_info.ovirt_hosts | length > 1 + - name: Delay in minutes to wait to upgraded host getting good state + pause: + minutes: "{{ wait_before_next_upgrade }}" + when: + - host_info.ovirt_hosts | length > 1 + - name: progress - host upgrade complete (host 100% complete) include_tasks: log_progress.yml vars: