CLOUDSTACK-4754: it's a race condition: delete template, and deploy vm from the template happened at the same time,

This commit is contained in:
Edison Su 2013-09-27 16:09:22 -07:00
parent f3c917db05
commit 350e8938cf

View File

@ -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);