Examples of VirtualMachineFileInfo


Examples of com.vmware.vim25.VirtualMachineFileInfo

  }

  public String[] getCurrentSnapshotDiskChainDatastorePaths(String diskDevice) throws Exception {
    HostMO hostMo = getRunningHost();
    List<Pair<ManagedObjectReference, String>> mounts = hostMo.getDatastoreMountsOnHost();
    VirtualMachineFileInfo vmFileInfo = getFileInfo();

    SnapshotDescriptor descriptor = getSnapshotDescriptor();
    SnapshotInfo[] snapshotInfo = descriptor.getCurrentDiskChain();

    List<String> diskDsFullPaths = new ArrayList<String>();
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

      pathList.add(new Pair<String, ManagedObjectReference>(diskBackingInfo.getFileName(), diskBackingInfo.getDatastore()));
      return pathList;
    }

    Pair<DatacenterMO, String> dcPair = getOwnerDatacenter();
    VirtualMachineFileInfo vmFilesInfo = getFileInfo();
    DatastoreFile snapshotDirFile = new DatastoreFile(vmFilesInfo.getSnapshotDirectory());
    DatastoreFile vmxDirFile = new DatastoreFile(vmFilesInfo.getVmPathName());

    do {
      if(diskBackingInfo.getParent() != null) {
        pathList.add(new Pair<String, ManagedObjectReference>(diskBackingInfo.getFileName(), diskBackingInfo.getDatastore()));
        diskBackingInfo = diskBackingInfo.getParent();
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

        }
    }

  public void redoRegistration(ManagedObjectReference morHost) throws Exception {
    String vmName = getVmName();
    VirtualMachineFileInfo vmFileInfo = getFileInfo();
    boolean isTemplate = isTemplate();

    HostMO hostMo;
    if(morHost != null)
      hostMo = new HostMO(getContext(), morHost);
    else
      hostMo = getRunningHost();

    ManagedObjectReference morFolder = getParentMor();
    ManagedObjectReference morPool = hostMo.getHyperHostOwnerResourcePool();

    _context.getService().unregisterVM(_mor);

    ManagedObjectReference morTask = _context.getService().registerVMTask(
         morFolder,
         vmFileInfo.getVmPathName(),
         vmName, false,
         morPool, hostMo.getMor());

    boolean result = _context.getVimClient().waitForTask(morTask);
    if (!result) {
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

                VirtualMachineConfigSpec vmConfig = new VirtualMachineConfigSpec();
                vmConfig.setName(workerVmName);
                vmConfig.setMemoryMB((long) 4);
                vmConfig.setNumCPUs(1);
                vmConfig.setGuestId(VirtualMachineGuestOsIdentifier._otherGuest.toString());
                VirtualMachineFileInfo fileInfo = new VirtualMachineFileInfo();
                fileInfo.setVmPathName(String.format("[%s]", dsMo.getName()));
                vmConfig.setFiles(fileInfo);

                // Scsi controller
                VirtualLsiLogicController scsiController = new VirtualLsiLogicController();
                scsiController.setSharedBus(VirtualSCSISharing.noSharing);
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

        VirtualMachineConfigSpec vmConfig = new VirtualMachineConfigSpec();
        vmConfig.setName(vmName);
        vmConfig.setMemoryMB((long) 4); // vmware request minimum of 4 MB
        vmConfig.setNumCPUs(1);
        vmConfig.setGuestId(VirtualMachineGuestOsIdentifier._otherGuest.toString());
        VirtualMachineFileInfo fileInfo = new VirtualMachineFileInfo();
        fileInfo.setVmPathName(String.format("[%s]", dsMo.getName()));
        vmConfig.setFiles(fileInfo);

        // Scsi controller
        VirtualLsiLogicController scsiController = new VirtualLsiLogicController();
        scsiController.setSharedBus(VirtualSCSISharing.noSharing);
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

  }
 
  public String[] getCurrentSnapshotDiskChainDatastorePaths(String diskDevice) throws Exception {
    HostMO hostMo = getRunningHost();
    List<Pair<ManagedObjectReference, String>> mounts = hostMo.getDatastoreMountsOnHost();
    VirtualMachineFileInfo vmFileInfo = getFileInfo();
   
    SnapshotDescriptor descriptor = getSnapshotDescriptor();
    SnapshotInfo[] snapshotInfo = descriptor.getCurrentDiskChain();
   
    List<String> diskDsFullPaths = new ArrayList<String>();
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

      pathList.add(new Pair<String, ManagedObjectReference>(diskBackingInfo.getFileName(), diskBackingInfo.getDatastore()));
      return pathList;
    }
   
    Pair<DatacenterMO, String> dcPair = getOwnerDatacenter();
    VirtualMachineFileInfo vmFilesInfo = getFileInfo();
    DatastoreFile snapshotDirFile = new DatastoreFile(vmFilesInfo.getSnapshotDirectory());
    DatastoreFile vmxDirFile = new DatastoreFile(vmFilesInfo.getVmPathName());
   
    do {
      if(diskBackingInfo.getParent() != null) {
        pathList.add(new Pair<String, ManagedObjectReference>(diskBackingInfo.getFileName(), diskBackingInfo.getDatastore()));
        diskBackingInfo = diskBackingInfo.getParent();
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

    _context.getService().unmountToolsInstaller(_mor);
  }
 
  public void redoRegistration(ManagedObjectReference morHost) throws Exception {
    String vmName = getVmName();
    VirtualMachineFileInfo vmFileInfo = getFileInfo();
    boolean isTemplate = isTemplate();
   
    HostMO hostMo;
    if(morHost != null)
      hostMo = new HostMO(getContext(), morHost);
    else
      hostMo = getRunningHost();
   
    ManagedObjectReference morFolder = getParentMor();
    ManagedObjectReference morPool = hostMo.getHyperHostOwnerResourcePool();
   
    _context.getService().unregisterVM(_mor);
   
    ManagedObjectReference morTask = _context.getService().registerVM_Task(
         morFolder,
         vmFileInfo.getVmPathName(),
         vmName, false,
         morPool, hostMo.getMor());
     
    String result = _context.getServiceUtil().waitForTask(morTask);
    if (!result.equalsIgnoreCase("Sucess")) {
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

        _context.getServiceContent().getPropertyCollector(),
        new PropertyFilterSpec[] { pfSpec });
      assert(ocs != null);

      String vmName = null;
      VirtualMachineFileInfo fileInfo = null;
     
      assert(ocs.length == 1);
      for(ObjectContent oc : ocs) {
        DynamicProperty[] props = oc.getPropSet();
        if(props != null) {
          assert(props.length == 2);
         
          for(DynamicProperty prop : props) {
            if(prop.getName().equals("name")) {
              vmName = prop.getVal().toString();
            } else {
              fileInfo = (VirtualMachineFileInfo)prop.getVal()
            }
          }
        }
      }
      assert(vmName != null);
      assert(fileInfo != null);

      // .vmsd file exists at the same directory of .vmx file
      DatastoreFile vmxFile = new DatastoreFile(fileInfo.getVmPathName());
      return vmxFile.getCompanionPath(vmName + ".vmsd");
  }
View Full Code Here

Examples of com.vmware.vim25.VirtualMachineFileInfo

  public String[] getHttpAccessPathInfo() throws Exception {
    String[] pathInfo = new String[3];
   
    Pair<DatacenterMO, String> dcInfo = getOwnerDatacenter();
   
    VirtualMachineFileInfo fileInfo = getFileInfo();
    String vmxFilePath = fileInfo.getVmPathName();
    String vmxPathTokens[] = vmxFilePath.split("\\[|\\]|/");
    assert(vmxPathTokens.length == 4);
    pathInfo[1] = vmxPathTokens[1].trim();              // vSphere vm name
    pathInfo[2] = dcInfo.second();                  // vSphere datacenter name
    pathInfo[3] = vmxPathTokens[0].trim();              // vSphere datastore name
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.