CLOUDSTACK-8964: Can't create volume from snapshot of a removed volume

This issue happens on KVM as well.
This is because the volume info is missing in the CopyCommand once the volume has been removed.
When the KVM agent tries to process the command, it will throws a NPE.
This commit is contained in:
Wei Zhou 2015-10-19 20:49:28 +02:00
parent ecc2e2f39d
commit bef92052ee

View File

@ -77,7 +77,7 @@ public class VolumeDataFactoryImpl implements VolumeDataFactory {
@Override @Override
public VolumeInfo getVolume(long volumeId) { public VolumeInfo getVolume(long volumeId) {
VolumeVO volumeVO = volumeDao.findById(volumeId); VolumeVO volumeVO = volumeDao.findByIdIncludingRemoved(volumeId);
if (volumeVO == null) { if (volumeVO == null) {
return null; return null;
} }