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

F #2505: Fix detach disk with snapshots for vcenter (#3240)

This commit is contained in:
sergiojvg 2019-04-17 05:08:42 -05:00 committed by Tino Vázquez
parent 186d1f2e2e
commit aa9ed53e5c
2 changed files with 1 additions and 5 deletions

View File

@ -2023,7 +2023,7 @@ class VirtualMachine < VCenterDriver::Template
detachable= !(one_vm["LCM_STATE"].to_i == 11 && !disk.managed?)
detachable = detachable && disk.exists?
raise "Can not detach disk. Not supported on current configuration" unless detachable
return unless detachable
detach_disk(disk)
disk.destroy()

View File

@ -42,10 +42,6 @@ begin
vm = VCenterDriver::VirtualMachine.new_without_id(vi_client, vm_ref)
if vm.has_snapshots?
raise 'vCenter doesn\'t allow to remove a virtual disk if it\'s part ' \
'of a snapshot of the virtual machine.'
end
rescue StandardError => e
message = "Detach DISK for VM #{vm_ref} on vCenter cluster " \
"#{vc_cluster_name} failed due to \"#{e.message}\"."