use of com.vmware.vim25.VirtualMachineSnapshotTree in project vsphere-cloud-plugin by jenkinsci.
the class VSphere method getSnapshotInTree.
public VirtualMachineSnapshot getSnapshotInTree(VirtualMachine vm, String snapName) {
if (vm == null || snapName == null) {
return null;
}
LOGGER.log(Level.FINER, "Looking for snapshot " + snapName + " in " + vm.getName());
VirtualMachineSnapshotInfo info = vm.getSnapshot();
if (info != null) {
VirtualMachineSnapshotTree[] snapTree = info.getRootSnapshotList();
if (snapTree != null) {
ManagedObjectReference mor = findSnapshotInTree(snapTree, snapName);
if (mor != null) {
return new VirtualMachineSnapshot(vm.getServerConnection(), mor);
}
}
}
return null;
}
use of com.vmware.vim25.VirtualMachineSnapshotTree in project cloudstack by apache.
the class VirtualMachineMO method hasSnapshot.
public boolean hasSnapshot() throws Exception {
VirtualMachineSnapshotInfo info = getSnapshotInfo();
if (info != 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;
}
Aggregations