Examples of SharesInfo


Examples of com.vmware.vim.binding.vim.SharesInfo

         @Override
         protected Void body() throws Exception {
            List<VirtualDeviceSpec> deviceSpecs =
                  new ArrayList<VirtualDeviceSpec>();
            for (DeviceId slot : vcVm.getVirtualDiskIds()) {
               SharesInfo shares = new SharesInfoImpl();
               shares.setLevel(Level.valueOf(ioShares.toString().toLowerCase()));
               IOAllocationInfo allocationInfo = new IOAllocationInfoImpl();
               allocationInfo.setShares(shares);
               VirtualDisk vmdk = (VirtualDisk) vcVm.getVirtualDevice(slot);
               vmdk.setStorageIOAllocation(allocationInfo);
               VirtualDeviceSpec spec = new VirtualDeviceSpecImpl();
View Full Code Here

Examples of com.vmware.vim.binding.vim.SharesInfo

         shareLevel = Level.normal; // TODO: Automatic implies normal? or...
         break;
      default:
         throw CommonException.INTERNAL();
      }
      SharesInfo shares = new SharesInfoImpl(100, shareLevel);
      spec.setCpuAllocation(new ResourceAllocationInfoImpl(
            resourceSchema.cpuReservationMHz, false /* not expandable */, unlimited,
            shares, null));
      spec.setMemoryAllocation(new ResourceAllocationInfoImpl(
            resourceSchema.memReservationSize, false /* not expandable */, unlimited,
View Full Code Here

Examples of com.vmware.vim.binding.vim.SharesInfo

            getChildVcResourcePool(rp, childRpName);
      if (childVcResourcePool == null) {
         Long reservation = Long.valueOf(0);
         Boolean expandable = Boolean.valueOf(true);
         Long limit = Long.valueOf(-1);
         SharesInfo shares = new SharesInfoImpl();
         if (nodeGroup != null && softManager.isComputeOnlyRoles(nodeGroup.getRoles())) {
            shares.setLevel(SharesInfo.Level.low);
         } else {
            shares.setLevel(SharesInfo.Level.normal);
         }
         ResourceAllocationInfo cpu =
               new ResourceAllocationInfoImpl(reservation, expandable, limit,
                     shares, null);
         ResourceAllocationInfo mem =
View Full Code Here

Examples of com.vmware.vim.binding.vim.SharesInfo

      VcResourcePool grandChildRP = null;

      Long reservation = Long.valueOf(0);
      Boolean expandable = Boolean.valueOf(false);
      Long limit = Long.valueOf(-1);
      SharesInfo shares = new SharesInfoImpl(100, SharesInfo.Level.custom);
      ResourceAllocationInfo cpu = new ResourceAllocationInfoImpl(
            reservation, expandable, limit, shares, null);
      ResourceAllocationInfo mem = new ResourceAllocationInfoImpl(
            reservation, expandable, limit, shares, null);
View Full Code Here

Examples of com.vmware.vim25.SharesInfo

    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);
View Full Code Here

Examples of com.vmware.vim25.SharesInfo

  }

  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
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.