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:
parent
f0324fed7d
commit
c39d00ed0c
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user