1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

L #~: fix stop action in vCenter (#1963)

This commit is contained in:
Carlos J. Herrera 2022-04-21 09:17:30 -05:00 committed by Ruben S. Montero
parent f0324fed7d
commit c39d00ed0c
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 9 additions and 1 deletions

View File

@ -68,6 +68,11 @@ begin
vm = OpenNebula::VirtualMachine.new_with_id(vmid, one_client)
vm.info
last_action = vm['HISTORY_RECORDS/HISTORY[last()]/ACTION']
last_action_str = OpenNebula::VirtualMachine.get_history_action(last_action)
exit 0 if last_action_str == "stop"
src_ds = vm.retrieve_elements('HISTORY_RECORDS/HISTORY/DS_ID')[-2]
if src_ds == dsid
@ -78,7 +83,7 @@ begin
.migrate_routine(vmid, host_orig, host_dest, false, dsid)
end
rescue StandardError => e
message = "Cannot migrate for VM #{vmid}. "\
message = "Cannot move the VM #{vmid}. "\
'Failed due to '\
"\"#{e.message}\"\n"
OpenNebula.log_error(message)

View File

@ -3388,6 +3388,9 @@ end
pool.info
src_id = pool["/HOST_POOL/HOST[NAME='#{src_host}']/ID"].to_i
return if src_id == 0
dst_id = pool["/HOST_POOL/HOST[NAME='#{dst_host}']/ID"].to_i
# different destination ds