Examples of waitForTask()


Examples of com.vmware.vim25.mo.Task.waitForTask()

        VirtualMachine vm = vmm.getVirtualMachine();
        if (vm == null) { return false; }
       
        try {
            Task task = vm.destroy_Task();
            String ret = task.waitForTask();
            if (ret.equals("success")) {
                logger_.info
                    (String.format
                     ("%s: virtual machine was destroyed successfully.\n", ret));
                return true;
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

    {
      throw new RuntimeException("No free IDE controller for addtional CD Drive.");
    }
   
    Task task = vm.reconfigVM_Task(config);
    task.waitForTask();
  }

  private void validateCdromHostDevice(String hostDevice) throws InvalidProperty, RuntimeFault, RemoteException
  {
    List<String> validCdList = getValidCdromOnHost();
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

    VirtualDeviceConfigSpec [] vdiskSpecArray = {vdiskSpec};        

    vmConfigSpec.setDeviceChange(vdiskSpecArray);
    Task task = vm.reconfigVM_Task(vmConfigSpec);

    task.waitForTask(200, 100);
  }
 
  public void addHardDisk(String diskFilePath, VirtualDiskMode diskMode) throws Exception
  {
    VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

    diskSpec.setOperation(VirtualDeviceConfigSpecOperation.add);          
    diskSpec.setDevice(disk);                
   
    Task task = vm.reconfigVM_Task(vmConfigSpec);

    task.waitForTask(200, 100);
  }
 
  public VirtualDisk findHardDisk(String diskName)
  {
    VirtualDevice[] devices = getAllVirtualDevices();
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

   
    VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
    vmConfigSpec.setDeviceChange(new VirtualDeviceConfigSpec []{nicSpec});
    Task task = vm.reconfigVM_Task(vmConfigSpec);

    task.waitForTask(200, 100);
  }
 
  private VirtualDeviceConfigSpec createNicSpec( VirtualNetworkAdapterType adapterType, String networkName, String macAddress, boolean wakeOnLan, boolean startConnected, ConfigTarget configTarget)
  {
    VirtualDeviceConfigSpec result = null;
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()



  public void powerOffVm(VirtualMachine existingVm) throws TaskInProgress, InvalidState, RuntimeFault, RemoteException, InterruptedException {
    Task task = existingVm.powerOffVM_Task();    
    task.waitForTask();
    System.out.println("vm:" + existingVm.getName() + " powered off.");   
  }


View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

    String vmName=existingVm.getName();

    //Other strategy is to suspend it and rename the machine (so we still have it)
    Task destroytask=existingVm.destroy_Task();
    destroytask.waitForTask();
    System.out.println("vm:" + vmName + " is destroyed");

  }

  public boolean isVmPoweredOn(VirtualMachine vm) {
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

  public void powerOnVm(VirtualMachine newVm) throws VmConfigFault, TaskInProgress, FileFault, InvalidState, InsufficientResourcesFault, RuntimeFault, RemoteException, InterruptedException {
    String vmName=newVm.getName();

    Task powerOnTask=newVm.powerOnVM_Task(null);
    powerOnTask.waitForTask();
    System.out.println("vm"+vmName+" is powered on");

  }

View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

    VirtualMachineConfigSpec vmConfigSpec2 = new VirtualMachineConfigSpec();
    vmConfigSpec2.setExtraConfig(extraConfig);

    Task vnctask =   newVm.reconfigVM_Task(vmConfigSpec2);
    String vncresult=    vnctask.waitForTask();

    if(vncresult == Task.SUCCESS)
    {
      System.out.println("VNC deactivated Sucessfully");
View Full Code Here

Examples of com.vmware.vim25.mo.Task.waitForTask()

    VirtualMachineConfigSpec vmConfigSpec2 = new VirtualMachineConfigSpec();
    vmConfigSpec2.setExtraConfig(extraConfig);
 

    Task vnctask =   newVm.reconfigVM_Task(vmConfigSpec2);
    String vncresult=    vnctask.waitForTask();

    if(vncresult == Task.SUCCESS)
    {
      System.out.println("VNC Set Sucessfully");
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.