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

F #1371: ccr_ref updated on vm migration (#1758)

This commit is contained in:
Sergio Semedi Barranco 2018-02-19 13:52:05 +01:00 committed by Tino Vázquez
parent 86897af299
commit 5e1843e0d5

View File

@ -55,11 +55,12 @@ begin
# required vcenter objects
vc_vm = VCenterDriver::VirtualMachine.new_from_ref(vm["/VM/DEPLOY_ID"], vi_client)
dst_host = VCenterDriver::ClusterComputeResource.new_from_ref(dst_host["/HOST/TEMPLATE/VCENTER_CCR_REF"],vi_client).item
vc_host = VCenterDriver::ClusterComputeResource.new_from_ref(dst_host["/HOST/TEMPLATE/VCENTER_CCR_REF"],vi_client).item
config = {:cluster => dst_host }
config = {:cluster => vc_host }
vc_vm.migrate(config)
vm.replace({"VCENTER_CCR_REF" => dst_host["/HOST/TEMPLATE/VCENTER_CCR_REF"] })
rescue Exception => e
message = "Cannot migrate for VM #{vm_id}"\
"failed due to "\