Package com.vmware.vim25

Examples of com.vmware.vim25.TaskInfo


   
    System.out.println("\nRecent tasks:");
    Task[] recentTasks = taskMgr.getRecentTasks();
    for(int i=0; recentTasks!=null && i<recentTasks.length; i++)
    {
      TaskInfo ti = recentTasks[i].getTaskInfo();
      System.out.println("\nName:" + ti.getName());
      System.out.println("Key:" + ti.getKey());
      System.out.println("State:" + ti.getState());
    }
    si.getServerConnection().logout();
  }
View Full Code Here


      System.out.println("VMotioned!");
    }
    else
    {
      System.out.println("VMotion failed!");
      TaskInfo info = task.getTaskInfo();
      System.out.println(info.getError().getFault());
    }
    si.getServerConnection().logout();
  }
View Full Code Here

    {        
      return SUCCESS;
    }
    else
    {
      TaskInfo tinfo = (TaskInfo) getCurrentProperty(PROPNAME_INFO);        
      LocalizedMethodFault fault = tinfo.getError();
      String error = "Error Occured";
      if(fault!=null)
      {
        MethodFault mf = fault.getFault();
        throw mf;
View Full Code Here

            // wait if there are already VM snapshot task running
            ManagedObjectReference taskmgr = context.getServiceContent().getTaskManager();
            List<ManagedObjectReference> tasks = (ArrayList<ManagedObjectReference>)context.getVimClient().getDynamicProperty(taskmgr, "recentTask");

            for (ManagedObjectReference taskMor : tasks) {
                TaskInfo info = (TaskInfo)(context.getVimClient().getDynamicProperty(taskMor, "info"));

                if (info.getEntityName().equals(cmd.getVmName()) && info.getName().equalsIgnoreCase("CreateSnapshot_Task")) {
                    s_logger.debug("There is already a VM snapshot task running, wait for it");
                    context.getVimClient().waitForTask(taskMor);
                }
            }
View Full Code Here

            // wait if there are already VM revert task running
            ManagedObjectReference taskmgr = context.getServiceContent().getTaskManager();
            List<ManagedObjectReference> tasks = (ArrayList<ManagedObjectReference>)context.getVimClient().getDynamicProperty(taskmgr, "recentTask");

            for (ManagedObjectReference taskMor : tasks) {
                TaskInfo info = (TaskInfo)(context.getVimClient().getDynamicProperty(taskMor, "info"))
;
                if (info.getEntityName().equals(cmd.getVmName()) && info.getName().equalsIgnoreCase("RevertToSnapshot_Task")) {
                    s_logger.debug("There is already a VM snapshot task running, wait for it");
                    context.getVimClient().waitForTask(taskMor);
                }
            }
View Full Code Here

            isScsi = false;
            ctrl = new VirtualIDEController();
            break;
        case BUSLOGIC:
            isScsi = true;
            ctrl = new VirtualBusLogicController();
            break;
        case LSILOGIC:
            isScsi = true;
            ctrl = new VirtualLsiLogicController();
            break;
View Full Code Here

    {
        VirtualDeviceConfigSpec controllerSpec =
            new VirtualDeviceConfigSpec();
        controllerSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

        VirtualController ctrl = null;
        boolean isScsi = true;
       
        switch(type_) {
        case IDE:
            isScsi = false;
            ctrl = new VirtualIDEController();
            break;
        case BUSLOGIC:
            isScsi = true;
            ctrl = new VirtualBusLogicController();
            break;
        case LSILOGIC:
            isScsi = true;
            ctrl = new VirtualLsiLogicController();
            break;
        case LSILOGICSAS:
            isScsi = true;
            ctrl = new VirtualLsiLogicSASController();
            break;
        default:
            return null;
        }

        ctrl.setKey(ckey_);
        ctrl.setBusNumber(busNumber_);
        if (isScsi) {
            assert ctrl instanceof VirtualSCSIController;
            VirtualSCSIController scsiCtrl = (VirtualSCSIController) ctrl;
            scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing);
        }
View Full Code Here

     * @param ckey key of the controller device.
     * @return Adapter type. This does not return null.
     */
    private AdapterType getAdapterType(int ckey)
    {
        VirtualDevice vd = searchVirtualDeviceWithKey(ckey);
        if (vd == null) {
            return AdapterType.UNKNOWN;
        }
        assert vd.getKey() == ckey;

        AdapterType ret = AdapterType.UNKNOWN;
        if (vd instanceof VirtualIDEController) {
            ret = AdapterType.IDE;
        } else if (vd instanceof VirtualBusLogicController) {
View Full Code Here

     * @param ckey key of the controller device.
     * @return busNumber in success, or -1 in failure.
     */
    private int getBusNumber(int ckey)
    {
        VirtualDevice vd = searchVirtualDeviceWithKey(ckey);
        if (vd == null) { return -1; }

        if (vd instanceof VirtualController) {
            return ((VirtualController) vd).getBusNumber();
        } else {
View Full Code Here

     * @param ckey key of the disk device.
     * @return unitNumber in success, or -1 in failure.
     */
    private int getUnitNumber(int key)
    {
        VirtualDevice vd = searchVirtualDeviceWithKey(key);
        if (vd == null) { return -1; }

        if (vd instanceof VirtualDisk) {
            return ((VirtualDisk) vd).getUnitNumber();
        } else {
View Full Code Here

TOP

Related Classes of com.vmware.vim25.TaskInfo

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.