From b40d9c23fcbb5e4dbce26557910c855aa80bd078 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Mon, 8 Dec 2014 15:25:06 -0800 Subject: [PATCH] if local storage is in maitenance mode or removed, won't change its status in case of mgt server restart Reviewed-by:Frank --- server/src/com/cloud/storage/StorageManagerImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index c603c4d70eb..c7b3c3502eb 100644 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -583,8 +583,12 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary); } - HostScope scope = new HostScope(host.getId(), host.getClusterId(), host.getDataCenterId()); - lifeCycle.attachHost(store, scope, pInfo); + pool = _storagePoolDao.findById(store.getId()); + if (pool.getStatus() != StoragePoolStatus.Maintenance && pool.getStatus() != StoragePoolStatus.Removed) { + HostScope scope = new HostScope(host.getId(), host.getClusterId(), host.getDataCenterId()); + lifeCycle.attachHost(store, scope, pInfo); + } + } catch (Exception e) { s_logger.warn("Unable to setup the local storage pool for " + host, e); throw new ConnectionException(true, "Unable to setup the local storage pool for " + host, e);