From 916a009d5d300d5621970a2ca29bd23e5d29fec3 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Mon, 8 Jul 2013 16:41:09 +0530 Subject: [PATCH] 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. --- server/src/com/cloud/storage/VolumeManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java index d90e79805c8..5799857e031 100644 --- a/server/src/com/cloud/storage/VolumeManagerImpl.java +++ b/server/src/com/cloud/storage/VolumeManagerImpl.java @@ -2391,15 +2391,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 "