Search in sources :

Example 66 with PortAllocationContext

use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.

the class VPlexVnxMaskingOrchestratorTest method getNet3Ports.

private static PortAllocationContext getNet3Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
    String label = "net3";
    URI id = URI.create(label);
    NetworkLite net = new NetworkLite(id, label);
    networkMap.put(id, net);
    PortAllocationContext context = new PortAllocationContext(net, label);
    StoragePort port = null;
    List<StoragePort> ports = new ArrayList<StoragePort>();
    port = createFCPort("SP_A:1", "50:00:00:00:00:00:00:7E:00");
    ports.add(port);
    port = createFCPort("SP_B:1", "50:00:00:00:00:00:00:8E:00");
    ports.add(port);
    port = createFCPort("SP_A:3", "50:00:00:00:00:00:00:9E:00");
    ports.add(port);
    port = createFCPort("SP_B:3", "50:00:00:00:00:00:00:AE:00");
    ports.add(port);
    port = createFCPort("SP_A:5", "50:00:00:00:00:00:00:71:00");
    ports.add(port);
    port = createFCPort("SP_B:5", "50:00:00:00:00:00:00:81:00");
    ports.add(port);
    port = createFCPort("SP_A:7", "50:00:00:00:00:00:00:91:00");
    ports.add(port);
    allocatablePorts.put(id, ports);
    return context;
}
Also used : NetworkLite(com.emc.storageos.util.NetworkLite) StoragePort(com.emc.storageos.db.client.model.StoragePort) ArrayList(java.util.ArrayList) URI(java.net.URI) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 67 with PortAllocationContext

use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.

the class VPlexVnxMaskingOrchestratorTest method getNet1Ports.

private static PortAllocationContext getNet1Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
    String label = "net1";
    URI id = URI.create(label);
    NetworkLite net = new NetworkLite(id, label);
    networkMap.put(id, net);
    PortAllocationContext context = new PortAllocationContext(net, label);
    StoragePort port = null;
    List<StoragePort> ports = new ArrayList<StoragePort>();
    port = createFCPort("SP_A:1", "50:00:00:00:00:00:00:7E:00");
    addPort(context, port, null);
    ports.add(port);
    port = createFCPort("SP_B:1", "50:00:00:00:00:00:00:7F:00");
    addPort(context, port, null);
    ports.add(port);
    allocatablePorts.put(id, ports);
    return context;
}
Also used : NetworkLite(com.emc.storageos.util.NetworkLite) StoragePort(com.emc.storageos.db.client.model.StoragePort) ArrayList(java.util.ArrayList) URI(java.net.URI) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 68 with PortAllocationContext

use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.

the class VPlexXtremIOMaskingOrchestratorTest method getNet6Ports.

private static PortAllocationContext getNet6Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
    String label = "net6";
    URI id = URI.create(label);
    NetworkLite net = new NetworkLite(id, label);
    networkMap.put(id, net);
    PortAllocationContext context = new PortAllocationContext(net, label);
    StoragePort port = null;
    List<StoragePort> ports = new ArrayList<StoragePort>();
    port = createFCPort("X2-SC1:fc1", "50:00:00:00:00:00:00:7F:00");
    ports.add(port);
    port = createFCPort("X2-SC1:fc2", "50:00:00:00:00:00:00:8F:00");
    ports.add(port);
    port = createFCPort("X2-SC2:fc1", "50:00:00:00:00:00:00:9F:00");
    ports.add(port);
    port = createFCPort("X2-SC2:fc2", "50:00:00:00:00:00:00:AF:00");
    ports.add(port);
    allocatablePorts.put(id, ports);
    return context;
}
Also used : NetworkLite(com.emc.storageos.util.NetworkLite) StoragePort(com.emc.storageos.db.client.model.StoragePort) ArrayList(java.util.ArrayList) URI(java.net.URI) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 69 with PortAllocationContext

use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.

the class VPlexXtremIOMaskingOrchestratorTest method main.

public static void main(String[] args) throws InterruptedException {
    VdcUtil.setDbClient(new DummyDbClient());
    PropertyConfigurator.configure("log4j.properties");
    _log.info("Beginning logging");
    PortAllocatorTestContext contextPrototype = new PortAllocatorTestContext();
    StoragePortsAllocator.setContextPrototype(contextPrototype);
    VplexXtremIOMaskingOrchestrator orca = new VplexXtremIOMaskingOrchestrator(null, null);
    VPlexBackendManager bemgr = new VPlexBackendManager();
    orca.setSimulation(true);
    URI arrayURI = URI.create("vmaxArray");
    Map<String, Set<String>> directorToInitiators = new HashMap<String, Set<String>>();
    Map<String, URI> initiatorIdToNetwork = new HashMap<String, URI>();
    Map<String, Initiator> initiatorMap = new HashMap<String, Initiator>();
    PortAllocationContext context = null;
    Map<URI, NetworkLite> networkMap = new HashMap<URI, NetworkLite>();
    Map<URI, List<StoragePort>> allocatablePorts = new HashMap<URI, List<StoragePort>>();
    URI varray1 = URI.create("varray1");
    // single VPLEX Engine
    /**
     * Single VPLEX Engine (2 Directors)
     * Single X-brick (2 SCs, 4 storage ports), 2 networks
     * SC ports spread across networks
     */
    context = getNet1Ports(networkMap, allocatablePorts);
    context = getNet2Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
    Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    // orca.getInitiatorGroups(directorToInitiators, initiatorIdToNetwork, initiatorMap);
    int directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    Set<Map<URI, List<List<StoragePort>>>> portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Single VPLEX Engine (2 Directors)
     * Dual X-bricks (4 SCs, 8 storage ports), 2 networks
     * ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet3Ports(networkMap, allocatablePorts);
    context = getNet4Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Single VPLEX Engine (2 Directors)
     * Dual X-bricks (4 SCs, 8 storage ports), 2 networks
     * network-1 has X-brick 1's ports; network-2 has X-brick 2's ports;
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet5Ports(networkMap, allocatablePorts);
    context = getNet6Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net5", "net6", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Single VPLEX Engine (2 Directors)
     * Quad X-bricks (8 SCs, 16 storage ports), 2 networks
     * ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet7Ports(networkMap, allocatablePorts);
    context = getNet8Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Single VPLEX Engine (2 Directors)
     * Dual X-bricks (4 SCs, 3 ports from X-brick 1, 3 ports from X-brick 2), 2 networks
     * ports spread across networks with second network having only 2 ports
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNetAPorts(networkMap, allocatablePorts);
    context = getNetBPorts(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "netA", "netB", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    // Dual VPLEX Engine
    /**
     * Dual VPLEX Engine (4 Directors)
     * Single X-brick (2 SCs, 4 storage ports), 2 networks
     * SC ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet1Ports(networkMap, allocatablePorts);
    context = getNet2Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1DualEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Dual VPLEX Engine (4 Directors)
     * Dual X-bricks (4 SCs, 8 storage ports), 2 networks
     * ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet3Ports(networkMap, allocatablePorts);
    context = getNet4Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1DualEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Dual VPLEX Engine (4 Directors)
     * Quad X-bricks (8 SCs, 16 storage ports), 2 networks
     * ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet7Ports(networkMap, allocatablePorts);
    context = getNet8Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1DualEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    // Quad VPLEX Engine
    /**
     * Quad VPLEX Engine (8 Directors)
     * Single X-brick (2 SCs, 4 storage ports), 2 networks
     * SC ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet1Ports(networkMap, allocatablePorts);
    context = getNet2Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1QuadEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Quad VPLEX Engine (8 Directors)
     * Dual X-bricks (4 SCs, 8 storage ports), 2 networks
     * ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet3Ports(networkMap, allocatablePorts);
    context = getNet4Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1QuadEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Quad VPLEX Engine (8 Directors)
     * Quad X-bricks (8 SCs, 16 storage ports), 2 networks
     * ports spread across networks
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    context = getNet7Ports(networkMap, allocatablePorts);
    context = getNet8Ports(networkMap, allocatablePorts);
    logNetworks(allocatablePorts);
    getInitiatorsVplex154Clus1QuadEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
    makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
    /**
     * Switch affinity tests
     */
    context.reinitialize();
    networkMap.clear();
    allocatablePorts.clear();
    Map<URI, Map<String, List<StoragePort>>> portSwitchMap = new HashMap<URI, Map<String, List<StoragePort>>>();
    PortAllocationContext context1 = getNet3PortsSA(networkMap, allocatablePorts, portSwitchMap);
    PortAllocationContext context2 = getNet4PortsSA(networkMap, allocatablePorts, portSwitchMap);
    Map<URI, PortAllocationContext> contextMap = new HashMap<URI, PortAllocationContext>();
    contextMap.put(context1._initiatorNetwork.getId(), context1);
    contextMap.put(context2._initiatorNetwork.getId(), context2);
    logNetworks(allocatablePorts);
    Map<URI, String> initiatorSwitchMap = new HashMap<URI, String>();
    getInitiatorsVplex154Clus1DualEnginesSA(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3SA", "net4SA", initiatorSwitchMap);
    initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
    directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
    orca.setVplexDirectorCount(directorCount);
    Map<URI, Map<String, Integer>> switchPortNumber = getSwitchToPortNumber(networkMap.keySet(), 2);
    portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), switchPortNumber, contextMap, null);
    makeExportMasksSA(arrayURI, orca, portGroups, initiatorGroups, networkMap, initiatorSwitchMap, portSwitchMap);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) PortAllocatorTestContext(com.emc.storageos.volumecontroller.placement.PortAllocatorTestContext) HashMap(java.util.HashMap) URI(java.net.URI) Initiator(com.emc.storageos.db.client.model.Initiator) ArrayList(java.util.ArrayList) List(java.util.List) NetworkLite(com.emc.storageos.util.NetworkLite) VPlexBackendManager(com.emc.storageos.vplexcontroller.VPlexBackendManager) StoragePort(com.emc.storageos.db.client.model.StoragePort) DummyDbClient(com.emc.storageos.util.DummyDbClient) HashMap(java.util.HashMap) Map(java.util.Map) StringSetMap(com.emc.storageos.db.client.model.StringSetMap) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 70 with PortAllocationContext

use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.

the class VPlexXtremIOMaskingOrchestratorTest method getNet2Ports.

private static PortAllocationContext getNet2Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
    String label = "net2";
    URI id = URI.create(label);
    NetworkLite net = new NetworkLite(id, label);
    networkMap.put(id, net);
    PortAllocationContext context = new PortAllocationContext(net, label);
    StoragePort port = null;
    List<StoragePort> ports = new ArrayList<StoragePort>();
    port = createFCPort("X1-SC1:fc2", "50:00:00:00:00:00:00:AE:00");
    addPort(context, port, null);
    ports.add(port);
    port = createFCPort("X1-SC2:fc2", "50:00:00:00:00:00:00:AF:00");
    addPort(context, port, null);
    ports.add(port);
    allocatablePorts.put(id, ports);
    return context;
}
Also used : NetworkLite(com.emc.storageos.util.NetworkLite) StoragePort(com.emc.storageos.db.client.model.StoragePort) ArrayList(java.util.ArrayList) URI(java.net.URI) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Aggregations

PortAllocationContext (com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)95 StoragePort (com.emc.storageos.db.client.model.StoragePort)84 NetworkLite (com.emc.storageos.util.NetworkLite)82 URI (java.net.URI)65 ArrayList (java.util.ArrayList)65 HashMap (java.util.HashMap)28 List (java.util.List)27 Map (java.util.Map)20 Initiator (com.emc.storageos.db.client.model.Initiator)13 HashSet (java.util.HashSet)13 StringSetMap (com.emc.storageos.db.client.model.StringSetMap)10 Set (java.util.Set)7 StringMap (com.emc.storageos.db.client.model.StringMap)6 StringSet (com.emc.storageos.db.client.model.StringSet)6 StoragePortsAllocator (com.emc.storageos.volumecontroller.placement.StoragePortsAllocator)6 DummyDbClient (com.emc.storageos.util.DummyDbClient)5 PortAllocatorTestContext (com.emc.storageos.volumecontroller.placement.PortAllocatorTestContext)4 VPlexBackendManager (com.emc.storageos.vplexcontroller.VPlexBackendManager)4 ExportPathParams (com.emc.storageos.db.client.model.ExportPathParams)2