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.
This commit is contained in:
Koushik Das 2013-07-08 16:41:09 +05:30
parent 2aacc29b49
commit 916a009d5d
1 changed files with 3 additions and 3 deletions

View File

@ -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 "