Skip to content

Commit df07f68

Browse files
committed
CLOUDSTACK-3890. Delting the storage pool is not getting from xenserver. The
storage pool entry was removed from the db but the pool wasn't unmounted from the host. There was a check that if the pool is not in UP state then the entry can just be removed. That is wrong. A pool can only be removed if it is in maintenance state. So after putting the pool in maintenance state if admin tries to delete the pool we just remove the db entry without un-mounting the storage pool from the host. Removed the incorrect check.
1 parent 672cae4 commit df07f68

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,7 @@ public boolean deleteDataStore(DataStore store) {
439439
List<StoragePoolHostVO> hostPoolRecords = this._storagePoolHostDao.listByPoolId(store.getId());
440440
StoragePool pool = (StoragePool) store;
441441
boolean deleteFlag = false;
442-
// If datastore is not in ready state, simply delete its db entry.
443-
if (pool.getStatus() != StoragePoolStatus.Up) {
444-
return this.dataStoreHelper.deletePrimaryDataStore(store);
445-
}
442+
446443
// Remove the SR associated with the Xenserver
447444
for (StoragePoolHostVO host : hostPoolRecords) {
448445
DeleteStoragePoolCommand deleteCmd = new DeleteStoragePoolCommand(pool);

0 commit comments

Comments
 (0)