Qian, This is fixed in 4.6/master by commit bef92052ee9a7303b427782838a8a97623de231c
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeDataFactoryImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeDataFactoryImp~ index bc51f5f..3e4cdff 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; } Kind regards, Wei 2015-11-18 8:23 GMT+01:00 Qian Shaohua <wind...@189.cn>: > Hi all, > > > > CS 4.5.2 KVM > > KVMStorageProcessor checks source volume of a snapshot for the ImageFormat > in createVolumeFromSnapshot(CopyCommand cmd). > > If the source volume is deleted, we get NPE. > > > > 2015-11-18 14:02:57,259 DEBUG [o.a.c.e.o.VolumeOrchestrator] > (API-Job-Executor-35:ctx-0c1e2671 job-2795 ctx-5108a77c) Failed to create > volume from snapshot:java.lang.NullPointerException > > at > > com.cloud.hypervisor.kvm.storage.KVMStorageProcessor.createVolumeFromSnapsho > t(KVMStorageProcessor.java:1237) > > at > > com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.execute(Storag > eSubsystemCommandHandlerBase.java:97) > > at > > com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.handleStorageC > ommands(StorageSubsystemCommandHandlerBase.java:53) > > at > > com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(Li > bvirtComputingResource.java:1406) > > at com.cloud.agent.Agent.processRequest(Agent.java:503) > > at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:808) > > at com.cloud.utils.nio.Task.run(Task.java:84) > > at > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11 > 45) > > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6 > 15) > > at java.lang.Thread.run(Thread.java:744) > > > > It isn't fix in master as we know. > > Shall we save format info in snapshots table and get rid of the dependency? > > Or give the volume info in CopyCommand even if the volume is deleted? > > > > -- > > Qian > >