From bc86103c2b1afc4b0bb437d75487bdda26a5958f Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Fri, 6 Dec 2013 11:46:29 +0530 Subject: [PATCH] CLOUDSTACK-5216. delete volume failed due to Exception: java.lang.Exception" while destroying Vms --- .../com/cloud/storage/resource/VmwareStorageProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java index fbbbc13c6b3..38f5b24c14f 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java @@ -1517,7 +1517,9 @@ public class VmwareStorageProcessor implements StorageProcessor { vmMo.destroy(); // this.hostService.handleDatastoreAndVmdkDetach(iScsiName, storageHost, storagePort); - this.hostService.removeManagedTargetsFromCluster(managedIqns); + if (managedIqns != null && !managedIqns.isEmpty()) { + this.hostService.removeManagedTargetsFromCluster(managedIqns); + } for (NetworkDetails netDetails : networks) { if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) {