Search in sources :

Example 1 with VirtualController

use of com.vmware.vim25.VirtualController in project cloudstack by apache.

the class HypervisorHostHelper method getControllerSpec.

private static VirtualDeviceConfigSpec getControllerSpec(String diskController, int busNum) {
    VirtualDeviceConfigSpec controllerSpec = new VirtualDeviceConfigSpec();
    VirtualController controller = null;
    if (diskController.equalsIgnoreCase(DiskControllerType.ide.toString())) {
        controller = new VirtualIDEController();
    } else if (DiskControllerType.pvscsi == DiskControllerType.getType(diskController)) {
        controller = new ParaVirtualSCSIController();
    } else if (DiskControllerType.lsisas1068 == DiskControllerType.getType(diskController)) {
        controller = new VirtualLsiLogicSASController();
    } else if (DiskControllerType.buslogic == DiskControllerType.getType(diskController)) {
        controller = new VirtualBusLogicController();
    } else if (DiskControllerType.lsilogic == DiskControllerType.getType(diskController)) {
        controller = new VirtualLsiLogicController();
    }
    if (!diskController.equalsIgnoreCase(DiskControllerType.ide.toString())) {
        ((VirtualSCSIController) controller).setSharedBus(VirtualSCSISharing.NO_SHARING);
    }
    controller.setBusNumber(busNum);
    controller.setKey(busNum - VmwareHelper.MAX_SCSI_CONTROLLER_COUNT);
    controllerSpec.setDevice(controller);
    controllerSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
    return controllerSpec;
}
Also used : VirtualController(com.vmware.vim25.VirtualController) VirtualIDEController(com.vmware.vim25.VirtualIDEController) ParaVirtualSCSIController(com.vmware.vim25.ParaVirtualSCSIController) VirtualBusLogicController(com.vmware.vim25.VirtualBusLogicController) VirtualDeviceConfigSpec(com.vmware.vim25.VirtualDeviceConfigSpec) ParaVirtualSCSIController(com.vmware.vim25.ParaVirtualSCSIController) VirtualSCSIController(com.vmware.vim25.VirtualSCSIController) VirtualLsiLogicSASController(com.vmware.vim25.VirtualLsiLogicSASController) VirtualLsiLogicController(com.vmware.vim25.VirtualLsiLogicController)

Aggregations

ParaVirtualSCSIController (com.vmware.vim25.ParaVirtualSCSIController)1 VirtualBusLogicController (com.vmware.vim25.VirtualBusLogicController)1 VirtualController (com.vmware.vim25.VirtualController)1 VirtualDeviceConfigSpec (com.vmware.vim25.VirtualDeviceConfigSpec)1 VirtualIDEController (com.vmware.vim25.VirtualIDEController)1 VirtualLsiLogicController (com.vmware.vim25.VirtualLsiLogicController)1 VirtualLsiLogicSASController (com.vmware.vim25.VirtualLsiLogicSASController)1 VirtualSCSIController (com.vmware.vim25.VirtualSCSIController)1