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 9486E1978F for ; Fri, 8 Apr 2016 19:30:34 +0000 (UTC) Received: (qmail 12923 invoked by uid 500); 8 Apr 2016 19:30:34 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 12866 invoked by uid 500); 8 Apr 2016 19:30:34 -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 12855 invoked by uid 99); 8 Apr 2016 19:30:33 -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:30:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B288EDFC6F; Fri, 8 Apr 2016 19:30:33 +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: <20160408193033.B288EDFC6F@git1-us-west.apache.org> Date: Fri, 8 Apr 2016 19:30:33 +0000 (UTC) Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1403#discussion_r59077297 --- Diff: engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java --- @@ -255,99 +448,153 @@ private Void handleCreateVolumeFromSnapshotBothOnStorageSystem(SnapshotInfo snap VolumeApiResult result = future.get(); + if (volumeDetail != null) { + _volumeDetailsDao.remove(volumeDetail.getId()); + } + if (result.isFailed()) { s_logger.debug("Failed to create a volume: " + result.getResult()); throw new CloudRuntimeException(result.getResult()); } - } - catch (Exception ex) { - throw new CloudRuntimeException(ex.getMessage()); - } - volumeInfo = _volumeDataFactory.getVolume(volumeInfo.getId(), volumeInfo.getDataStore()); + volumeInfo = _volumeDataFactory.getVolume(volumeInfo.getId(), volumeInfo.getDataStore()); - volumeInfo.processEvent(Event.MigrationRequested); + volumeInfo.processEvent(Event.MigrationRequested); - volumeInfo = _volumeDataFactory.getVolume(volumeInfo.getId(), volumeInfo.getDataStore()); + volumeInfo = _volumeDataFactory.getVolume(volumeInfo.getId(), volumeInfo.getDataStore()); - HostVO hostVO = getHost(snapshotInfo.getDataStore().getId()); + if (useCloning) { + copyCmdAnswer = performResignature(volumeInfo, hostVO); + } + else { + // asking for a XenServer host here so we don't always prefer to use XenServer hosts that support resigning + // even when we don't need those hosts to do this kind of copy work + hostVO = getHost(snapshotInfo.getDataCenterId(), false); - String value = _configDao.getValue(Config.PrimaryStorageDownloadWait.toString()); - int primaryStorageDownloadWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue())); - CopyCommand copyCommand = new CopyCommand(snapshotInfo.getTO(), volumeInfo.getTO(), primaryStorageDownloadWait, VirtualMachineManager.ExecuteInSequence.value()); + copyCmdAnswer = performCopyOfVdi(volumeInfo, snapshotInfo, hostVO); + } - CopyCmdAnswer copyCmdAnswer = null; + if (copyCmdAnswer == null || !copyCmdAnswer.getResult()) { + if (copyCmdAnswer != null && !StringUtils.isEmpty(copyCmdAnswer.getDetails())) { + errMsg = copyCmdAnswer.getDetails(); + } + else { + errMsg = "Unable to perform host-side operation"; + } + } + } + catch (Exception ex) { --- End diff -- Why are all checked and unchecked exceptions being caught? --- 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. ---