Package com.vmware.vim25

Examples of com.vmware.vim25.OptionValue


        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

                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

        if (entityType == null || morefStr == null) {
            return null;
        }

        /* create managed object reference */
        ManagedObjectReference mor = new ManagedObjectReference();
        mor.setType(entityType);
        mor.setVal(morefStr);

        return mor;
    }
View Full Code Here

     */
    protected VirtualMachine generateVirtualMachineWithMoref(String morefStr)
    {
        if (si_ == null || morefStr == null) { return null; }

        ManagedObjectReference mor =
            generateMoref("VirtualMachine", morefStr);
        if (mor == null) { return null; }

        ManagedEntity vm =
            MorUtil.createExactManagedEntity(si_.getServerConnection(), mor);
View Full Code Here

     */
    protected VirtualMachineSnapshot generateSnapshotWithMoref(String morefStr)
    {
        if (si_ == null || morefStr == null) { return null; }

        ManagedObjectReference mor =
            generateMoref("VirtualMachineSnapshot", morefStr);
        if (mor == null) { return null; }

        ManagedObject snap =
            MorUtil.createExactManagedObject(si_.getServerConnection(), mor);
View Full Code Here

              String value = null;
              for(DynamicProperty objProp : objProps) {
                if(objProp.getName().equals("name")) {
                  name = (String)objProp.getVal();
                } else {
                  OptionValue optValue = (OptionValue)objProp.getVal();
                  value = (String)optValue.getValue();
                }
              }
             
              if(name != null && value != null) {
                portInfo.put(name, Integer.parseInt(value));
View Full Code Here

            // pass boot arguments through machine.id & perform customized options to VMX
   
            Map<String, String> vmDetailOptions = validateVmDetails(vmSpec.getDetails());
            OptionValue[] extraOptions = new OptionValue[2 + vmDetailOptions.size()];
            extraOptions[0] = new OptionValue();
            extraOptions[0].setKey("machine.id");
            extraOptions[0].setValue(vmSpec.getBootArgs());
           
            extraOptions[1] = new OptionValue();
            extraOptions[1].setKey("devices.hotplug");
            extraOptions[1].setValue("true");

            int j = 2;
            for(Map.Entry<String, String> entry : vmDetailOptions.entrySet()) {
              extraOptions[j] = new OptionValue();
              extraOptions[j].setKey(entry.getKey());
              extraOptions[j].setValue(entry.getValue());
              j++;
            }
           
View Full Code Here

TOP

Related Classes of com.vmware.vim25.OptionValue

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.