Пример #1
0
def parseIoSlot(buffer):
    """
    Parses and sets the values for the Physical I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
            ioSlot.drcName)
        ioSlot.name = propertiesDict.get('description')
        ioSlot.busId = propertiesDict.get('bus_id')
        ioSlot.physLoc = propertiesDict.get('unit_phys_loc')
        ioSlot.pciRevId = propertiesDict.get('pci_revision_id')
        ioSlot.busGrouping = propertiesDict.get('bus_grouping')
        ioSlot.pciDeviceId = propertiesDict.get('pci_device_id')
        ioSlot.physLocOnBus = propertiesDict.get('phys_loc')
        ioSlot.parentDrcIndex = propertiesDict.get('parent_slot_drc_index')
        ioSlot.drcIndex = propertiesDict.get('drc_index')
        ioSlot.subSlotVendorId = propertiesDict.get('pci_subs_vendor_id')
        ioSlot.pciClass = propertiesDict.get('pci_class')
        ioSlot.ioPoolId = propertiesDict.get('slot_io_pool_id')
        ioSlot.vendorId = propertiesDict.get('pci_vendor_id')
        ioSlot.featureCodes = propertiesDict.get('feature_codes')
        ioSlot.subslotDeviceId = propertiesDict.get('pci_subs_device_id')
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        return ioSlot
Пример #2
0
def parseIoSlot(buffer):
    """
    Parses and sets the values for the Physical I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
        ioSlot.name = propertiesDict.get('description')
        ioSlot.busId = propertiesDict.get('bus_id')
        ioSlot.physLoc = propertiesDict.get('unit_phys_loc')
        ioSlot.pciRevId = propertiesDict.get('pci_revision_id')
        ioSlot.busGrouping = propertiesDict.get('bus_grouping')
        ioSlot.pciDeviceId = propertiesDict.get('pci_device_id')
        ioSlot.physLocOnBus = propertiesDict.get('phys_loc')
        ioSlot.parentDrcIndex = propertiesDict.get('parent_slot_drc_index')
        ioSlot.drcIndex = propertiesDict.get('drc_index')
        ioSlot.subSlotVendorId = propertiesDict.get('pci_subs_vendor_id')
        ioSlot.pciClass = propertiesDict.get('pci_class')
        ioSlot.ioPoolId = propertiesDict.get('slot_io_pool_id')
        ioSlot.vendorId = propertiesDict.get('pci_vendor_id')
        ioSlot.featureCodes = propertiesDict.get('feature_codes')
        ioSlot.subslotDeviceId = propertiesDict.get('pci_subs_device_id')
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        return ioSlot
Пример #3
0
def parseVirtIoSlots(buffer):
    """
    Parses and sets the values for the Virtual I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing virtual I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
        ioSlot.name = ioSlot.drcName
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        ioSlot.isVirtual = 1
        ioSlot.slotNum = propertiesDict.get('slot_num')
        ioSlot.slotType = propertiesDict.get('config')
        return ioSlot
Пример #4
0
def parseVirtIoSlots(buffer):
    """
    Parses and sets the values for the Virtual I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing virtual I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
            ioSlot.drcName)
        ioSlot.name = ioSlot.drcName
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        ioSlot.isVirtual = 1
        ioSlot.slotNum = propertiesDict.get('slot_num')
        ioSlot.slotType = propertiesDict.get('config')
        return ioSlot
def doDiscovery(shell, hostOsh, managedSystemOsh, framework, osType):
    vector = ObjectStateHolderVector()
    scsiAdaptersList = []
    physAdaptList = []
    virtAdaptList = []
    seaAdaptList = []
    linkAggrAdaptList = []
    volumeGroupsDict = {}
    physicalVolumeDict = {}
    logicalVolumeDict = {}
    scsiManList = []
    pvAssignList = []
    fiberChannelAdaptersList = []
    ethAliasesList = []
    isVio = ibm_hmc_lib.isVio(shell)

    if isVio:
        try:
            cpus = discoverCpus(shell)
            for cpu in cpus:
                cpuOsh = modeling.createCpuOsh(cpu.idStr, managedSystemOsh, cpu.speed, cpu.coresCount, 'ibm_corp', data_name = cpu.model)
                vector.add(cpuOsh)
        except:
            logger.errorException('')
            framework.reportWarning('Failed to discover CPUs')

    if osType and osType.upper() == 'AIX':
        try:
            fiberChannelAdaptersList = discoverFiberChannels(shell)
        except:
            framework.reportWarning("Failed to discover Fibre Channel adapters")
        ethAdaptersDict = {}
        if isVio:
            ethAdaptersDict = discoverEthernetAdapters(shell)
            ethAliasesList = discoverEhernetAdapterAliasses(shell)
        else:
            ethAdaptersDict = discoverAixLparEthernetAdapters(shell)
        physAdaptList = getPhysicalEthAdapters(ethAdaptersDict.values())
        virtAdaptList = getVirtualEthAdapters(ethAdaptersDict.values())
        seaAdaptList = getSeaAdapters(ethAdaptersDict.values())
        linkAggrAdaptList = getLinkAggregationInterfaces(ethAdaptersDict.values())
        calculateAdaptersSpeed(linkAggrAdaptList, ethAdaptersDict)
        calculateAdaptersSpeed(seaAdaptList, ethAdaptersDict)
        calculateAdaptersSpeed(virtAdaptList, ethAdaptersDict)

        volumeGroupsDict = discoverVolumeGroups(shell)
        physicalVolumeDict = discoverPhysicalVolumes(shell)
        logicalVolumeDict = discoverLogicalVolumes(shell, volumeGroupsDict)
        if isVio:
            scsiAdaptersList = discoverScsi(shell, physicalVolumeDict, logicalVolumeDict)
            (scsiManList, pvAssignList) = discoverPhysScsiAndRaid(shell, physicalVolumeDict)
        else:
            (scsiManList, pvAssignList) = discoverLparPhysScsiAndRaid(shell, physicalVolumeDict)
    elif osType and osType.upper() == 'LINUX':
        scsiAdaptersList = discoverLinuxVScsiAdapters(shell)
        (volumeGroupsDict, logicalVolumeDict, physicalVolumeDict) = discoverLinuxStorageInfo(shell)
    ethAdaptersDict = {}
    if physAdaptList:
        for physAdapt in physAdaptList:
            physAdaptOsh = createInterfaceOsh(physAdapt, hostOsh)
            linkOsh = modeling.createLinkOSH('contained', managedSystemOsh, physAdaptOsh)
            vector.add(linkOsh)
            if physAdapt.physicalPath:
                ioSlot = ibm_hmc_lib.IoSlot()
                ioSlot.name = physAdapt.physicalPath
                ioSlot.drcName = physAdapt.physicalPath
                ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
                ioSlotOsh = None
                if isPhysicalSlot(ioSlot):
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, managedSystemOsh)
                else:
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                linkOsh = modeling.createLinkOSH('contained', ioSlotOsh, physAdaptOsh)
                vector.add(ioSlotOsh)
                vector.add(linkOsh)

            if ethAliasesList:
                for aliasName in ['en'+str(physAdapt.interfaceIndex), 'et'+str(physAdapt.interfaceIndex)]:
                    if aliasName in ethAliasesList:
                        aliasOsh = createAliasOsh(aliasName, hostOsh, physAdapt)
                        if aliasOsh:
                            vector.add(aliasOsh)
                            vector.add(vector.add(modeling.createLinkOSH('realization', physAdaptOsh, aliasOsh)))
            if logger.Version().getVersion(framework) < 9:
                interfaceIndexOsh = createInterfaceIndexOsh(physAdapt, hostOsh)
                if interfaceIndexOsh:
                    linkOsh = modeling.createLinkOSH('parent', interfaceIndexOsh, physAdaptOsh)
                    vector.add(interfaceIndexOsh)
                    vector.add(linkOsh)
#            vector.add(physAdaptOsh)
            ethAdaptersDict[physAdapt.name] = physAdaptOsh
    if linkAggrAdaptList:
        for linkAggr in linkAggrAdaptList:
            linkAggrOsh = createLinkAggrOsh(linkAggr, hostOsh)
            if linkAggr.usedAdapters:
                vector.add(linkAggrOsh)
                ethAdaptersDict[linkAggr.name] = linkAggrOsh
                for usedAdapterName in linkAggr.usedAdapters:
                    physAdaptOsh = ethAdaptersDict.get(usedAdapterName)
                    if physAdaptOsh:
                        #change the KEY attribute for the Physical Ethernet Adapter
                        mac = physAdaptOsh.getAttributeValue('interface_macaddr')
                        newKey = '%s_%s' % (mac, usedAdapterName)
                        physAdaptOsh.setAttribute('interface_macaddr', newKey)
                        ethAdaptersDict[usedAdapterName] = physAdaptOsh
                        linkOsh = modeling.createLinkOSH('member', linkAggrOsh, physAdaptOsh)
                        vector.add(linkOsh)
            if linkAggr.backupAdapter:
                ethBackOsh = ethAdaptersDict.get(linkAggr.backupAdapter)
                linkOsh = modeling.createLinkOSH('member', linkAggrOsh, ethBackOsh)
                vector.add(linkOsh)
    #Adding Physical ETH adapters to the result vector
    if ethAdaptersDict:
        for physAdaptOsh in ethAdaptersDict.values():
            vector.add(physAdaptOsh)
    if seaAdaptList:
        for seaAdapter in seaAdaptList:
            seaAdapterOsh = createSeaOsh(seaAdapter, hostOsh)
            if seaAdapter.usedAdapters:
                vector.add(seaAdapterOsh)
                ethAdaptersDict[seaAdapter.name] = seaAdapterOsh
                for usedAdapterName in seaAdapter.usedAdapters:
                    backAdapterOsh = ethAdaptersDict.get(usedAdapterName)
                    if backAdapterOsh:
                        linkOsh = modeling.createLinkOSH('use', seaAdapterOsh, backAdapterOsh)
                        vector.add(linkOsh)
    if virtAdaptList:
        for virtualAdapter in virtAdaptList:
            virtAdapterOsh = ibm_hmc_lib.createVEthOsh(virtualAdapter, hostOsh)
            vector.add(virtAdapterOsh)
            if ethAliasesList:
                for aliasName in ['en'+str(virtualAdapter.interfaceIndex), 'et'+str(virtualAdapter.interfaceIndex)]:
                        if aliasName in ethAliasesList:
                            aliasOsh = createAliasOsh(aliasName, hostOsh, virtualAdapter)
                            if aliasOsh:
                                vector.add(aliasOsh)
                                vector.add(vector.add(modeling.createLinkOSH('realization', virtAdapterOsh, aliasOsh)))
            if virtualAdapter.usedAdapters:
                for usedAdapterName in virtualAdapter.usedAdapters:
                    backAdapterOsh = ethAdaptersDict.get(usedAdapterName)
                    if backAdapterOsh:
                        linkOsh = modeling.createLinkOSH('use', virtAdapterOsh, backAdapterOsh)
                        vector.add(linkOsh)
#FIXME: move to function to avoid code dups
            if virtualAdapter.physicalPath:
                ioSlot = ibm_hmc_lib.IoSlot()
                ioSlot.name = virtualAdapter.physicalPath
                ioSlot.drcName = virtualAdapter.physicalPath
                ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
                if isPhysicalSlot(ioSlot):
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, managedSystemOsh)
                else:
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                linkOsh = modeling.createLinkOSH('contained', ioSlotOsh, virtAdapterOsh)
                vector.add(ioSlotOsh)
                vector.add(linkOsh)

    if fiberChannelAdaptersList:
        for fiberChannelAdapter in fiberChannelAdaptersList:
            fiberChannelOsh = createFiberChannelOsh(fiberChannelAdapter, managedSystemOsh)
            vector.add(fiberChannelOsh)
            linkOsh = modeling.createLinkOSH('contained', hostOsh, fiberChannelOsh)
            vector.add(linkOsh)
            if fiberChannelAdapter.physPath:
                ioSlot = ibm_hmc_lib.IoSlot()
                ioSlot.name = fiberChannelAdapter.physPath
                ioSlot.drcName = fiberChannelAdapter.physPath
                ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
                ioSlotOsh = None
                if isPhysicalSlot(ioSlot):
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, managedSystemOsh)
                else:
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                linkOsh = modeling.createLinkOSH('contained', ioSlotOsh, fiberChannelOsh)
                vector.add(ioSlotOsh)
                vector.add(linkOsh)
    #create Storage Topology
    vector.addAll(storage_topology.createStorageTopology(volumeGroupsDict.values(), logicalVolumeDict.values(), physicalVolumeDict.values(), scsiAdaptersList, hostOsh))
    if scsiManList and pvAssignList:
        pScsiDict = {}
        for scsi in scsiManList:
            scsiOsh = None
            ioSlot = ibm_hmc_lib.IoSlot()
            ioSlot.name = scsi.physicalPath
            ioSlot.drcName = scsi.physicalPath
            ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
            ioSlotOsh = None
            if isPhysicalSlot(ioSlot):
                ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, managedSystemOsh)
                scsiOsh = storage_topology.createScsiAdapterOsh(scsi, managedSystemOsh)
                linkOsh = modeling.createLinkOSH('contained', hostOsh, scsiOsh)
                vector.add(linkOsh)
            else:
                ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                scsiOsh = storage_topology.createScsiAdapterOsh(scsi, hostOsh)
            vector.add(scsiOsh)
            pScsiDict[scsi.slotNumber] = scsiOsh
            linkOsh = modeling.createLinkOSH('contained', ioSlotOsh, scsiOsh)
            vector.add(ioSlotOsh)
            vector.add(linkOsh)
        for pv in pvAssignList:
            pvOsh = storage_topology.createPhysicalVolumeOsh(pv, hostOsh)
            scsiOsh = pScsiDict.get(pv.scsiAdapterSlotNumber)
            if pvOsh and scsiOsh:
                vector.add(pvOsh)
                linkOsh = modeling.createLinkOSH("depend", pvOsh, scsiOsh)
                vector.add(linkOsh)

    return vector
Пример #6
0
def doDiscovery(shell, hostOsh, managedSystemOsh, framework, osType):
    vector = ObjectStateHolderVector()
    scsiAdaptersList = []
    physAdaptList = []
    virtAdaptList = []
    seaAdaptList = []
    linkAggrAdaptList = []
    volumeGroupsDict = {}
    physicalVolumeDict = {}
    logicalVolumeDict = {}
    scsiManList = []
    pvAssignList = []
    fiberChannelAdaptersList = []
    ethAliasesList = []
    isVio = ibm_hmc_lib.isVio(shell)

    try:
        cpus = discover_cpus(shell, framework, isVio)
        for cpu in cpus:
            cpuOsh = modeling.createCpuOsh(cpu.idStr,
                                           managedSystemOsh,
                                           cpu.speed,
                                           cpu.coresCount,
                                           'ibm_corp',
                                           data_name=cpu.model)
            vector.add(cpuOsh)
    except:
        logger.errorException('')
        framework.reportWarning('Failed to discover CPUs')

    if osType and osType.upper() == 'AIX':
        try:
            fiberChannelAdaptersList = discoverFiberChannels(shell)
        except:
            framework.reportWarning(
                "Failed to discover Fibre Channel adapters")
        ethAdaptersDict = {}
        if isVio:
            ethAdaptersDict = discoverEthernetAdapters(shell)
            ethAliasesList = discoverEhernetAdapterAliasses(shell)
        else:
            ethAdaptersDict = discoverAixLparEthernetAdapters(shell)
        physAdaptList = getPhysicalEthAdapters(ethAdaptersDict.values())
        virtAdaptList = getVirtualEthAdapters(ethAdaptersDict.values())
        seaAdaptList = getSeaAdapters(ethAdaptersDict.values())
        linkAggrAdaptList = getLinkAggregationInterfaces(
            ethAdaptersDict.values())
        calculateAdaptersSpeed(linkAggrAdaptList, ethAdaptersDict)
        calculateAdaptersSpeed(seaAdaptList, ethAdaptersDict)
        calculateAdaptersSpeed(virtAdaptList, ethAdaptersDict)

        volumeGroupsDict = discoverVolumeGroups(shell)
        physicalVolumeDict = discoverPhysicalVolumes(shell)
        logicalVolumeDict = discoverLogicalVolumes(shell, volumeGroupsDict)
        if isVio:
            scsiAdaptersList = discoverScsi(shell, physicalVolumeDict,
                                            logicalVolumeDict)
            (scsiManList,
             pvAssignList) = discoverPhysScsiAndRaid(shell, physicalVolumeDict)
        else:
            (scsiManList, pvAssignList) = discoverLparPhysScsiAndRaid(
                shell, physicalVolumeDict)
    elif osType and osType.upper() == 'LINUX':
        scsiAdaptersList = discoverLinuxVScsiAdapters(shell)
        (volumeGroupsDict, logicalVolumeDict,
         physicalVolumeDict) = discoverLinuxStorageInfo(shell)
    ethAdaptersDict = {}
    if physAdaptList:
        for physAdapt in physAdaptList:
            physAdaptOsh = createInterfaceOsh(physAdapt, hostOsh)
            linkOsh = modeling.createLinkOSH('contained', managedSystemOsh,
                                             physAdaptOsh)
            vector.add(linkOsh)
            if physAdapt.physicalPath:
                ioSlot = ibm_hmc_lib.IoSlot()
                ioSlot.name = physAdapt.physicalPath
                ioSlot.drcName = physAdapt.physicalPath
                ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
                    ioSlot.drcName)
                ioSlotOsh = None
                if isPhysicalSlot(ioSlot):
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(
                        ioSlot, managedSystemOsh)
                else:
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                linkOsh = modeling.createLinkOSH('contained', ioSlotOsh,
                                                 physAdaptOsh)
                vector.add(ioSlotOsh)
                vector.add(linkOsh)

            if ethAliasesList:
                for aliasName in [
                        'en' + str(physAdapt.interfaceIndex),
                        'et' + str(physAdapt.interfaceIndex)
                ]:
                    if aliasName in ethAliasesList:
                        aliasOsh = createAliasOsh(aliasName, hostOsh,
                                                  physAdapt)
                        if aliasOsh:
                            vector.add(aliasOsh)
                            vector.add(
                                vector.add(
                                    modeling.createLinkOSH(
                                        'realization', physAdaptOsh,
                                        aliasOsh)))
            if logger.Version().getVersion(framework) < 9:
                interfaceIndexOsh = createInterfaceIndexOsh(physAdapt, hostOsh)
                if interfaceIndexOsh:
                    linkOsh = modeling.createLinkOSH('parent',
                                                     interfaceIndexOsh,
                                                     physAdaptOsh)
                    vector.add(interfaceIndexOsh)
                    vector.add(linkOsh)
#            vector.add(physAdaptOsh)
            ethAdaptersDict[physAdapt.name] = physAdaptOsh
    if linkAggrAdaptList:
        for linkAggr in linkAggrAdaptList:
            linkAggrOsh = createLinkAggrOsh(linkAggr, hostOsh)
            if linkAggr.usedAdapters:
                vector.add(linkAggrOsh)
                ethAdaptersDict[linkAggr.name] = linkAggrOsh
                for usedAdapterName in linkAggr.usedAdapters:
                    physAdaptOsh = ethAdaptersDict.get(usedAdapterName)
                    if physAdaptOsh:
                        #change the KEY attribute for the Physical Ethernet Adapter
                        mac = physAdaptOsh.getAttributeValue(
                            'interface_macaddr')
                        newKey = '%s_%s' % (mac, usedAdapterName)
                        physAdaptOsh.setAttribute('interface_macaddr', newKey)
                        ethAdaptersDict[usedAdapterName] = physAdaptOsh
                        linkOsh = modeling.createLinkOSH(
                            'member', linkAggrOsh, physAdaptOsh)
                        vector.add(linkOsh)
            if linkAggr.backupAdapter:
                ethBackOsh = ethAdaptersDict.get(linkAggr.backupAdapter)
                linkOsh = modeling.createLinkOSH('member', linkAggrOsh,
                                                 ethBackOsh)
                vector.add(linkOsh)
    #Adding Physical ETH adapters to the result vector
    if ethAdaptersDict:
        for physAdaptOsh in ethAdaptersDict.values():
            vector.add(physAdaptOsh)
    if seaAdaptList:
        for seaAdapter in seaAdaptList:
            seaAdapterOsh = createSeaOsh(seaAdapter, hostOsh)
            if seaAdapter.usedAdapters:
                vector.add(seaAdapterOsh)
                ethAdaptersDict[seaAdapter.name] = seaAdapterOsh
                for usedAdapterName in seaAdapter.usedAdapters:
                    backAdapterOsh = ethAdaptersDict.get(usedAdapterName)
                    if backAdapterOsh:
                        linkOsh = modeling.createLinkOSH(
                            'use', seaAdapterOsh, backAdapterOsh)
                        vector.add(linkOsh)
    if virtAdaptList:
        for virtualAdapter in virtAdaptList:
            virtAdapterOsh = ibm_hmc_lib.createVEthOsh(virtualAdapter, hostOsh)
            vector.add(virtAdapterOsh)
            if ethAliasesList:
                for aliasName in [
                        'en' + str(virtualAdapter.interfaceIndex),
                        'et' + str(virtualAdapter.interfaceIndex)
                ]:
                    if aliasName in ethAliasesList:
                        aliasOsh = createAliasOsh(aliasName, hostOsh,
                                                  virtualAdapter)
                        if aliasOsh:
                            vector.add(aliasOsh)
                            vector.add(
                                vector.add(
                                    modeling.createLinkOSH(
                                        'realization', virtAdapterOsh,
                                        aliasOsh)))
            if virtualAdapter.usedAdapters:
                for usedAdapterName in virtualAdapter.usedAdapters:
                    backAdapterOsh = ethAdaptersDict.get(usedAdapterName)
                    if backAdapterOsh:
                        linkOsh = modeling.createLinkOSH(
                            'use', virtAdapterOsh, backAdapterOsh)
                        vector.add(linkOsh)
            if virtualAdapter.physicalPath:
                ioSlot = ibm_hmc_lib.IoSlot()
                ioSlot.name = virtualAdapter.physicalPath
                ioSlot.drcName = virtualAdapter.physicalPath
                ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
                    ioSlot.drcName)
                if isPhysicalSlot(ioSlot):
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(
                        ioSlot, managedSystemOsh)
                else:
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                linkOsh = modeling.createLinkOSH('contained', ioSlotOsh,
                                                 virtAdapterOsh)
                vector.add(ioSlotOsh)
                vector.add(linkOsh)

    if fiberChannelAdaptersList:
        for fiberChannelAdapter in fiberChannelAdaptersList:
            fiberChannelOsh = createFiberChannelOsh(fiberChannelAdapter,
                                                    managedSystemOsh)
            vector.add(fiberChannelOsh)
            linkOsh = modeling.createLinkOSH('contained', hostOsh,
                                             fiberChannelOsh)
            vector.add(linkOsh)
            if fiberChannelAdapter.physPath:
                ioSlot = ibm_hmc_lib.IoSlot()
                ioSlot.name = fiberChannelAdapter.physPath
                ioSlot.drcName = fiberChannelAdapter.physPath
                ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
                    ioSlot.drcName)
                ioSlotOsh = None
                if isPhysicalSlot(ioSlot):
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(
                        ioSlot, managedSystemOsh)
                else:
                    ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                linkOsh = modeling.createLinkOSH('contained', ioSlotOsh,
                                                 fiberChannelOsh)
                vector.add(ioSlotOsh)
                vector.add(linkOsh)
    #create Storage Topology
    vector.addAll(
        storage_topology.createStorageTopology(volumeGroupsDict.values(),
                                               logicalVolumeDict.values(),
                                               physicalVolumeDict.values(),
                                               scsiAdaptersList, hostOsh))
    if scsiManList and pvAssignList:
        pScsiDict = {}
        for scsi in scsiManList:
            scsiOsh = None
            ioSlot = ibm_hmc_lib.IoSlot()
            ioSlot.name = scsi.physicalPath
            ioSlot.drcName = scsi.physicalPath
            ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
                ioSlot.drcName)
            ioSlotOsh = None
            if isPhysicalSlot(ioSlot):
                ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(
                    ioSlot, managedSystemOsh)
                scsiOsh = storage_topology.createScsiAdapterOsh(
                    scsi, managedSystemOsh)
                linkOsh = modeling.createLinkOSH('contained', hostOsh, scsiOsh)
                vector.add(linkOsh)
            else:
                ioSlotOsh = ibm_hmc_lib.createIoSlotOsh(ioSlot, hostOsh)
                scsiOsh = storage_topology.createScsiAdapterOsh(scsi, hostOsh)
            vector.add(scsiOsh)
            pScsiDict[scsi.slotNumber] = scsiOsh
            linkOsh = modeling.createLinkOSH('contained', ioSlotOsh, scsiOsh)
            vector.add(ioSlotOsh)
            vector.add(linkOsh)
        for pv in pvAssignList:
            pvOsh = storage_topology.createPhysicalVolumeOsh(pv, hostOsh)
            scsiOsh = pScsiDict.get(pv.scsiAdapterSlotNumber)
            if pvOsh and scsiOsh:
                vector.add(pvOsh)
                linkOsh = modeling.createLinkOSH("depend", pvOsh, scsiOsh)
                vector.add(linkOsh)

    return vector