CLOUDSTACK-4754: it's a race condition: delete template, and deploy vm from the template happened at the same time,
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/583279f3 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/583279f3 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/583279f3 Branch: refs/heads/4.2 Commit: 583279f3373d3e9893c03468753b5ec4cb68a2ad Parents: 94c8e28 Author: Edison Su <sudi...@gmail.com> Authored: Fri Sep 27 16:09:22 2013 -0700 Committer: Edison Su <sudi...@gmail.com> Committed: Fri Sep 27 16:09:46 2013 -0700 ---------------------------------------------------------------------- .../apache/cloudstack/storage/motion/DataMotionServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/583279f3/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java index c1cbdc7..9f0f531 100644 --- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java +++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java @@ -41,6 +41,9 @@ public class DataMotionServiceImpl implements DataMotionService { @Override public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) { + if (srcData.getDataStore() == null || destData.getDataStore() == null) { + throw new CloudRuntimeException("can't find data store"); + } if (srcData.getDataStore().getDriver().canCopy(srcData, destData)) { srcData.getDataStore().getDriver().copyAsync(srcData, destData, callback);