mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 05:27:20 +09:00
L #~: fix stop action in vCenter (#1963)
(cherry picked from commit d98d5ece07)
This commit is contained in:
1 parent
ee02565cc4
commit
dc62738737
2 files changed
+9
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user