Issue happens when ROOT volume gets created and there is subsequent failure in starting the VM. During retry if allocator assigns a different storage pool the scenario was not handled. Now in case of local storage the volume get recreated on the newly assigned pool and old one gets cleaned up. In case of shared storage the existing volume is migrated to new storage pool.
This commit is contained in:
Koushik Das 2012-07-23 14:46:56 -07:00 committed by prachi
parent c60e4b4a9e
commit 88f7872b81

View File

@ -3210,10 +3210,25 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
} else {
if (assignedPool.getId() != vol.getPoolId()) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Volume " + vol + " is not recreatable! Cannot recreate on storagepool: " + assignedPool);
s_logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol);
}
if (vm.getServiceOffering().getUseLocalStorage())
{
if (s_logger.isDebugEnabled()) {
s_logger.debug("Local volume " + vol + " will be recreated on storage pool " + assignedPool + " assigned by deploymentPlanner");
}
recreateVols.add(vol);
} else {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Shared volume " + vol + " will be migrated on storage pool " + assignedPool + " assigned by deploymentPlanner");
}
try {
Volume migratedVol = migrateVolume(vol.getId(), assignedPool.getId());
vm.addDisk(new VolumeTO(migratedVol, assignedPool));
} catch (ConcurrentOperationException e) {
throw new StorageUnavailableException("Volume migration failed for " + vol, Volume.class, vol.getId());
}
}
throw new StorageUnavailableException("Volume is not recreatable, Unable to create " + vol, Volume.class, vol.getId());
// copy volume usecase - not yet developed.
} else {
StoragePoolVO pool = _storagePoolDao.findById(vol.getPoolId());
vm.addDisk(new VolumeTO(vol, pool));