This is an automated email from the ASF dual-hosted git repository.

weizhou pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.20 by this push:
     new 823cb00a0a0 server: do not enable the disabled local storage(s) on 
host connection during mgmt server / agent start (#11722)
823cb00a0a0 is described below

commit 823cb00a0a0923225597e3e7220ab0d67091a794
Author: Suresh Kumar Anaparti <[email protected]>
AuthorDate: Tue Oct 7 14:51:47 2025 +0530

    server: do not enable the disabled local storage(s) on host connection 
during mgmt server / agent start (#11722)
---
 .../cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java   | 4 +++-
 .../datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java  | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/engine/storage/src/main/java/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
 
b/engine/storage/src/main/java/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
index 7f28224a316..de87444ef44 100644
--- 
a/engine/storage/src/main/java/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
+++ 
b/engine/storage/src/main/java/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
@@ -159,7 +159,9 @@ public class PrimaryDataStoreHelper {
         pool.setScope(scope.getScopeType());
         pool.setUsedBytes(existingInfo.getCapacityBytes() - 
existingInfo.getAvailableBytes());
         pool.setCapacityBytes(existingInfo.getCapacityBytes());
-        pool.setStatus(StoragePoolStatus.Up);
+        if (pool.getStatus() != StoragePoolStatus.Disabled) {
+            pool.setStatus(StoragePoolStatus.Up);
+        }
         this.dataStoreDao.update(pool.getId(), pool);
         this.storageMgr.createCapacityEntry(pool, 
Capacity.CAPACITY_TYPE_LOCAL_STORAGE, pool.getUsedBytes());
         return dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
diff --git 
a/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
 
b/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
index 351d59f6b03..e5ff0ab5873 100644
--- 
a/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
+++ 
b/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
@@ -500,7 +500,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl 
extends BasePrimaryDataStor
     @Override
     public boolean attachHost(DataStore store, HostScope scope, 
StoragePoolInfo existingInfo) {
         DataStore dataStore = dataStoreHelper.attachHost(store, scope, 
existingInfo);
-        if(existingInfo.getCapacityBytes() == 0){
+        if (existingInfo.getCapacityBytes() == 0) {
             try {
                 
storageMgr.connectHostToSharedPool(hostDao.findById(scope.getScopeId()), 
dataStore.getId());
             } catch (StorageUnavailableException ex) {

Reply via email to