CLOUDSTACK-3393: Local disk recreated for stopped VM when started
Recreating local disk will result in cleanup of the old disk and this will lead 
to data loss. So preventing this and bailing out with error. Once migration of 
local disk is supported then another option is to migrate the existing disk to 
the new local storage pool.


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

Branch: refs/heads/ui-ucs
Commit: 33ed0769691691978999f618cca6a628977db029
Parents: 03c8f74
Author: Koushik Das <[email protected]>
Authored: Mon Jul 8 16:41:09 2013 +0530
Committer: Koushik Das <[email protected]>
Committed: Mon Jul 8 17:02:35 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33ed0769/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java 
b/server/src/com/cloud/storage/VolumeManagerImpl.java
index d63e631..4b76dff 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -2388,15 +2388,15 @@ public class VolumeManagerImpl extends ManagerBase 
implements VolumeManager {
                             DiskOfferingVO diskOffering = _diskOfferingDao
                                     .findById(vol.getDiskOfferingId());
                             if (diskOffering.getUseLocalStorage()) {
+                                // Currently migration of local volume is not 
supported so bail out
                                 if (s_logger.isDebugEnabled()) {
                                     s_logger.debug("Local volume "
                                             + vol
-                                            + " will be recreated on storage 
pool "
+                                            + " cannot be recreated on 
storagepool "
                                             + assignedPool
                                             + " assigned by 
deploymentPlanner");
                                 }
-                                VolumeTask task = new 
VolumeTask(VolumeTaskType.RECREATE, vol, null);
-                                tasks.add(task);
+                                throw new CloudRuntimeException("Local volume 
" + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by 
deploymentPlanner");
                             } else {
                                 if (s_logger.isDebugEnabled()) {
                                     s_logger.debug("Shared volume "

Reply via email to