From c3a45e28d70b1cc292b887f02dd34c91dfaf083b Mon Sep 17 00:00:00 2001 From: mcabrerizo Date: Tue, 18 Apr 2017 08:05:04 +0200 Subject: [PATCH] F #4913: Persistent disks in a VM instantiated as persistent should not be detached in tm mvds --- src/tm_mad/vcenter/mvds | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tm_mad/vcenter/mvds b/src/tm_mad/vcenter/mvds index 10ae863d19..aa7a12fd08 100755 --- a/src/tm_mad/vcenter/mvds +++ b/src/tm_mad/vcenter/mvds @@ -64,7 +64,9 @@ begin vm.one_item = one_vm - vm.detach_disk(disk) if !vm.has_snapshots? + # Don't detach persistent disks if the VM has snapshots, + # or the instantiate to persistent is used + vm.detach_disk(disk) if !vm.has_snapshots? && !vm.instantiated_as_persistent? rescue Exception => e STDERR.puts "Error detaching virtual disk #{disk_id} from vm #{vmid}."\