server: do not enable the disabled local storage(s) on host connection during mgmt server / agent start (#11722)

This commit is contained in:
Suresh Kumar Anaparti 2025-10-07 14:51:47 +05:30 committed by GitHub
parent 963a67b816
commit 823cb00a0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -159,7 +159,9 @@ public class PrimaryDataStoreHelper {
pool.setScope(scope.getScopeType()); pool.setScope(scope.getScopeType());
pool.setUsedBytes(existingInfo.getCapacityBytes() - existingInfo.getAvailableBytes()); pool.setUsedBytes(existingInfo.getCapacityBytes() - existingInfo.getAvailableBytes());
pool.setCapacityBytes(existingInfo.getCapacityBytes()); pool.setCapacityBytes(existingInfo.getCapacityBytes());
if (pool.getStatus() != StoragePoolStatus.Disabled) {
pool.setStatus(StoragePoolStatus.Up); pool.setStatus(StoragePoolStatus.Up);
}
this.dataStoreDao.update(pool.getId(), pool); this.dataStoreDao.update(pool.getId(), pool);
this.storageMgr.createCapacityEntry(pool, Capacity.CAPACITY_TYPE_LOCAL_STORAGE, pool.getUsedBytes()); this.storageMgr.createCapacityEntry(pool, Capacity.CAPACITY_TYPE_LOCAL_STORAGE, pool.getUsedBytes());
return dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary); return dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);

View File

@ -500,7 +500,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl extends BasePrimaryDataStor
@Override @Override
public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) { public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
DataStore dataStore = dataStoreHelper.attachHost(store, scope, existingInfo); DataStore dataStore = dataStoreHelper.attachHost(store, scope, existingInfo);
if(existingInfo.getCapacityBytes() == 0){ if (existingInfo.getCapacityBytes() == 0) {
try { try {
storageMgr.connectHostToSharedPool(hostDao.findById(scope.getScopeId()), dataStore.getId()); storageMgr.connectHostToSharedPool(hostDao.findById(scope.getScopeId()), dataStore.getId());
} catch (StorageUnavailableException ex) { } catch (StorageUnavailableException ex) {