mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
(cherry picked from commit ba5db04bb3d3db749ed6930cf835881197360faf)
This commit is contained in:
parent
8c8299fc3c
commit
ec1ed29980
@ -1714,8 +1714,13 @@ end
|
||||
def sync(deploy = {})
|
||||
extraconfig = []
|
||||
device_change = []
|
||||
sync_opt = nil
|
||||
|
||||
disks = sync_disks(:all, false)
|
||||
# Disk are only synced with :all option when VM is first created
|
||||
# NOTE: Detach actions are implemented through TM (not sync)
|
||||
sync_opt = :all if deploy[:new] == true
|
||||
|
||||
disks = sync_disks(sync_opt, false)
|
||||
resize_unmanaged_disks
|
||||
|
||||
if deploy[:boot] && !deploy[:boot].empty?
|
||||
@ -2308,10 +2313,6 @@ end
|
||||
extra_config = []
|
||||
keys = disk_keys.invert
|
||||
|
||||
if keys.nil? || keys.empty?
|
||||
raise 'Unable to find disk mapping information on vmx file.'
|
||||
end
|
||||
|
||||
ipool = VCenterDriver::VIHelper.one_pool(OpenNebula::ImagePool)
|
||||
disks_each(:detached?) do |d|
|
||||
key = d.key.to_s
|
||||
@ -3435,6 +3436,7 @@ end
|
||||
config[:esx_migration_list] = 'Selected_by_DRS'
|
||||
end
|
||||
|
||||
vc_vm.reference_all_disks
|
||||
vc_vm.migrate(config)
|
||||
|
||||
vm.replace({ 'VCENTER_CCR_REF' => ccr_ref })
|
||||
|
@ -85,8 +85,10 @@ begin
|
||||
|
||||
if deploy_id_valid?(deploy_id)
|
||||
# VM is not new, we just need to reconfigure it and to power it on
|
||||
deploy[:new] = false
|
||||
vm = VCenterDriver::VirtualMachine.new_one(vi_client, deploy_id, one_vm)
|
||||
else
|
||||
deploy[:new] = true
|
||||
vm = VCenterDriver::VirtualMachine.new_from_clone(vi_client,
|
||||
drv_action,
|
||||
vm_id)
|
||||
@ -127,6 +129,7 @@ begin
|
||||
:spec => spec
|
||||
).wait_for_completion
|
||||
|
||||
vm.reference_all_disks
|
||||
vm.sync(deploy)
|
||||
# Only mark the VM as running if we are deploying it for the first time
|
||||
set_running = !deploy_id_valid?(deploy_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user