Github user jburwell commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1403#discussion_r59074444
--- Diff:
engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
---
@@ -132,31 +171,52 @@ public void copyAsync(DataObject srcData, DataObject
destData, Host destHost, As
validate(snapshotInfo);
- boolean canHandleSrc = canHandle(srcData.getDataStore());
+ boolean canHandleSrc = canHandle(srcData);
if (canHandleSrc && destData instanceof TemplateInfo &&
(destData.getDataStore().getRole() ==
DataStoreRole.Image || destData.getDataStore().getRole() ==
DataStoreRole.ImageCache)) {
handleCreateTemplateFromSnapshot(snapshotInfo,
(TemplateInfo)destData, callback);
+
return;
}
if (destData instanceof VolumeInfo) {
VolumeInfo volumeInfo = (VolumeInfo)destData;
- boolean canHandleDest = canHandle(destData.getDataStore());
+
+ boolean canHandleDest = canHandle(destData);
if (canHandleSrc && canHandleDest) {
-
handleCreateVolumeFromSnapshotBothOnStorageSystem(snapshotInfo, volumeInfo,
callback);
- return;
+ if (snapshotInfo.getDataStore().getId() ==
volumeInfo.getDataStore().getId()) {
+
handleCreateVolumeFromSnapshotBothOnStorageSystem(snapshotInfo, volumeInfo,
callback);
+ return;
+ }
+ else {
+ throw new UnsupportedOperationException("This
operation is not supported (DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT " +
+ "not supported by source or destination
storage plug-in).");
+ }
}
+
if (canHandleSrc) {
throw new UnsupportedOperationException("This
operation is not supported (DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT " +
"not supported by destination storage
plug-in).");
}
+
if (canHandleDest) {
throw new UnsupportedOperationException("This
operation is not supported (DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT " +
"not supported by source storage plug-in).");
}
}
+ } else if (srcData instanceof TemplateInfo && destData instanceof
VolumeInfo) {
+ boolean canHandleSrc = canHandle(srcData);
+
+ if (!canHandleSrc) {
+ throw new UnsupportedOperationException("This operation is
not supported (DataStoreCapabilities.STORAGE_CAN_CREATE_VOLUME_FROM_VOLUME " +
--- End diff --
To aid debugging, please include the name of the destination storage plugin.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---