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

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


The following commit(s) were added to refs/heads/4.15 by this push:
     new b8884ef  server: create DB entry for storage pool capacity when create 
storage pool (#4805)
b8884ef is described below

commit b8884efa7f9a4e082af07db0e02cf8cb5748dc1b
Author: Wei Zhou <[email protected]>
AuthorDate: Mon Mar 29 12:51:24 2021 +0200

    server: create DB entry for storage pool capacity when create storage pool 
(#4805)
    
    * server: create DB entry for storage pool capacity when create storage pool
    
    * Revert "server: create DB entry for storage pool capacity when create 
storage pool"
    
    This reverts commit e790167bfe8cdebc80c8a51cb0191184edc40afd.
    
    * server: create DB entry for storage pool capacity when create zone-wide 
storage pools
---
 .../cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java     | 2 ++
 1 file changed, 2 insertions(+)

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 ac2c935..08a3a39 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
@@ -173,6 +173,7 @@ public class PrimaryDataStoreHelper {
 
     public DataStore attachZone(DataStore store) {
         StoragePoolVO pool = this.dataStoreDao.findById(store.getId());
+        storageMgr.createCapacityEntry(pool.getId());
         pool.setScope(ScopeType.ZONE);
         pool.setStatus(StoragePoolStatus.Up);
         this.dataStoreDao.update(pool.getId(), pool);
@@ -181,6 +182,7 @@ public class PrimaryDataStoreHelper {
 
     public DataStore attachZone(DataStore store, HypervisorType hypervisor) {
         StoragePoolVO pool = this.dataStoreDao.findById(store.getId());
+        storageMgr.createCapacityEntry(pool.getId());
         pool.setScope(ScopeType.ZONE);
         pool.setHypervisor(hypervisor);
         pool.setStatus(StoragePoolStatus.Up);

Reply via email to