From 95756802e31a1b46d07994dd06567e7bde085489 Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 11 Jan 2011 12:09:56 -0800 Subject: [PATCH] bug 7899: this seems to be a corner case, and from the logs, there was a vol with no pool id associated with it. Adding a check against it, as this should never happen status 7899: resolved fixed --- server/src/com/cloud/storage/StorageManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 1e3826a3f4f..8d3d97ce120 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -2652,6 +2652,11 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag for (VolumeVO vol : vols) { Volume.State state = vol.getState(); if (state == Volume.State.Ready) { + + if(vol.getPoolId() == null) { + throw new StorageUnavailableException("Volume " + vol + " has no storage pool associated with it, and the pool id associated with it is:", vol.getPoolId()); + } + StoragePoolVO pool = _storagePoolDao.findById(vol.getPoolId()); if (pool.getRemoved() != null || pool.isInMaintenance()) { if (vol.isRecreatable()) {