Package com.vmware.vim25

Examples of com.vmware.vim25.ManagedObjectReference


        deviceConfigSpec.setFileOperation(deviceTernary.third());
        deviceConfigSpecArray[i++] = deviceConfigSpec;
      }
      configSpec.getDeviceChange().addAll(Arrays.asList(deviceConfigSpecArray));

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, configSpec);

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


      deviceConfigSpec.setFileOperation(VirtualDeviceConfigSpecFileOperation.CREATE);
      deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);

      reConfigSpec.getDeviceChange().add(deviceConfigSpec);

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
    boolean result = _context.getVimClient().waitForTask(morTask);

    if(!result) {
      if(s_logger.isTraceEnabled())
        s_logger.trace("vCenter API trace - createDisk() done(failed)");
View Full Code Here

      deviceConfigSpec.setDevice(newDisk);
      deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);

      reConfigSpec.getDeviceChange().add(deviceConfigSpec);

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
    boolean result = _context.getVimClient().waitForTask(morTask);

    if(!result) {
      if(s_logger.isTraceEnabled())
        s_logger.trace("vCenter API trace - attachDisk() done(failed)");
View Full Code Here

      deviceConfigSpec.setDevice(newDisk);
      deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);

      reConfigSpec.getDeviceChange().add(deviceConfigSpec);

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
    boolean result = _context.getVimClient().waitForTask(morTask);

    if(!result) {
      if(s_logger.isTraceEnabled())
        s_logger.trace("vCenter API trace - attachDisk() done(failed)");
View Full Code Here

        }
      deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.REMOVE);

      reConfigSpec.getDeviceChange().add(deviceConfigSpec);

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
    boolean result = _context.getVimClient().waitForTask(morTask);

    if(!result) {
      if(s_logger.isTraceEnabled())
        s_logger.trace("vCenter API trace - detachDisk() done (failed)");
View Full Code Here

        deviceConfigSpecArray[i].setDevice(disks[i]);
        deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.REMOVE);
      }
        reConfigSpec.getDeviceChange().addAll(Arrays.asList(deviceConfigSpecArray));

        ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
      boolean result = _context.getVimClient().waitForTask(morTask);

      if(!result) {
        if(s_logger.isTraceEnabled())
          s_logger.trace("vCenter API trace - detachAllDisk() done(failed)");
View Full Code Here

        }

      //deviceConfigSpecArray[0] = deviceConfigSpec;
      reConfigSpec.getDeviceChange().add(deviceConfigSpec);

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
    boolean result = _context.getVimClient().waitForTask(morTask);

    if(!result) {
      if(s_logger.isTraceEnabled())
        s_logger.trace("vCenter API trace - detachIso() done(failed)");
View Full Code Here

      deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.EDIT);

      //deviceConfigSpecArray[0] = deviceConfigSpec;
      reConfigSpec.getDeviceChange().add(deviceConfigSpec);

      ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);
    boolean result = _context.getVimClient().waitForTask(morTask);

    if(!result) {
      if(s_logger.isTraceEnabled())
        s_logger.trace("vCenter API trace - detachIso() done(failed)");
View Full Code Here

    }
    return result;
  }

  public void exportVm(String exportDir, String exportName, boolean packToOva, boolean leaveOvaFileOnly) throws Exception {
    ManagedObjectReference morOvf = _context.getServiceContent().getOvfManager();

    VirtualMachineRuntimeInfo runtimeInfo = getRuntimeInfo();
    HostMO hostMo = new HostMO(_context, runtimeInfo.getHost());
    String hostName = hostMo.getHostName();
    String vmName = getVmName();

    DatacenterMO dcMo = new DatacenterMO(_context, hostMo.getHyperHostDatacenter());

    if(runtimeInfo.getPowerState() != VirtualMachinePowerState.POWERED_OFF) {
      String msg = "Unable to export VM because it is not at powerdOff state. vmName: " + vmName + ", host: " + hostName;
      s_logger.error(msg);
      throw new Exception(msg);
    }

    ManagedObjectReference morLease = _context.getService().exportVm(getMor());
    if(morLease == null) {
      s_logger.error("exportVm() failed");
      throw new Exception("exportVm() failed");
    }
View Full Code Here

    }
  }

    public GuestOsDescriptor getGuestOsDescriptor(String guestOsId) throws Exception {
        GuestOsDescriptor guestOsDescriptor = null;
        ManagedObjectReference vmEnvironmentBrowser =
                _context.getVimClient().getMoRefProp(_mor, "environmentBrowser");
        VirtualMachineConfigOption  vmConfigOption = _context.getService().queryConfigOption(vmEnvironmentBrowser, null, null);
        List<GuestOsDescriptor> guestDescriptors = vmConfigOption.getGuestOSDescriptor();
        for (GuestOsDescriptor descriptor : guestDescriptors) {
            if (guestOsId != null && guestOsId.equalsIgnoreCase(descriptor.getId())) {
View Full Code Here

TOP

Related Classes of com.vmware.vim25.ManagedObjectReference

Copyright © 2018 www.massapicom. 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.