From 3248ba99608be13222ec85fa5438937480b312ea Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Thu, 12 Dec 2024 20:08:57 +0200 Subject: [PATCH] CI: wait until server is shelved offloaded Wait for condition when shelving is finished. Change-Id: I7945989461c0b80adbb629da2eef1464e1ce2645 --- ci/roles/server_action/tasks/main.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ci/roles/server_action/tasks/main.yml b/ci/roles/server_action/tasks/main.yml index 46f619d6..e3b78c8b 100644 --- a/ci/roles/server_action/tasks/main.yml +++ b/ci/roles/server_action/tasks/main.yml @@ -460,20 +460,14 @@ register: server ignore_errors: true -- name: Assert shelve offload server - assert: - that: - - ((server is success) - or (server is not success - and "Cannot 'shelveOffload' instance" in server.msg - and ("while it is in vm_state shelved_offloaded" in server.msg - or "while it is in task_state shelving_offloading" in server.msg ))) - - name: Get info about server openstack.cloud.server_info: cloud: "{{ cloud }}" server: ansible_server register: servers + until: servers.servers.0.task_state == none + retries: 30 + delay: 10 - name: Ensure status for server is SHELVED_OFFLOADED # no change if server has been offloaded automatically after first shelve command