Skip to content

Commit 823cb00

Browse files
server: do not enable the disabled local storage(s) on host connection during mgmt server / agent start (#11722)
1 parent 963a67b commit 823cb00

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
@@ -159,7 +159,9 @@ public DataStore attachHost(DataStore store, HostScope scope, StoragePoolInfo ex
159159
pool.setScope(scope.getScopeType());
160160
pool.setUsedBytes(existingInfo.getCapacityBytes() - existingInfo.getAvailableBytes());
161161
pool.setCapacityBytes(existingInfo.getCapacityBytes());
162-
pool.setStatus(StoragePoolStatus.Up);
162+
if (pool.getStatus() != StoragePoolStatus.Disabled) {
163+
pool.setStatus(StoragePoolStatus.Up);
164+
}
163165
this.dataStoreDao.update(pool.getId(), pool);
164166
this.storageMgr.createCapacityEntry(pool, Capacity.CAPACITY_TYPE_LOCAL_STORAGE, pool.getUsedBytes());
165167
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
@@ -500,7 +500,7 @@ private HypervisorType getHypervisorType(long hostId) {
500500
@Override
501501
public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
502502
DataStore dataStore = dataStoreHelper.attachHost(store, scope, existingInfo);
503-
if(existingInfo.getCapacityBytes() == 0){
503+
if (existingInfo.getCapacityBytes() == 0) {
504504
try {
505505
storageMgr.connectHostToSharedPool(hostDao.findById(scope.getScopeId()), dataStore.getId());
506506
} catch (StorageUnavailableException ex) {

0 commit comments

Comments
 (0)