bug CS-16380: Check if storage pool changed during migration. Migration should fail only when the assigned pool is not same as existing storage pool

status CS-16380: resolved fixed
reviewed-by: Abhi
This commit is contained in:
Kishan Kavala 2012-09-24 15:12:27 +05:30
parent cb5386391c
commit ec0c35269a
1 changed files with 9 additions and 4 deletions

View File

@ -2794,11 +2794,16 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
}
recreateVols.add(vol);
} else {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Volume " + vol + " is not recreatable! Cannot recreate on storagepool: " + assignedPool);
if (assignedPool.getId() != vol.getPoolId()) {
// copy volume usecase - not yet developed.
if (s_logger.isDebugEnabled()) {
s_logger.debug("Volume " + vol + " is not recreatable! Cannot recreate on storagepool: " + assignedPool);
}
throw new StorageUnavailableException("Volume is not recreatable, Unable to create " + vol, Volume.class, vol.getId());
} else {
StoragePoolVO pool = _storagePoolDao.findById(vol.getPoolId());
vm.addDisk(new VolumeTO(vol, pool));
}
throw new StorageUnavailableException("Volume is not recreatable, Unable to create " + vol, Volume.class, vol.getId());
// copy volume usecase - not yet developed.
}
}
} else {