mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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>
This commit is contained in:
parent
a0e36b73ae
commit
674bb064a3
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user