Examples of VirtualMachinePowerState


Examples of com.vmware.vim25.VirtualMachinePowerState

    addCdDrive(null, hostDevice, startConnected);
  }
 
  private void addCdDrive(String isoPath, String hostDevice, boolean startConnected) throws InvalidProperty, RuntimeFault, RemoteException, InterruptedException
  {
    VirtualMachinePowerState powerState = vm.getRuntime().getPowerState();
    if(powerState != VirtualMachinePowerState.poweredOff)
    {
      throw new RuntimeException("VM is not yet powered off for adding a CD drive.");
    }
   
View Full Code Here

Examples of com.vmware.vim25.VirtualMachinePowerState

/** Create a new virtual network adapter on the VM
* Your MAC address should start with 00:50:56
   */
  public void createNetworkAdapter(VirtualNetworkAdapterType type, String networkName, String macAddress, boolean wakeOnLan, boolean startConnected) throws InvalidProperty, RuntimeFault, RemoteException, InterruptedException
  {
    VirtualMachinePowerState powerState = vm.getRuntime().getPowerState();
    String vmVerStr = vm.getConfig().getVersion();
    int vmVer = Integer.parseInt(vmVerStr.substring(vmVerStr.length()-2));
   
    if((powerState == VirtualMachinePowerState.suspended) ||
      (powerState == VirtualMachinePowerState.suspended && vmVer < 7))
View Full Code Here

Examples of com.vmware.vim25.VirtualMachinePowerState

  public Task removeDevices(List<VirtualDevice> deviceList, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException
  {
    List<VirtualDeviceConfigSpec> configSpecList = new ArrayList<VirtualDeviceConfigSpec>();

    boolean allDevicesSupportHotRemoval = allSupportHotRemoval(deviceList);
    VirtualMachinePowerState powerState = vm.getRuntime().getPowerState();
    if (!allDevicesSupportHotRemoval && powerState!= VirtualMachinePowerState.poweredOff )
    {
      throw new RuntimeException("Invalid power state: power off the VM first.");
    }
View Full Code Here

Examples of com.vmware.vim25.VirtualMachinePowerState

                        " Ignoring vm: " + vmName);
                continue;
            }
            // Is it powered on?
            VirtualMachineRuntimeInfo vmRuntimeInfo = vm.getRuntime();
            VirtualMachinePowerState powerState =
                    vmRuntimeInfo.getPowerState();
            if (powerState != VirtualMachinePowerState.poweredOn) {
                s_logger.debug("dvPg: " + dvPgName + " Ignoring vm: " +
                        vmName + " Power State: " + powerState);
                continue;
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.