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 D191F200BE8 for ; Fri, 23 Dec 2016 13:21:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D08B7160B37; Fri, 23 Dec 2016 12:21:33 +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 36B77160B1E for ; Fri, 23 Dec 2016 13:21:33 +0100 (CET) Received: (qmail 83074 invoked by uid 500); 23 Dec 2016 12:21:31 -0000 Mailing-List: contact commits-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 commits@cloudstack.apache.org Received: (qmail 82765 invoked by uid 99); 23 Dec 2016 12:21:31 -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, 23 Dec 2016 12:21:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DA150DFE1D; Fri, 23 Dec 2016 12:21:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Date: Fri, 23 Dec 2016 12:21:40 -0000 Message-Id: <4561d5eb24ac4dc296f9d28d4cb8932a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/19] git commit: updated refs/heads/4.9 to 20986ba archived-at: Fri, 23 Dec 2016 12:21:34 -0000 CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots Issue ==== Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM. Per the code that detects the presence of a snapshot, we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree. The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM. This results in start failure. Fix === Ensure correct detection of VM snapshots in the VM snapshot tree This closes #1828 Signed-off-by: Sateesh Chodapuneedi (cherry picked from commit 673bb25b5936d1c54e9210781280e9ddc507c830) Signed-off-by: Rohit Yadav Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b0535d77 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b0535d77 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b0535d77 Branch: refs/heads/4.9 Commit: b0535d770d108ae219149b5a115c8953d89691d9 Parents: 7d678df Author: Sateesh Chodapuneedi Authored: Wed Dec 14 01:52:15 2016 +0530 Committer: Rohit Yadav Committed: Thu Dec 22 13:29:07 2016 +0530 ---------------------------------------------------------------------- .../com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b0535d77/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java ---------------------------------------------------------------------- diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java index 8b9d4e7..22c0b5a 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java @@ -661,7 +661,14 @@ public class VirtualMachineMO extends BaseMO { public boolean hasSnapshot() throws Exception { VirtualMachineSnapshotInfo info = getSnapshotInfo(); if (info != null) { - return info.getCurrentSnapshot() != null; + ManagedObjectReference currentSnapshot = info.getCurrentSnapshot(); + if (currentSnapshot != null) { + return true; + } + List rootSnapshotList = info.getRootSnapshotList(); + if (rootSnapshotList != null && rootSnapshotList.size() > 0) { + return true; + } } return false; }