mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-26 10:03:37 +03:00
Signed-off-by: Carlos Herrera <cherrera@opennebula.systems>
This commit is contained in:
parent
58f8354015
commit
6141ebbb86
@ -930,6 +930,25 @@ module VCenterDriver
|
||||
{}
|
||||
end
|
||||
|
||||
def reference_all_disks
|
||||
extraconfig = []
|
||||
disks_each(:synced?) do |disk|
|
||||
begin
|
||||
key_prefix = disk.managed? ? "opennebula.mdisk." : "opennebula.disk."
|
||||
k = "#{key_prefix}#{disk.id}"
|
||||
v = "#{disk.key}"
|
||||
|
||||
extraconfig << {key: k, value: v}
|
||||
rescue StandardError => e
|
||||
next
|
||||
end
|
||||
end
|
||||
|
||||
spec_hash = {:extraConfig => extraconfig}
|
||||
spec = RbVmomi::VIM.VirtualMachineConfigSpec(spec_hash)
|
||||
@item.ReconfigVM_Task(:spec => spec).wait_for_completion
|
||||
end
|
||||
|
||||
# Build extraconfig section to reference disks
|
||||
# by key and avoid problems with changing paths
|
||||
# (mainly due to snapshots)
|
||||
|
@ -105,6 +105,9 @@ module VCenterDriver
|
||||
|
||||
request_vnc(vc_vm)
|
||||
|
||||
# Sync disks with extraConfig
|
||||
vc_vm.reference_all_disks
|
||||
|
||||
vm.id
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user