Skip to content

Commit b40d9c2

Browse files
committed
if local storage is in maitenance mode or removed, won't change its
status in case of mgt server restart Reviewed-by:Frank
1 parent 5a10a47 commit b40d9c2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎server/src/com/cloud/storage/StorageManagerImpl.java‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,12 @@ public DataStore createLocalStorage(Host host, StoragePoolInfo pInfo) throws Con
583583
store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
584584
}
585585

586-
HostScope scope = new HostScope(host.getId(), host.getClusterId(), host.getDataCenterId());
587-
lifeCycle.attachHost(store, scope, pInfo);
586+
pool = _storagePoolDao.findById(store.getId());
587+
if (pool.getStatus() != StoragePoolStatus.Maintenance && pool.getStatus() != StoragePoolStatus.Removed) {
588+
HostScope scope = new HostScope(host.getId(), host.getClusterId(), host.getDataCenterId());
589+
lifeCycle.attachHost(store, scope, pInfo);
590+
}
591+
588592
} catch (Exception e) {
589593
s_logger.warn("Unable to setup the local storage pool for " + host, e);
590594
throw new ConnectionException(true, "Unable to setup the local storage pool for " + host, e);

0 commit comments

Comments
 (0)