From bef92052ee9a7303b427782838a8a97623de231c Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 19 Oct 2015 20:49:28 +0200 Subject: [PATCH] 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. --- .../apache/cloudstack/storage/volume/VolumeDataFactoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeDataFactoryImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeDataFactoryImpl.java index bc51f5fe44b..3e4cdfff20f 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeDataFactoryImpl.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeDataFactoryImpl.java @@ -77,7 +77,7 @@ public class VolumeDataFactoryImpl implements VolumeDataFactory { @Override public VolumeInfo getVolume(long volumeId) { - VolumeVO volumeVO = volumeDao.findById(volumeId); + VolumeVO volumeVO = volumeDao.findByIdIncludingRemoved(volumeId); if (volumeVO == null) { return null; }