Package com.vmware.vim25

Examples of com.vmware.vim25.DVPortSetting


     * @deprecated This is called by addDisksToVm() only.
     * @author Steve Jin.
     */
    private VirtualDeviceConfigSpec createScsiSpec(int cKey)
    {
        VirtualDeviceConfigSpec scsiSpec =
            new VirtualDeviceConfigSpec();
        scsiSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
        VirtualLsiLogicController scsiCtrl =
            new VirtualLsiLogicController();
        scsiCtrl.setKey(cKey);
        scsiCtrl.setBusNumber(0);
        scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing);
        scsiSpec.setDevice(scsiCtrl);
        return scsiSpec;
    }
View Full Code Here


     * @author Steve Jin.
     */
    private VirtualDeviceConfigSpec createDiskSpec
        (String dsName, int cKey, long diskSizeMB, String diskMode, int unitNumber)
    {
        VirtualDeviceConfigSpec diskSpec =
            new VirtualDeviceConfigSpec();
        diskSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
        diskSpec.setFileOperation
            (VirtualDeviceConfigSpecFileOperation.create);
   
        VirtualDisk vd = new VirtualDisk();
        vd.setCapacityInKB(diskSizeMB * 1024L);
        diskSpec.setDevice(vd);
        vd.setKey(0);
        vd.setUnitNumber(unitNumber);
        vd.setControllerKey(cKey);

        VirtualDiskFlatVer2BackingInfo diskfileBacking =
View Full Code Here

     */
    private VirtualDeviceConfigSpec createNicSpec
        (String netName, String nicName)
        throws Exception
    {
        VirtualDeviceConfigSpec nicSpec =
            new VirtualDeviceConfigSpec();
        nicSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

        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);
        nic.setKey(0);
  
        nicSpec.setDevice(nic);
        return nicSpec;
    }
View Full Code Here

        /* Create spec of the controller. */
        specList.add(this.create());

        /* Create spec of all disks managed by the controller. */
        for (VirtualDiskManager diskm : diskList_) {
            VirtualDeviceConfigSpec diskSpec =
                diskm.create(true /* isThinProvisioned */);
            assert diskSpec != null;
            specList.add(diskSpec);
        }

View Full Code Here

    /**
     * Create scsi controller spec, it does not create spec of disks.
     */
    private VirtualDeviceConfigSpec create()
    {
        VirtualDeviceConfigSpec controllerSpec =
            new VirtualDeviceConfigSpec();
        controllerSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

        VirtualController ctrl = null;
        boolean isScsi = true;
       
        switch(type_) {
        case IDE:
            isScsi = false;
            ctrl = new VirtualIDEController();
            break;
        case BUSLOGIC:
            isScsi = true;
            ctrl = new VirtualBusLogicController();
            break;
        case LSILOGIC:
            isScsi = true;
            ctrl = new VirtualLsiLogicController();
            break;
        case LSILOGICSAS:
            isScsi = true;
            ctrl = new VirtualLsiLogicSASController();
            break;
        default:
            return null;
        }

        ctrl.setKey(ckey_);
        ctrl.setBusNumber(busNumber_);
        if (isScsi) {
            assert ctrl instanceof VirtualSCSIController;
            VirtualSCSIController scsiCtrl = (VirtualSCSIController) ctrl;
            scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing);
        }
        controllerSpec.setDevice(ctrl);

        return controllerSpec;
    }
View Full Code Here

    public VirtualDeviceConfigSpec create(boolean isThinProvisioned)
    {
        /* controller_ must not be null */
        if (controller_ == null) { return null; }
       
        VirtualDeviceConfigSpec diskSpec =
            new VirtualDeviceConfigSpec();
        diskSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
        diskSpec.setFileOperation
            (VirtualDeviceConfigSpecFileOperation.create);
   
        VirtualDisk vd = new VirtualDisk();
        vd.setCapacityInKB(capacityInKb_);
        diskSpec.setDevice(vd);
        vd.setKey(key_); /* no need to set key_ */
        vd.setUnitNumber(unitNumber_);
        vd.setControllerKey(controller_.getCkey());

        VirtualDiskFlatVer2BackingInfo diskfileBacking =
View Full Code Here

            new VirtualDeviceConfigSpec();
        diskSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
        diskSpec.setFileOperation
            (VirtualDeviceConfigSpecFileOperation.create);
   
        VirtualDisk vd = new VirtualDisk();
        vd.setCapacityInKB(diskSizeMB * 1024L);
        diskSpec.setDevice(vd);
        vd.setKey(0);
        vd.setUnitNumber(unitNumber);
        vd.setControllerKey(cKey);

        VirtualDiskFlatVer2BackingInfo diskfileBacking =
            new VirtualDiskFlatVer2BackingInfo();
        String fileName = "["+ dsName +"]";
        diskfileBacking.setFileName(fileName);
        diskfileBacking.setDiskMode(diskMode);
        diskfileBacking.setThinProvisioned(true);
        vd.setBacking(diskfileBacking);
        return diskSpec;
    }
View Full Code Here

            VirtualDeviceBackingInfo vdbi = devices[i].getBacking();
            if (devices[i] instanceof VirtualDisk &&
                vdbi instanceof VirtualDeviceFileBackingInfo) {

                VirtualDisk diskDev = (VirtualDisk) devices[i];

                /* set required values in the VirtualDevice data. */
                String name = ((VirtualDeviceFileBackingInfo) vdbi).getFileName();
                String changeId = null;
                String uuid = null;
                long capacityInKB = diskDev.getCapacityInKB();
                int key = diskDev.getKey();
                int unitNumber = diskDev.getUnitNumber();
                String diskMode = null;
               
                /* Get required values in the BackingInfo data. */
                if (vdbi instanceof VirtualDiskFlatVer2BackingInfo) {
                    VirtualDiskFlatVer2BackingInfo bi
                        = (VirtualDiskFlatVer2BackingInfo) vdbi;
                    changeId = bi.getChangeId();
                    uuid = bi.getUuid();
                    diskMode = bi.getDiskMode();
                } else if (vdbi instanceof VirtualDiskSparseVer2BackingInfo) {
                    VirtualDiskSparseVer2BackingInfo bi =
                        (VirtualDiskSparseVer2BackingInfo) vdbi;
                    changeId = bi.getChangeId();
                    uuid = bi.getUuid();
                    diskMode = bi.getDiskMode();
                }

                /* get the controller information  */
                Integer ckeyI = diskDev.getControllerKey(); assert ckeyI != null;
                int ckey = ckeyI.intValue();
                AdapterType type = getAdapterType(ckey);
                int busNumber = getBusNumber(ckey);
               
                /* create VmdkInfo object. */
 
View Full Code Here

            new VirtualDeviceConfigSpec();
        diskSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
        diskSpec.setFileOperation
            (VirtualDeviceConfigSpecFileOperation.create);
   
        VirtualDisk vd = new VirtualDisk();
        vd.setCapacityInKB(capacityInKb_);
        diskSpec.setDevice(vd);
        vd.setKey(key_); /* no need to set key_ */
        vd.setUnitNumber(unitNumber_);
        vd.setControllerKey(controller_.getCkey());

        VirtualDiskFlatVer2BackingInfo diskfileBacking =
            new VirtualDiskFlatVer2BackingInfo();
        String fileName = "["+ datastore_ +"]";
        diskfileBacking.setFileName(fileName);
        diskfileBacking.setDiskMode("persistent");
        diskfileBacking.setThinProvisioned(isThinProvisioned);
        vd.setBacking(diskfileBacking);
        return diskSpec;
    }
View Full Code Here

        diskSpec.setDevice(vd);
        vd.setKey(0);
        vd.setUnitNumber(unitNumber);
        vd.setControllerKey(cKey);

        VirtualDiskFlatVer2BackingInfo diskfileBacking =
            new VirtualDiskFlatVer2BackingInfo();
        String fileName = "["+ dsName +"]";
        diskfileBacking.setFileName(fileName);
        diskfileBacking.setDiskMode(diskMode);
        diskfileBacking.setThinProvisioned(true);
        vd.setBacking(diskfileBacking);
        return diskSpec;
    }
View Full Code Here

TOP

Related Classes of com.vmware.vim25.DVPortSetting

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.