From 34741d2911a937a5aa64876aa86870cb98d50805 Mon Sep 17 00:00:00 2001 From: abhishek Date: Wed, 1 Sep 2010 13:42:55 -0700 Subject: [PATCH] bug 6065: Fixing the issue with the account deletion, in the case where the account is deleted with the volume being created, but not having a pool id associated with it yet status 6065: resolved fixed --- server/src/com/cloud/server/ManagementServerImpl.java | 3 +++ .../src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 979f75f7b36..7eb3b9a0508 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -931,6 +931,9 @@ public class ManagementServerImpl implements ManagementServer { // Mark the account's volumes as destroyed List volumes = _volumeDao.findDetachedByAccount(accountId); for (VolumeVO volume : volumes) { + if(volume.getPoolId()==null){ + accountCleanupNeeded = true; + } _storageMgr.destroyVolume(volume); } diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index c4dc99911e6..914a25805de 100644 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -1016,6 +1016,10 @@ public class SnapshotManagerImpl implements SnapshotManager { // i.e Call them before the VMs for those volumes are destroyed. boolean success = true; for (VolumeVO volume : volumes) { + + if(volume.getPoolId() == null){ + continue; + } Long volumeId = volume.getId(); Long dcId = volume.getDataCenterId(); String secondaryStoragePoolURL = _storageMgr.getSecondaryStorageURL(dcId);