mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-08 21:16:39 +09:00
1 parent
7f40449a85
commit
2afa07e30d
1 file changed
+4
-3
@@ -2012,7 +2012,8 @@ class VirtualMachine < VCenterDriver::Template
|
||||
begin
|
||||
@item.ReconfigVM_Task(:spec => spec_hash).wait_for_completion
|
||||
rescue Exception => e
|
||||
raise "Cannot detach DISK from VM: #{e.message}\n#{e.backtrace}"
|
||||
raise "Cannot detach DISK from VM: #{e.message}\n#{e.backtrace}"\
|
||||
"Probably an existing VM snapshot includes that disk"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2020,9 +2021,9 @@ class VirtualMachine < VCenterDriver::Template
|
||||
one_vm = one_item
|
||||
|
||||
detachable= !(one_vm["LCM_STATE"].to_i == 11 && !disk.managed?)
|
||||
detachable = detachable && !has_snapshots? && disk.exists?
|
||||
detachable = detachable && disk.exists?
|
||||
|
||||
return unless detachable
|
||||
raise "Can not detach disk. Not supported on current configuration" unless detachable
|
||||
|
||||
detach_disk(disk)
|
||||
disk.destroy()
|
||||
|
||||
Reference in new issue
Block a user