Package com.vmware.vim25

Examples of com.vmware.vim25.VirtualDisk


            isScsi = false;
            ctrl = new VirtualIDEController();
            break;
        case BUSLOGIC:
            isScsi = true;
            ctrl = new VirtualBusLogicController();
            break;
        case LSILOGIC:
            isScsi = true;
            ctrl = new VirtualLsiLogicController();
            break;
View Full Code Here


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

     * @param ckey key of the controller device.
     * @return Adapter type. This does not return null.
     */
    private AdapterType getAdapterType(int ckey)
    {
        VirtualDevice vd = searchVirtualDeviceWithKey(ckey);
        if (vd == null) {
            return AdapterType.UNKNOWN;
        }
        assert vd.getKey() == ckey;

        AdapterType ret = AdapterType.UNKNOWN;
        if (vd instanceof VirtualIDEController) {
            ret = AdapterType.IDE;
        } else if (vd instanceof VirtualBusLogicController) {
View Full Code Here

     * @param ckey key of the controller device.
     * @return busNumber in success, or -1 in failure.
     */
    private int getBusNumber(int ckey)
    {
        VirtualDevice vd = searchVirtualDeviceWithKey(ckey);
        if (vd == null) { return -1; }

        if (vd instanceof VirtualController) {
            return ((VirtualController) vd).getBusNumber();
        } else {
View Full Code Here

     * @param ckey key of the disk device.
     * @return unitNumber in success, or -1 in failure.
     */
    private int getUnitNumber(int key)
    {
        VirtualDevice vd = searchVirtualDeviceWithKey(key);
        if (vd == null) { return -1; }

        if (vd instanceof VirtualDisk) {
            return ((VirtualDisk) vd).getUnitNumber();
        } else {
View Full Code Here

        VirtualDevice[] devices = config_.getHardware().getDevice();
        for (int i = 0; devices != null && i < devices.length; i ++) {
            //String deviceLabel = devices[i].getDeviceInfo().getLabel();
            //logger_.info("deviceLabel: " + deviceLabel);

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

                VirtualDisk diskDev = (VirtualDisk) devices[i];
View Full Code Here

        VirtualDevice[] devices = config_.getHardware().getDevice();
        for (int i = 0; devices != null && i < devices.length; i ++) {
            //String deviceLabel = devices[i].getDeviceInfo().getLabel();
            //logger_.info("deviceLabel: " + deviceLabel);

            VirtualDeviceBackingInfo vdbi = devices[i].getBacking();
            if (devices[i] instanceof VirtualDisk &&
                vdbi instanceof VirtualDeviceFileBackingInfo) {
                String fn = ((VirtualDeviceFileBackingInfo) vdbi).getFileName();
                ret.add(fn);
            }
View Full Code Here

        List<VirtualDeviceConfigSpec> specList =
            new LinkedList<VirtualDeviceConfigSpec>();

        /* create scsi controller spec */
        int cKey = 1000;
        VirtualDeviceConfigSpec scsiSpec = createScsiSpec(cKey);
        specList.add(scsiSpec);
       
        /* create hard disk spec */
        int unitNumber = 0;
        for (Long diskSizeMb: diskSizeMbList) {
            VirtualDeviceConfigSpec diskSpec = createDiskSpec
                (datastoreName, cKey, diskSizeMb.longValue(),
                 "persistent", unitNumber);
            specList.add(diskSpec);
            unitNumber ++;
        }
View Full Code Here

     * @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

TOP

Related Classes of com.vmware.vim25.VirtualDisk

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.