Package com.vmware.vim25

Examples of com.vmware.vim25.VirtualMachinePowerState


                        for(ObjectContent oc : ocs) {
                            DynamicProperty[] props = oc.getPropSet();
                            if(props != null) {
                                String name = null;
                                boolean template = false;
                                VirtualMachinePowerState powerState = VirtualMachinePowerState.poweredOff;
                                GregorianCalendar bootTime = null;
                               
                                for(DynamicProperty prop : props) {
                                    if(prop.getName().equals("name"))
                                        name = prop.getVal().toString();
View Full Code Here


                DynamicProperty[] objProps = oc.getPropSet();
                if (objProps != null) {

                    boolean isTemplate = false;
                    String name = null;
                    VirtualMachinePowerState powerState = VirtualMachinePowerState.poweredOff;
                    for (DynamicProperty objProp : objProps) {
                        if (objProp.getName().equals("config.template")) {
                            if (objProp.getVal().toString().equalsIgnoreCase("true")) {
                                isTemplate = true;
                            }
View Full Code Here

    return false;
  }
 
  public VirtualMachinePowerState getPowerState() throws Exception {
     
      VirtualMachinePowerState powerState = VirtualMachinePowerState.poweredOff;
     
      // This is really ugly, there is a case that when windows guest VM is doing sysprep, the temporary
      // rebooting process may let us pick up a "poweredOff" state during VMsync process, this can trigger
      // a series actions. Unfortunately, from VMware API we can not distinguish power state into such details.
      // We hope by giving it 3 second to re-read the state can cover this as a short-term solution.
View Full Code Here

    return false;
  }

  public VirtualMachinePowerState getResetSafePowerState() throws Exception {

      VirtualMachinePowerState powerState = VirtualMachinePowerState.POWERED_OFF;

      // This is really ugly, there is a case that when windows guest VM is doing sysprep, the temporary
      // rebooting process may let us pick up a "poweredOff" state during VMsync process, this can trigger
      // a series actions. Unfortunately, from VMware API we can not distinguish power state into such details.
      // We hope by giving it 3 second to re-read the state can cover this as a short-term solution.
View Full Code Here

                        for(ObjectContent oc : ocs) {
                            DynamicProperty[] props = oc.getPropSet();
                            if(props != null) {
                                String name = null;
                                boolean template = false;
                                VirtualMachinePowerState powerState = VirtualMachinePowerState.poweredOff;
                                GregorianCalendar bootTime = null;

                                for(DynamicProperty prop : props) {
                                    if(prop.getName().equals("name"))
                                        name = prop.getVal().toString();
View Full Code Here

                DynamicProperty[] objProps = oc.getPropSet();
                if (objProps != null) {

                    boolean isTemplate = false;
                    String name = null;
                    VirtualMachinePowerState powerState = VirtualMachinePowerState.poweredOff;
                    for (DynamicProperty objProp : objProps) {
                        if (objProp.getName().equals("config.template")) {
                            if (objProp.getVal().toString().equalsIgnoreCase("true")) {
                                isTemplate = true;
                            }
View Full Code Here

                if (objProps != null) {

                    boolean isTemplate = false;
                    String name = null;
                    String VMInternalCSName = null;
                    VirtualMachinePowerState powerState = VirtualMachinePowerState.POWERED_OFF;
                    for (DynamicProperty objProp : objProps) {
                        if (objProp.getName().equals("config.template")) {
                            if (objProp.getVal().toString().equalsIgnoreCase("true")) {
                                isTemplate = true;
                            }
View Full Code Here

                if (objProps != null) {

                    boolean isTemplate = false;
                    String name = null;
                    String VMInternalCSName = null;
                    VirtualMachinePowerState powerState = VirtualMachinePowerState.POWERED_OFF;
                    for (DynamicProperty objProp : objProps) {
                        if (objProp.getName().equals("config.template")) {
                            if (objProp.getVal().toString().equalsIgnoreCase("true")) {
                                isTemplate = true;
                            }
View Full Code Here

    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

/** 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

TOP

Related Classes of com.vmware.vim25.VirtualMachinePowerState

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.