From e6127a7c00cb663ae10a1f19b9c2c0b0310768d2 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 455c85dd12b..747d5d6925e 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java @@ -1474,7 +1474,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")) {