Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 68C0019689 for ; Fri, 8 Apr 2016 19:05:40 +0000 (UTC) Received: (qmail 32118 invoked by uid 500); 8 Apr 2016 19:05:40 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 32085 invoked by uid 500); 8 Apr 2016 19:05:40 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 32074 invoked by uid 99); 8 Apr 2016 19:05:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2016 19:05:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 852E1DFC6C; Fri, 8 Apr 2016 19:05:39 +0000 (UTC) From: jburwell To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: Taking fast and efficient volume snapshot... Content-Type: text/plain Message-Id: <20160408190539.852E1DFC6C@git1-us-west.apache.org> Date: Fri, 8 Apr 2016 19:05:39 +0000 (UTC) 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---