Package com.vmware.vim25

Examples of com.vmware.vim25.ResourceAllocationInfo


        // VM config for scaling up
        vmConfig.setMemoryMB((long)memoryMB);
        vmConfig.setNumCPUs(cpuCount);

        ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
        if (limitCpuUse) {
            cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
        } else {
            cpuInfo.setLimit(-1L);
        }

        cpuInfo.setReservation((long)cpuReservedMhz);
        vmConfig.setCpuAllocation(cpuInfo);

        ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
        memInfo.setLimit((long)memoryMB);
        memInfo.setReservation((long)memoryReserveMB);
        vmConfig.setMemoryAllocation(memInfo);

    }
View Full Code Here


    // VM config basics
    vmConfig.setMemoryMB((long)memoryMB);
    vmConfig.setNumCPUs(cpuCount);

    ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
    if (limitCpuUse) {
      cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
    } else {
      cpuInfo.setLimit(-1L);
    }

    cpuInfo.setReservation((long)cpuReservedMhz);
    vmConfig.setCpuAllocation(cpuInfo);
     if (cpuSpeedMHz != cpuReservedMhz){
             vmConfig.setCpuHotAddEnabled(true);
         }
        if (memoryMB != memoryReserveMB){
            vmConfig.setMemoryHotAddEnabled(true);
        }
    ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
    memInfo.setLimit((long)memoryMB);
    memInfo.setReservation((long)memoryReserveMB);
    vmConfig.setMemoryAllocation(memInfo);

    vmConfig.setGuestId(guestOsIdentifier);
  }
View Full Code Here

        // VM config for scaling up
        vmConfig.setMemoryMB((long)memoryMB);
        vmConfig.setNumCPUs(cpuCount);

        ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
        if (limitCpuUse) {
            cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
        } else {
            cpuInfo.setLimit(-1L);
        }

        cpuInfo.setReservation((long)cpuReservedMhz);
        vmConfig.setCpuAllocation(cpuInfo);

        ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
        memInfo.setLimit((long)memoryMB);
        memInfo.setReservation((long)memoryReserveMB);
        vmConfig.setMemoryAllocation(memInfo);

    }
View Full Code Here

        // VM config basics
        vmConfig.setMemoryMB((long)memoryMB);
        vmConfig.setNumCPUs(cpuCount);

        ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
        if (limitCpuUse) {
            cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
        } else {
            cpuInfo.setLimit(-1L);
        }

        cpuInfo.setReservation((long)cpuReservedMhz);
        vmConfig.setCpuAllocation(cpuInfo);
        if (cpuSpeedMHz != cpuReservedMhz) {
            vmConfig.setCpuHotAddEnabled(true);
        }
        if (memoryMB != memoryReserveMB) {
            vmConfig.setMemoryHotAddEnabled(true);
        }
        ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
        memInfo.setLimit((long)memoryMB);
        memInfo.setReservation((long)memoryReserveMB);
        vmConfig.setMemoryAllocation(memInfo);

        vmConfig.setGuestId(guestOsIdentifier);
    }
View Full Code Here

   
    // VM config basics
    vmConfig.setMemoryMB((long)memoryMB);
    vmConfig.setNumCPUs(cpuCount);
   
    ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
    if (limitCpuUse) {
      cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
    } else {
      cpuInfo.setLimit(-1L);
    }

    cpuInfo.setReservation((long)cpuReservedMhz);
    vmConfig.setCpuAllocation(cpuInfo);
   
    ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
    memInfo.setLimit((long)memoryMB);
    memInfo.setReservation((long)memoryReserveMB);
    vmConfig.setMemoryAllocation(memInfo);
   
    vmConfig.setGuestId(guestOsIdentifier);
  }
View Full Code Here

    // initialize the system, set up web services
    ServiceInstance si = new ServiceInstance(url, username, password, true);
   
    // create a new VirtualMachineConfigSpec for VM1
    VirtualMachineConfigSpec vmcs1 = new VirtualMachineConfigSpec();
    ResourceAllocationInfo rai1 = new ResourceAllocationInfo();
    SharesInfo si1 = new SharesInfo();
    si1.setLevel(SharesLevel.custom);
    si1.setShares(1333);
    rai1.setShares(si1);
    vmcs1.setCpuAllocation(rai1);

    // do the same for VM2
    VirtualMachineConfigSpec vmcs2 = new VirtualMachineConfigSpec();
    ResourceAllocationInfo rai2 = new ResourceAllocationInfo();
    SharesInfo si2 = new SharesInfo();
    si2.setLevel(SharesLevel.high);
    rai2.setShares(si2);
    vmcs2.setCpuAllocation(rai2);
   
    ManagedObjectReference vm1_mor = createMOR("VirtualMachine", vm1_oid);
    ManagedObjectReference vm2_mor = createMOR("VirtualMachine", vm2_oid);
    VirtualMachine vm1 = (VirtualMachine) MorUtil.createExactManagedEntity(si.getServerConnection(), vm1_mor);
View Full Code Here

    task.waitForMe();
  }

  static ResourceAllocationInfo getShares(String val) throws Exception
  {
    ResourceAllocationInfo raInfo = new ResourceAllocationInfo();
    SharesInfo sharesInfo = new SharesInfo();

    if("high".equalsIgnoreCase(val))
    {
      sharesInfo.setLevel(SharesLevel.high);         
    }
    else if("normal".equalsIgnoreCase(val))
    {
      sharesInfo.setLevel(SharesLevel.normal);
    }
    else if("low".equalsIgnoreCase(val))
    {
      sharesInfo.setLevel(SharesLevel.low);
    }
    else
    {
      sharesInfo.setLevel(SharesLevel.custom);         
      sharesInfo.setShares(Integer.parseInt(val));         
    }   
    raInfo.setShares(sharesInfo);
    return raInfo;
  }
View Full Code Here

        // VM config for scaling up
        vmConfig.setMemoryMB((long)memoryMB);
        vmConfig.setNumCPUs(cpuCount);

        ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
        if (limitCpuUse) {
            cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
        } else {
            cpuInfo.setLimit(-1L);
        }

        cpuInfo.setReservation((long)cpuReservedMhz);
        vmConfig.setCpuAllocation(cpuInfo);

        ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
        memInfo.setLimit((long)memoryMB);
        memInfo.setReservation((long)memoryReserveMB);
        vmConfig.setMemoryAllocation(memInfo);

    }
View Full Code Here

    // VM config basics
    vmConfig.setMemoryMB((long)memoryMB);
    vmConfig.setNumCPUs(cpuCount);

    ResourceAllocationInfo cpuInfo = new ResourceAllocationInfo();
    if (limitCpuUse) {
      cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
    } else {
      cpuInfo.setLimit(-1L);
    }

    cpuInfo.setReservation((long)cpuReservedMhz);
    vmConfig.setCpuAllocation(cpuInfo);
     if (cpuSpeedMHz != cpuReservedMhz){
             vmConfig.setCpuHotAddEnabled(true);
         }
        if (memoryMB != memoryReserveMB){
            vmConfig.setMemoryHotAddEnabled(true);
        }
    ResourceAllocationInfo memInfo = new ResourceAllocationInfo();
    memInfo.setLimit((long)memoryMB);
    memInfo.setReservation((long)memoryReserveMB);
    vmConfig.setMemoryAllocation(memInfo);

    vmConfig.setGuestId(guestOsIdentifier);
  }
View Full Code Here

  public ManagedObjectReference getNetworkMor(String portGroupName) throws Exception {
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("Network");
    pSpec.setPathSet(new String[] {"summary.name"});
   
      TraversalSpec host2NetworkTraversal = new TraversalSpec();
      host2NetworkTraversal.setType("HostSystem");
      host2NetworkTraversal.setPath("network");
      host2NetworkTraversal.setName("host2NetworkTraversal");

      ObjectSpec oSpec = new ObjectSpec();
      oSpec.setObj(_mor);
      oSpec.setSkip(Boolean.TRUE);
      oSpec.setSelectSet(new SelectionSpec[] { host2NetworkTraversal });
View Full Code Here

TOP

Related Classes of com.vmware.vim25.ResourceAllocationInfo

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.