Package com.vmware.vim25

Examples of com.vmware.vim25.DVSTrafficShapingPolicy


        }
        return morDvPortGroup;
    }

    public static boolean isSpecMatch(DVPortgroupConfigInfo configInfo, Integer vid, DVSTrafficShapingPolicy shapingPolicy) {
        DVSTrafficShapingPolicy currentTrafficShapingPolicy;
        currentTrafficShapingPolicy = configInfo.getDefaultPortConfig().getInShapingPolicy();

        assert(currentTrafficShapingPolicy != null);

        LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth();
        LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize();
        LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth();
        BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled();

        if (!isEnabled.equals(shapingPolicy.getEnabled())) {
            return false;
        }
View Full Code Here


        dvsPortSetting.setOutShapingPolicy(shapingPolicy);
        return dvsPortSetting;
    }

    public static DVSTrafficShapingPolicy getDVSShapingPolicy(Integer networkRateMbps) {
        DVSTrafficShapingPolicy shapingPolicy = new DVSTrafficShapingPolicy();
        if (networkRateMbps == null || networkRateMbps.intValue() <= 0) {
            return shapingPolicy;
        }
        shapingPolicy = new DVSTrafficShapingPolicy();
        BoolPolicy isEnabled = new BoolPolicy();
        LongPolicy averageBandwidth = new LongPolicy();
        LongPolicy peakBandwidth = new LongPolicy();
        LongPolicy burstSize = new LongPolicy();

        isEnabled.setValue(true);
        averageBandwidth.setValue(networkRateMbps.intValue() * 1024L * 1024L);
        // We chose 50% higher allocation than average bandwidth.
        // TODO(sateesh): Also let user specify the peak coefficient
        peakBandwidth.setValue((long) (averageBandwidth.getValue() * 1.5));
        // TODO(sateesh): Also let user specify the burst coefficient
        burstSize.setValue(5 * averageBandwidth.getValue() / 8);

        shapingPolicy.setEnabled(isEnabled);
        shapingPolicy.setAverageBandwidth(averageBandwidth);
        shapingPolicy.setPeakBandwidth(peakBandwidth);
        shapingPolicy.setBurstSize(burstSize);

        return shapingPolicy;
    }
View Full Code Here

    return morDvPortGroup;
  }

    // This method would be used for VMware Distributed Virtual Switch.
  private static boolean isSpecMatch(DVPortgroupConfigInfo spec, Integer vid, DVSTrafficShapingPolicy shapingPolicy) {
    DVSTrafficShapingPolicy currentTrafficShapingPolicy;
    currentTrafficShapingPolicy = spec.getDefaultPortConfig().getInShapingPolicy();
    // TODO(sateesh): Extract and compare vendor specific configuration specification as well.
    // DistributedVirtualSwitchKeyedOpaqueBlob[] vendorSpecificConfig = spec.getVendorSpecificConfig();
   
    assert(currentTrafficShapingPolicy != null);
   
    LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth();
    LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize();
    LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth();
    BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled();
   
    if(!isEnabled.getValue())
      return false;
   
    if(averageBandwidth != null && !averageBandwidth.equals(shapingPolicy.getAverageBandwidth())) {
View Full Code Here

    return morDvPortGroup;
  }

    // This method would be used for VMware Distributed Virtual Switch.
  private static boolean isSpecMatch(DVPortgroupConfigInfo spec, Integer vid, DVSTrafficShapingPolicy shapingPolicy) {
    DVSTrafficShapingPolicy currentTrafficShapingPolicy;
    currentTrafficShapingPolicy = spec.getDefaultPortConfig().getInShapingPolicy();
    // TODO(sateesh): Extract and compare vendor specific configuration specification as well.
    // DistributedVirtualSwitchKeyedOpaqueBlob[] vendorSpecificConfig = spec.getVendorSpecificConfig();
   
    assert(currentTrafficShapingPolicy != null);
   
    LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth();
    LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize();
    LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth();
    BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled();
   
    if(!isEnabled.getValue())
      return false;
   
    if(averageBandwidth != null && !averageBandwidth.equals(shapingPolicy.getAverageBandwidth())) {
View Full Code Here

        VirtualEthernetCard nic =  new VirtualE1000();
        VirtualEthernetCardNetworkBackingInfo nicBacking =
            new VirtualEthernetCardNetworkBackingInfo();
        nicBacking.setDeviceName(netName);

        Description info = new Description();
        info.setLabel(nicName);
        info.setSummary(netName);
        nic.setDeviceInfo(info);
   
        // type: "generated", "manual", "assigned" by VC
        nic.setAddressType("generated");
        nic.setBacking(nicBacking);
View Full Code Here

        VmdkBitmap bmp = new VmdkBitmap(capacityInBytes, 1024 * 1024);
       
        boolean isNotChangedAtAll = false;
        try {
            long offset = 0;
            DiskChangeInfo dci = null;
            do {
                dci = vm.queryChangedDiskAreas
                    (vmSnap, vmdkInfo.key_, offset, baseChangeId);

                if (offset == 0 && (dci.changedArea == null)) {
                    /*
                      ChangeId is not null and DiskChangeInfo.changedArea is null,
                       then the disk is not changed at all.
                     */
                    isNotChangedAtAll = true;
                    logger_.info("This vmdk is not changed at all " +
                                 "from previous backup.");
                    break;
                }
               
                for (int j = 0; j < dci.changedArea.length; j ++) {
                    long start = dci.getChangedArea()[j].getStart();
                    long len = dci.getChangedArea()[j].getLength();
                    logger_.info
                        (String.format
                         ("(%d,%d) %s \n", start, len,
                          (len % 1048576 == 0 ? "" : "not x MB")));

                    bmp.setRangeInBytes(start, len);
                }
                logger_.info
                    (String.format
                     ("offset %d, length %d\n",
                      dci.getStartOffset(), dci.getLength()));
                offset = dci.getStartOffset() + dci.getLength();
            } while (offset < capacityInBytes);
                   
        } catch (Exception e) {
            logger_.warning(Utility.toString(e));
            return null;
View Full Code Here

        /* debug */
        vmdkInfo.print();
        logger_.info(baseChangeId);

        long offset = 0;
        DiskChangeInfo dci;
        try {
            dci = vm.queryChangedDiskAreas
                (vmSnap, vmdkInfo.key_, offset, baseChangeId);
        } catch (Exception e) {
            /*
 
View Full Code Here

        }

        String morefOfNewVm = null;
       
        /* wait nfc lease */
        HttpNfcLeaseState hls;
    while (true) {
      hls = httpNfcLease.getState();
      if (hls == HttpNfcLeaseState.ready ||
                hls == HttpNfcLeaseState.error) { break; }
    }
View Full Code Here

                return node.getSnapshot();
            } else {
                VirtualMachineSnapshotTree[] childTree =
                    node.getChildSnapshotList();
                if (childTree != null) {
                    ManagedObjectReference mor =
                        findSnapshotInTree(childTree, snapName);
                    if (mor != null) { return mor; }
                }
            }
        }
View Full Code Here

       
        VirtualMachineSnapshotTree[] snapTree =
            vm_.getSnapshot().getRootSnapshotList();
       
        if (snapTree != null) {
            ManagedObjectReference mor = findSnapshotInTree(snapTree, snapName);
            if (mor != null) {
                return new
                    VirtualMachineSnapshot(vm_.getServerConnection(), mor);
            }
        }
View Full Code Here

TOP

Related Classes of com.vmware.vim25.DVSTrafficShapingPolicy

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.