From 6770c5d92dae37fc48f5b63900936616218815ea Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Tue, 2 Jul 2013 10:45:49 +0530 Subject: [PATCH] CLOUDSTACK-2510: Getting NPE while executinng listStoragePools API command. --- .../lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java index 26733d443eb..17e80b84382 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java @@ -364,6 +364,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore List allHosts = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.Routing, primarystore.getClusterId(), primarystore.getPodId(), primarystore.getDataCenterId()); if (allHosts.isEmpty()) { + primaryDataStoreDao.expunge(primarystore.getId()); throw new CloudRuntimeException("No host up to associate a storage pool with in cluster " + primarystore.getClusterId()); }