You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2018/04/12 17:34:48 UTC

[cloudstack] branch master updated: [CLOUDSTACK-10214] Unable to remove local primary storage (#2390)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new eba2e1d  [CLOUDSTACK-10214] Unable to remove local primary storage (#2390)
eba2e1d is described below

commit eba2e1d8a1ce4e86b4df144db03e96739da455e5
Author: Rafael Weingärtner <ra...@gmail.com>
AuthorDate: Thu Apr 12 14:34:43 2018 -0300

    [CLOUDSTACK-10214] Unable to remove local primary storage (#2390)
---
 api/src/main/java/com/cloud/storage/StorageService.java   | 15 ++++-----------
 .../main/java/com/cloud/storage/StorageManagerImpl.java   | 12 +-----------
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/api/src/main/java/com/cloud/storage/StorageService.java b/api/src/main/java/com/cloud/storage/StorageService.java
index e40b1e6..aebbbcd 100644
--- a/api/src/main/java/com/cloud/storage/StorageService.java
+++ b/api/src/main/java/com/cloud/storage/StorageService.java
@@ -90,23 +90,16 @@ public interface StorageService {
 
     boolean deleteSecondaryStagingStore(DeleteSecondaryStagingStoreCmd cmd);
 
-    ImageStore discoverImageStore(String name, String url, String providerName, Long zoneId, Map details) throws IllegalArgumentException, DiscoveryException,
-            InvalidParameterValueException;
+    ImageStore discoverImageStore(String name, String url, String providerName, Long zoneId, Map details) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
 
-
-        /**
+    /**
      * Migrate existing NFS to use object store.
      * @param name object store name.
-     * @param url object store url.
+     * @param url object store URL.
      * @param providerName object store provider Name.
      * @param details object store other details
      * @return Object store created.
-     * @throws IllegalArgumentException
-     * @throws DiscoveryException
-     * @throws InvalidParameterValueException
      */
-    ImageStore migrateToObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException,
-            InvalidParameterValueException;
-
+    ImageStore migrateToObjectStore(String name, String url, String providerName, Map<String, String> details) throws DiscoveryException;
 
 }
diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
index a179f8d..749450c 100644
--- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
@@ -344,7 +344,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
                 return false;
             }
         }
-
         // ok to share
         return true;
     }
@@ -891,11 +890,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
             s_logger.warn("Unable to delete storage id: " + id + " due to it is not in Maintenance state");
             throw new InvalidParameterValueException("Unable to delete storage due to it is not in Maintenance state, id: " + id);
         }
-        if (sPool.isLocal()) {
-            s_logger.warn("Unable to delete local storage id:" + id);
-            throw new InvalidParameterValueException("Unable to delete local storage id: " + id);
-        }
-
         Pair<Long, Long> vlms = _volsDao.getCountAndTotalByPool(id);
         if (forced) {
             if (vlms.first() > 0) {
@@ -1126,7 +1120,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
                             s_logger.debug("Failed to delete snapshot: " + ssSnapshotVO.getId() + " from storage");
                         }
                     }
-
                     cleanupSecondaryStorage(recurring);
 
                     List<VolumeVO> vols = _volsDao.listVolumesToBeDestroyed(new Date(System.currentTimeMillis() - ((long)StorageCleanupDelay.value() << 10)));
@@ -1931,19 +1924,16 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
 
     @Override
     public Answer sendToPool(long poolId, Command cmd) throws StorageUnavailableException {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Answer[] sendToPool(long poolId, Commands cmd) throws StorageUnavailableException {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public String getName() {
-        // TODO Auto-generated method stub
         return null;
     }
 
@@ -2044,7 +2034,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
     }
 
     @Override
-    public ImageStore migrateToObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException {
+    public ImageStore migrateToObjectStore(String name, String url, String providerName, Map<String, String> details) throws DiscoveryException, InvalidParameterValueException {
         // check if current cloud is ready to migrate, we only support cloud with only NFS secondary storages
         List<ImageStoreVO> imgStores = _imageStoreDao.listImageStores();
         List<ImageStoreVO> nfsStores = new ArrayList<ImageStoreVO>();

-- 
To stop receiving notification emails like this one, please contact
rafael@apache.org.