Package com.vmware.vim25.mo

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


                break;
            default:
                throw new Exception("Snapshot TaskType is wrong.");
            }
            assert task != null;
            String ret = task.waitForTask();
            if (ret.equals("success")) {
                logger_.info(messageInSuccess);
                return true;
            } else {
                logger_.info(messageInFailure);
View Full Code Here


            (specList.toArray(new VirtualDeviceConfigSpec[0]));

        /* reconfigure vm task */
        try {
            Task task = vm_.reconfigVM_Task(vmConfigSpec);
            String ret = task.waitForTask();
            logger_.info(String.format("%s: addDisksToVm()\n", ret));
            if (ret.equals("success")) {
                return true;
            } else {
                return false;
View Full Code Here

            (specList.toArray(new VirtualDeviceConfigSpec[0]));

        /* reconfigure vm task */
        try {
            Task task = vm_.reconfigVM_Task(vmConfigSpec);
            String ret = task.waitForTask();
            logger_.info(String.format("%s: addEmptyDisks()\n", ret));
            if (ret.equals("success")) {
                return true;
            } else {
                return false;
View Full Code Here

        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

    {
      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

    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

    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

   
    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



  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

    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

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.