You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ko...@apache.org on 2013/10/17 12:27:06 UTC

git commit: updated refs/heads/master to 9fc471d

Updated Branches:
  refs/heads/master e58bef22c -> 9fc471ddd


CLOUDSTACK-4551: Migrating the data volume from NFS to local storage ,underlying disk offering is not changed.
Even though the volume may get migrated from shared to local storage, it is not possible to update the disk offering.
The fix is to disallow migration from shared to local store.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9fc471dd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9fc471dd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9fc471dd

Branch: refs/heads/master
Commit: 9fc471dddd48983919392f6a238b45fac824c50b
Parents: e58bef2
Author: Koushik Das <ko...@apache.org>
Authored: Thu Oct 17 15:56:33 2013 +0530
Committer: Koushik Das <ko...@apache.org>
Committed: Thu Oct 17 15:56:33 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9fc471dd/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 2a058bf..00df333 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1309,7 +1309,11 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             throw new InvalidParameterValueException("Failed to find the destination storage pool: " + storagePoolId);
         }
 
-        if (!_volumeMgr.volumeOnSharedStoragePool(vol)) {
+        if (_volumeMgr.volumeOnSharedStoragePool(vol)) {
+            if (destPool.isLocal()) {
+                throw new InvalidParameterValueException("Migration of volume from shared to local storage pool is not supported");
+            }
+        } else {
             throw new InvalidParameterValueException("Migration of volume from local storage pool is not supported");
         }
 
@@ -1320,7 +1324,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             try {
                 newVol = _volumeMgr.migrateVolume(vol, destPool);
             } catch (StorageUnavailableException e) {
-               s_logger.debug("Failed to migrate volume", e);
+                s_logger.debug("Failed to migrate volume", e);
             }
         }
         return newVol;