From df07f685147609eb55e2ffa9e1269330679e986f Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Mon, 29 Jul 2013 17:20:56 +0530 Subject: [PATCH] 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. --- .../lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java index 17e80b84382..2c8c87167a1 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java @@ -439,10 +439,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore List hostPoolRecords = this._storagePoolHostDao.listByPoolId(store.getId()); StoragePool pool = (StoragePool) store; boolean deleteFlag = false; - // If datastore is not in ready state, simply delete its db entry. - if (pool.getStatus() != StoragePoolStatus.Up) { - return this.dataStoreHelper.deletePrimaryDataStore(store); - } + // Remove the SR associated with the Xenserver for (StoragePoolHostVO host : hostPoolRecords) { DeleteStoragePoolCommand deleteCmd = new DeleteStoragePoolCommand(pool);