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
This commit is contained in:
Wei Zhou 2021-03-29 12:51:24 +02:00 committed by GitHub
parent caa55a5742
commit b8884efa7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);