Fixed the issue of VM deletion not cleaning the VM folder on vVols datastore. Fixed it by deleting the VM as complete entity including the extra root disks.

This commit is contained in:
Harikrishna Patnala 2020-10-12 12:27:39 +05:30
parent 5fdabc1cb0
commit 048e8c8744
1 changed files with 2 additions and 3 deletions

View File

@ -2670,13 +2670,12 @@ public class VmwareStorageProcessor implements StorageProcessor {
List<VirtualDisk> virtualDisks = vmMo.getVirtualDisks();
List<String> managedDatastoreNames = getManagedDatastoreNamesFromVirtualDisks(virtualDisks);
List<String> detachedDisks = vmMo.detachAllDisksExcept(vol.getPath(), diskInfo != null ? diskInfo.getDiskDeviceBusName() : null);
VmwareStorageLayoutHelper.moveVolumeToRootFolder(new DatacenterMO(context, morDc), detachedDisks);
// let vmMo.destroy to delete volume for us
// vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
if (isManaged) {
List<String> detachedDisks = vmMo.detachAllDisksExcept(vol.getPath(), diskInfo != null ? diskInfo.getDiskDeviceBusName() : null);
VmwareStorageLayoutHelper.moveVolumeToRootFolder(new DatacenterMO(context, morDc), detachedDisks);
vmMo.unregisterVm();
}
else {