diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb index 07e638b9bb1..1e83a52b872 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb @@ -2023,7 +2023,7 @@ def destroy_disk(disk) 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() diff --git a/src/vmm_mad/remotes/vcenter/detach_disk b/src/vmm_mad/remotes/vcenter/detach_disk index e0958f82456..3e9ff831b62 100755 --- a/src/vmm_mad/remotes/vcenter/detach_disk +++ b/src/vmm_mad/remotes/vcenter/detach_disk @@ -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}\"."