Esempio n. 1
0
def createScsiSpec(scsiKey,busNumber):
    """
    Define a virtual scsi ctrl spec
    """
    scsiSpec = VirtualDeviceConfigSpec()
    scsiSpec.setOperation(VirtualDeviceConfigSpecOperation.add)
    scsiCtrl = VirtualLsiLogicSASController()
    scsiCtrl.setKey(scsiKey)
    scsiCtrl.setBusNumber(busNumber)
    scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing)
    scsiSpec.setDevice(scsiCtrl)

    return scsiSpec
Esempio n. 2
0
def createScsiSpec(scsiKey,busNumber,scsiType):
    """
    Define a virtual scsi ctrl spec
    """
    scsiSpec = VirtualDeviceConfigSpec()
    scsiSpec.setOperation(VirtualDeviceConfigSpecOperation.add)
    if scsiType == "sas":
        scsiCtrl = VirtualLsiLogicSASController()
    elif scsiType == "parallel":
        scsiCtrl = VirtualLsiLogicController()
    elif scsiType == "buslogic":
        scsiCtrl = VirtualBusLogicController()
    elif scsiType == "paravirt":
        scsiCtrl = ParaVirtualSCSIController()
    scsiCtrl.setKey(scsiKey)
    scsiCtrl.setBusNumber(busNumber)
    scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing)
    scsiSpec.setDevice(scsiCtrl)

    return scsiSpec