Java 类com.vmware.vim25.VirtualMachineSnapshotInfo 实例源码

项目:cloudstack    文件:VirtualMachineMO.java   
public boolean removeAllSnapshots() throws Exception {
    VirtualMachineSnapshotInfo snapshotInfo = getSnapshotInfo();

    if (snapshotInfo != null && snapshotInfo.getRootSnapshotList() != null) {
        List<VirtualMachineSnapshotTree> tree = snapshotInfo.getRootSnapshotList();
        for (VirtualMachineSnapshotTree treeNode : tree) {
            ManagedObjectReference morTask = _context.getService().removeSnapshotTask(treeNode.getSnapshot(), true, true);
            boolean result = _context.getVimClient().waitForTask(morTask);
            if (result) {
                _context.waitForTaskProgressDone(morTask);
            } else {
                s_logger.error("VMware removeSnapshot_Task failed due to " + TaskMO.getTaskFailureInfo(_context, morTask));
                return false;
            }
        }
    }

    return true;
}
项目:oscm    文件:VMwareClient.java   
public ManagedObjectReference findSnapshot(String vmName, String snapshotId)
        throws Exception {

    ManagedObjectReference vm = getVirtualMachine(vmName);
    VirtualMachineSnapshotInfo info = (VirtualMachineSnapshotInfo) getServiceUtil()
            .getDynamicProperty(vm, PROPERTY_SNAPSHOT);
    if (info == null) {
        return null;
    }
    return searchSnapshot(info.getRootSnapshotList(), snapshotId);
}
项目:development    文件:VMwareClient.java   
public ManagedObjectReference findSnapshot(String vmName, String snapshotId)
        throws Exception {

    ManagedObjectReference vm = getVirtualMachine(vmName);
    VirtualMachineSnapshotInfo info = (VirtualMachineSnapshotInfo) getServiceUtil()
            .getDynamicProperty(vm, PROPERTY_SNAPSHOT);
    if (info == null) {
        return null;
    }
    return searchSnapshot(info.getRootSnapshotList(), snapshotId);
}
项目:vijava    文件:VMSnapshot.java   
static void listSnapshots(VirtualMachine vm)
{
  if(vm==null)
  {
    return;
  }
  VirtualMachineSnapshotInfo snapInfo = vm.getSnapshot();
  VirtualMachineSnapshotTree[] snapTree = 
    snapInfo.getRootSnapshotList();
  printSnapshots(snapTree);
}
项目:cloudstack    文件:VirtualMachineMO.java   
public ManagedObjectReference getSnapshotMor(String snapshotName) throws Exception {
    VirtualMachineSnapshotInfo info = getSnapshotInfo();
    if (info != null) {
        List<VirtualMachineSnapshotTree> snapTree = info.getRootSnapshotList();
        return VmwareHelper.findSnapshotInTree(snapTree, snapshotName);
    }
    return null;
}
项目:cloudstack    文件:VirtualMachineMO.java   
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;
}
项目:cloudstack    文件:VirtualMachineMO.java   
public VirtualMachineSnapshotInfo getSnapshotInfo() throws Exception {
    return (VirtualMachineSnapshotInfo)_context.getVimClient().getDynamicProperty(_mor, "snapshot");
}