From 9d4a1eff0f2879843a5cb724d1e35d0f9dcb9d45 Mon Sep 17 00:00:00 2001 From: Neal Hansen Date: Mon, 17 Apr 2023 21:48:27 +0000 Subject: [PATCH] F #6099: move local ds skip to only migrate option Signed-off-by: Neal Hansen --- share/hooks/ft/host_error.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/share/hooks/ft/host_error.rb b/share/hooks/ft/host_error.rb index ab7f089f071..f335e2072d8 100755 --- a/share/hooks/ft/host_error.rb +++ b/share/hooks/ft/host_error.rb @@ -282,16 +282,6 @@ def states_xpath(*arr) next end - vm_ds_id = vm.retrieve_elements("/VM/HISTORY_RECORDS/HISTORY[last()]/DS_ID")[0] - - ds_xpath = "/DATASTORE_POOL/DATASTORE[ID=\"#{vm_ds_id}\"]/TEMPLATE/SHARED" - is_shared = ds_pool.retrieve_elements(ds_xpath)[0] - - if is_shared == "NO" - log "Skipping VM #{vm_id} deployed on non-shared datastore" - next - end - case mode when :recreate log "recreate #{vm_id}" @@ -300,6 +290,15 @@ def states_xpath(*arr) log "delete #{vm_id}" vm.delete when :migrate + vm_ds_id = vm.retrieve_elements("/VM/HISTORY_RECORDS/HISTORY[last()]/DS_ID")[0] + + ds_xpath = "/DATASTORE_POOL/DATASTORE[ID=\"#{vm_ds_id}\"]/TEMPLATE/SHARED" + is_shared = ds_pool.retrieve_elements(ds_xpath)[0] + + if is_shared == "NO" + log "Skipping VM #{vm_id} deployed on non-shared datastore" + next + end log "resched #{vm_id}" vm.resched else