Search in sources :

Example 11 with VPlexBackendManager

use of com.emc.storageos.vplexcontroller.VPlexBackendManager in project coprhd-controller by CoprHD.

the class VPlexXtremIOMaskingOrchestratorTest method makeExportMasks.

private static void makeExportMasks(URI arrayURI, VplexXtremIOMaskingOrchestrator orca, Set<Map<URI, List<List<StoragePort>>>> portGroups, Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups, Map<URI, NetworkLite> networkMap) {
    // Iterate through the PortGroups generating zoning info and an ExportMask
    Iterator<Map<String, Map<URI, Set<Initiator>>>> igIterator = initiatorGroups.iterator();
    for (Map<URI, List<List<StoragePort>>> portGroup : portGroups) {
        String maskName = "testMask" + maskCounter.toString();
        maskCounter++;
        _log.info("Generating ExportMask: " + maskName);
        if (!igIterator.hasNext()) {
            igIterator = initiatorGroups.iterator();
        }
        Map<String, Map<URI, Set<Initiator>>> initiatorGroup = igIterator.next();
        StoragePortsAssigner assigner = StoragePortsAssignerFactory.getAssignerForZones("vmax", null);
        StringSetMap zoningMap = orca.configureZoning(portGroup, initiatorGroup, networkMap, assigner, null, null, null);
        VPlexBackendManager mgr = new VPlexBackendManager(null, null, null, null, null, URI.create("project"), URI.create("tenant"), null, null);
        ExportMask exportMask = mgr.generateExportMask(arrayURI, maskName, portGroup, initiatorGroup, zoningMap);
    }
    _log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
}
Also used : StringSetMap(com.emc.storageos.db.client.model.StringSetMap) HashSet(java.util.HashSet) Set(java.util.Set) ExportMask(com.emc.storageos.db.client.model.ExportMask) VPlexBackendManager(com.emc.storageos.vplexcontroller.VPlexBackendManager) StoragePort(com.emc.storageos.db.client.model.StoragePort) URI(java.net.URI) StoragePortsAssigner(com.emc.storageos.volumecontroller.placement.StoragePortsAssigner) Initiator(com.emc.storageos.db.client.model.Initiator) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) StringSetMap(com.emc.storageos.db.client.model.StringSetMap)

Aggregations

Initiator (com.emc.storageos.db.client.model.Initiator)11 StoragePort (com.emc.storageos.db.client.model.StoragePort)11 StringSetMap (com.emc.storageos.db.client.model.StringSetMap)11 VPlexBackendManager (com.emc.storageos.vplexcontroller.VPlexBackendManager)11 URI (java.net.URI)11 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)11 HashSet (java.util.HashSet)11 List (java.util.List)11 Map (java.util.Map)11 Set (java.util.Set)11 StoragePortsAssigner (com.emc.storageos.volumecontroller.placement.StoragePortsAssigner)7 ExportMask (com.emc.storageos.db.client.model.ExportMask)5 DummyDbClient (com.emc.storageos.util.DummyDbClient)4 NetworkLite (com.emc.storageos.util.NetworkLite)4 PortAllocatorTestContext (com.emc.storageos.volumecontroller.placement.PortAllocatorTestContext)4 PortAllocationContext (com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)4