Skip to content

Commit 77247b1

Browse files
sureshanapartiLocharla, Sandeep
authored andcommitted
server: do not enable the disabled local storage(s) on host connection during mgmt server / agent start (apache#11722)
1 parent 9e46ee1 commit 77247b1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

engine/storage/src/main/java/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ public DataStore attachHost(DataStore store, HostScope scope, StoragePoolInfo ex
190190
pool.setScope(scope.getScopeType());
191191
pool.setUsedBytes(existingInfo.getCapacityBytes() - existingInfo.getAvailableBytes());
192192
pool.setCapacityBytes(existingInfo.getCapacityBytes());
193-
pool.setStatus(StoragePoolStatus.Up);
193+
if (pool.getStatus() != StoragePoolStatus.Disabled) {
194+
pool.setStatus(StoragePoolStatus.Up);
195+
}
194196
this.dataStoreDao.update(pool.getId(), pool);
195197
this.storageMgr.createCapacityEntry(pool, Capacity.CAPACITY_TYPE_LOCAL_STORAGE, pool.getUsedBytes());
196198
return dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);

plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ private HypervisorType getHypervisorType(long hostId) {
504504
@Override
505505
public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
506506
DataStore dataStore = dataStoreHelper.attachHost(store, scope, existingInfo);
507-
if(existingInfo.getCapacityBytes() == 0){
507+
if (existingInfo.getCapacityBytes() == 0) {
508508
try {
509509
storageMgr.connectHostToSharedPool(hostDao.findById(scope.getScopeId()), dataStore.getId());
510510
} catch (StorageUnavailableException ex) {

0 commit comments

Comments
 (0)