cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [07/20] git commit: updated refs/heads/master to a9f45df
Date Fri, 23 Dec 2016 12:21:14 GMT
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

Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/674bb064
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/674bb064
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/674bb064

Branch: refs/heads/master
Commit: 674bb064a343ea755c2f7dd3e173f8e0de6d2d85
Parents: a0e36b7
Author: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
Authored: Wed Dec 14 01:52:15 2016 +0530
Committer: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
Committed: Thu Dec 22 01:41:33 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/674bb064/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<VirtualMachineSnapshotTree> rootSnapshotList = info.getRootSnapshotList();
+            if (rootSnapshotList != null && rootSnapshotList.size() > 0) {
+                return true;
+            }
         }
         return false;
     }


Mime
View raw message