bug 10608:

only one primary storage in a cluster can be in PrepareMaintenance mode
This commit is contained in:
anthony 2011-07-07 19:40:04 -07:00
parent fa0373b6e9
commit fc5c657980
1 changed files with 7 additions and 0 deletions

View File

@ -2048,6 +2048,13 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
throw new ExecutionException(msg);
}
List<StoragePoolVO> spes = _storagePoolDao.listBy(primaryStorage.getDataCenterId(), primaryStorage.getPodId(), primaryStorage.getClusterId());
for( StoragePoolVO sp : spes ) {
if( sp.getStatus() == StoragePoolStatus.PrepareForMaintenance ) {
throw new CloudRuntimeException("Only one storage pool in a cluster can be in PrepareForMaintenance mode, " + sp.getId() + " is already in PrepareForMaintenance mode " );
}
}
if (!primaryStorage.getStatus().equals(StoragePoolStatus.Up) && !primaryStorage.getStatus().equals(StoragePoolStatus.ErrorInMaintenance)) {
throw new InvalidParameterValueException("Primary storage with id " + primaryStorageId + " is not ready for migration, as the status is:" + primaryStorage.getStatus().toString());
}