Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1C5CC200C1D for ; Thu, 16 Feb 2017 07:30:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1B060160B61; Thu, 16 Feb 2017 06:30:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 64AF3160B57 for ; Thu, 16 Feb 2017 07:30:16 +0100 (CET) Received: (qmail 40658 invoked by uid 500); 16 Feb 2017 06:30:15 -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 40647 invoked by uid 99); 16 Feb 2017 06:30:15 -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; Thu, 16 Feb 2017 06:30:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0BDE1DFC31; Thu, 16 Feb 2017 06:30:15 +0000 (UTC) From: karuturi To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request #1913: CLOUDSTACK-9752: [Vmware] Optimization of vol... Content-Type: text/plain Message-Id: <20170216063015.0BDE1DFC31@git1-us-west.apache.org> Date: Thu, 16 Feb 2017 06:30:15 +0000 (UTC) archived-at: Thu, 16 Feb 2017 06:30:17 -0000 Github user karuturi commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1913#discussion_r101452884 --- Diff: plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java --- @@ -1577,11 +1577,15 @@ public Answer createVolume(CreateObjectCommand cmd) { } synchronized (this) { - // s_logger.info("Delete file if exists in datastore to clear the way for creating the volume. file: " + volumeDatastorePath); - VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, volumeUuid.toString(), dcMo); - - vmMo.createDisk(volumeDatastorePath, (int)(volume.getSize() / (1024L * 1024L)), morDatastore, vmMo.getScsiDeviceControllerKey()); - vmMo.detachDisk(volumeDatastorePath, false); + try { + vmMo.createDisk(volumeDatastorePath, (int)(volume.getSize() / (1024L * 1024L)), morDatastore, vmMo.getScsiDeviceControllerKey()); + vmMo.detachDisk(volumeDatastorePath, false); + } + catch (Exception e) { + s_logger.error("Deleting file " + volumeDatastorePath + " due to error: " + e.getMessage()); + VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, volumeUuid.toString(), dcMo); --- End diff -- This Looks good. Thanks for the update @nvazquez --- 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. ---