Skip to content

Commit

Permalink
F #6099: move local ds skip to only migrate option
Browse files Browse the repository at this point in the history
Signed-off-by: Neal Hansen <nhansen@opennebula.io>
  • Loading branch information
onenhansen committed Apr 17, 2023
1 parent 3cd7c42 commit 9d4a1ef
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions share/hooks/ft/host_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit 9d4a1ef

Please sign in to comment.