mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 7899: reverting a previously wrong fix; adding the right fix
status 7899: resolved fixed
This commit is contained in:
parent
ed736e7323
commit
db04ec7f90
@ -2371,13 +2371,6 @@ 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) {
|
||||
s_logger.warn("Found volume:" + vol.getId() + " with no storage pool associated with it");
|
||||
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()) {
|
||||
@ -2405,7 +2398,8 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
||||
}
|
||||
recreateVols.add(vol);
|
||||
} else {
|
||||
throw new StorageUnavailableException("Volume " + vol + " can not be used", vol.getPoolId());
|
||||
//the pool id here can potentially be null if the volume was never associated with any pool id (bug: 7899)
|
||||
throw new StorageUnavailableException("Volume " + vol + " can not be used", vol.getPoolId() != null ? vol.getPoolId() : null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user