Search in sources :

Example 31 with PortAllocationContext

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

the class StoragePortsAllocatorTest method testFC.

protected static void testFC() throws Exception {
    PortAllocationContext ctx = createVNX2director4portFC();
    StoragePortsAllocator allocator = new StoragePortsAllocator();
    if (!vmaxonly && !vplexonly) {
        alloc(allocator, 1, ctx, true);
        alloc(allocator, 2, ctx, true);
        alloc(allocator, 4, ctx, true);
        alloc(allocator, 8, ctx, true);
        alloc(allocator, 16, ctx, true);
        alloc(allocator, 32, ctx, true);
    }
    if (!vnxonly && !vplexonly) {
        ctx = createVMAX3engine4portFC();
        allocator = new StoragePortsAllocator();
        alloc(allocator, 1, ctx, true);
        alloc(allocator, 2, ctx, true);
        alloc(allocator, 4, ctx, true);
        alloc(allocator, 8, ctx, true);
        duplicateCpuExpected = true;
        alloc(allocator, 16, ctx, true);
        duplicateCpuExpected = true;
        alloc(allocator, 32, ctx, true);
        alloc(allocator, 4, ctx, true);
        Map<String, Integer> switchMap = new HashMap<String, Integer>();
        switchMap.put("mds-a", 4);
        System.out.println("testing swich affinity");
        alloc(allocator, 4, ctx, true, switchMap);
        ctx = createVMAXWithCpuDuplication();
        allocator = new StoragePortsAllocator();
        alloc(allocator, 1, ctx, true);
        alloc(allocator, 2, ctx, true);
        alloc(allocator, 3, ctx, true);
        _log.debug("Cpu duplication forced");
        duplicateCpuExpected = true;
        alloc(allocator, 4, ctx, true);
    }
    if (!vnxonly && !vmaxonly) {
        ctx = createVplex1engine4portFC();
        allocator = new StoragePortsAllocator();
        _log.info("Start Vplex 1 engine port allocation");
        alloc(allocator, 1, ctx, true);
        alloc(allocator, 2, ctx, true);
        alloc(allocator, 4, ctx, true);
        alloc(allocator, 8, ctx, true);
        alloc(allocator, 16, ctx, true);
        alloc(allocator, 32, ctx, true);
        _log.info("Done with Vplex 1 engine port allocation");
        _log.info("Start Vplex 2 engine port allocation");
        ctx = createVplex2engine4portFC();
        allocator = new StoragePortsAllocator();
        alloc(allocator, 1, ctx, true);
        alloc(allocator, 2, ctx, true);
        alloc(allocator, 4, ctx, true);
        alloc(allocator, 8, ctx, true);
        alloc(allocator, 16, ctx, true);
        alloc(allocator, 32, ctx, true);
        _log.info("Done with Vplex 2 engine port allocation");
        _log.info("Start Vplex 4 engine port allocation");
        ctx = createVplex4engine4portFC();
        allocator = new StoragePortsAllocator();
        alloc(allocator, 1, ctx, true);
        alloc(allocator, 2, ctx, true);
        alloc(allocator, 4, ctx, true);
        alloc(allocator, 8, ctx, true);
        alloc(allocator, 16, ctx, true);
        alloc(allocator, 32, ctx, true);
        _log.info("Done with Vplex 4 engine port allocation");
        runIterations(50, allocator, 4, ctx, true);
        System.out.println("Symmetrical two transport zones each with four directors two ports each");
        test2tzones(1, createTzone1FC(), createTzone2FC(), true);
        test2tzones(2, createTzone1FC(), createTzone2FC(), true);
        test2tzones(4, createTzone1FC(), createTzone2FC(), true);
        System.out.println("Asymmetrical transport zones, one with two directors, one with one");
        test2tzones(1, createTzone3FC(), createTzone4FC(), true);
        test2tzones(2, createTzone3FC(), createTzone4FC(), true);
        test2tzones(4, createTzone3FC(), createTzone4FC(), true);
    }
}
Also used : HashMap(java.util.HashMap) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 32 with PortAllocationContext

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

the class StoragePortsAllocatorTest method createVMAX3engine4portFC.

protected static PortAllocationContext createVMAX3engine4portFC() {
    NetworkLite tz = new NetworkLite("Tzon3e4p1");
    PortAllocationContext context = new PortAllocationContext(tz, "test");
    StoragePort port;
    port = createFCPort("FA-7E:0", "50:00:00:00:00:00:00:00");
    addPort(context, port, null);
    port = createFCPort("FA-7E:1", "50:00:00:00:00:00:00:01");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-7F:2", "50:00:00:00:00:01:00:02");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-7F:3", "50:00:00:00:00:01:00:03");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-8E:0", "50:00:00:00:00:00:01:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-8E:1", "50:00:00:00:00:00:01:01");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-8F:2", "50:00:00:00:00:01:01:02");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-8F:3", "50:00:00:00:00:01:01:03");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-9E:0", "50:00:00:00:00:00:02:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-9E:1", "50:00:00:00:00:00:02:01");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-9F:2", "50:00:00:00:00:01:02:02");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-9F:3", "50:00:00:00:00:01:02:03");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-10E:0", "50:00:00:00:00:00:03:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-10E:1", "50:00:00:00:00:00:03:01");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-10F:2", "50:00:00:00:00:01:03:02");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-10F:3", "50:00:00:00:00:01:03:03");
    addPort(context, port, null);
    port = createFCPort("FA-11E:0", "50:00:00:00:00:00:04:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-11E:1", "50:00:00:00:00:00:04:01");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-11F:2", "50:00:00:00:00:01:04:02");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-11F:3", "50:00:00:00:00:01:04:03");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-12E:0", "50:00:00:00:00:00:05:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-12E:1", "50:00:00:00:00:00:05:01");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-12F:2", "50:00:00:00:00:01:05:02");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-12F:3", "50:00:00:00:00:01:05:03");
    addPort(context, port, "mds-b");
    return context;
}
Also used : NetworkLite(com.emc.storageos.util.NetworkLite) StoragePort(com.emc.storageos.db.client.model.StoragePort) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 33 with PortAllocationContext

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

the class StoragePortsAssignerTest method testVMAX4NetAllocAssign.

public static void testVMAX4NetAllocAssign(Map<URI, List<Initiator>> net2InitiatorsMapA, Map<URI, List<Initiator>> net2InitiatorsMapB, Map<URI, List<Initiator>> net2InitiatorsMapC, Map<URI, List<Initiator>> net2InitiatorsMapD, int maxPaths, int minPaths, int pathsPerInitiator, int initiatorsPerPort) throws Exception {
    Map<URI, Map<URI, List<Initiator>>> hostToNetToInitiatorsMap = new HashMap<URI, Map<URI, List<Initiator>>>();
    URI hostA = getHostURI(net2InitiatorsMapA);
    hostToNetToInitiatorsMap.put(hostA, net2InitiatorsMapA);
    if (net2InitiatorsMapB != null) {
        URI hostB = getHostURI(net2InitiatorsMapB);
        hostToNetToInitiatorsMap.put(hostB, net2InitiatorsMapB);
    }
    if (net2InitiatorsMapC != null) {
        URI hostC = getHostURI(net2InitiatorsMapC);
        hostToNetToInitiatorsMap.put(hostC, net2InitiatorsMapC);
    }
    if (net2InitiatorsMapD != null) {
        URI hostD = getHostURI(net2InitiatorsMapD);
        hostToNetToInitiatorsMap.put(hostD, net2InitiatorsMapD);
    }
    PortAllocationContext net1ctx = createVmaxNet1();
    PortAllocationContext net2ctx = createVmaxNet2();
    PortAllocationContext net3ctx = createVmaxNet3();
    PortAllocationContext net4ctx = createVmaxNet4();
    PortAllocationContext[] contexts = new PortAllocationContext[] { net1ctx, net2ctx, net3ctx, net4ctx };
    testAllocationAssignment(contexts, hostToNetToInitiatorsMap, maxPaths, minPaths, pathsPerInitiator, initiatorsPerPort, "vmax", null);
}
Also used : Initiator(com.emc.storageos.db.client.model.Initiator) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) URI(java.net.URI) HashMap(java.util.HashMap) Map(java.util.Map) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 34 with PortAllocationContext

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

the class StoragePortsAssignerTest method testVMAX2NetAllocAssignWithSwitchAffinity.

public static void testVMAX2NetAllocAssignWithSwitchAffinity(Map<URI, List<Initiator>> net2InitiatorsMapA, Map<URI, List<Initiator>> net2InitiatorsMapB, int maxPaths, int minPaths, int pathsPerInitiator, int initiatorsPerPort) throws Exception {
    Map<URI, Map<URI, List<Initiator>>> hostToNetToInitiatorsMap = new HashMap<URI, Map<URI, List<Initiator>>>();
    URI hostA = getHostURI(net2InitiatorsMapA);
    hostToNetToInitiatorsMap.put(hostA, net2InitiatorsMapA);
    if (net2InitiatorsMapB != null) {
        URI hostB = getHostURI(net2InitiatorsMapB);
        hostToNetToInitiatorsMap.put(hostB, net2InitiatorsMapB);
    }
    PortAllocationContext net1ctx = createVmaxNet11();
    PortAllocationContext net2ctx = createVmaxNet22();
    PortAllocationContext[] contexts = new PortAllocationContext[] { net1ctx, net2ctx };
    testAllocationAssignmentWithSwitchAffinity(contexts, hostToNetToInitiatorsMap, maxPaths, minPaths, pathsPerInitiator, initiatorsPerPort, "vmax", null);
}
Also used : Initiator(com.emc.storageos.db.client.model.Initiator) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) URI(java.net.URI) HashMap(java.util.HashMap) Map(java.util.Map) PortAllocationContext(com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext)

Example 35 with PortAllocationContext

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

the class StoragePortsAssignerTest method createVmaxNet1.

protected static PortAllocationContext createVmaxNet1() {
    NetworkLite tz = new NetworkLite(URI.create("net1"), "net1");
    PortAllocationContext context = new PortAllocationContext(tz, "test");
    StoragePort port;
    port = createFCPort("FA-7E:0", "50:00:00:00:00:00:00:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-7E:1", "50:00:00:00:00:00:00:01");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-8E:0", "50:00:00:00:00:00:01:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-8E:1", "50:00:00:00:00:00:01:01");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-9E:0", "50:00:00:00:00:00:02:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-9E:1", "50:00:00:00:00:00:02:01");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-10E:0", "50:00:00:00:00:00:03:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-10E:1", "50:00:00:00:00:00:03:01");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-11E:0", "50:00:00:00:00:00:04:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-11E:1", "50:00:00:00:00:00:04:01");
    addPort(context, port, "mds-b");
    port = createFCPort("FA-12E:0", "50:00:00:00:00:00:05:00");
    addPort(context, port, "mds-a");
    port = createFCPort("FA-12E:1", "50:00:00:00:00:00:05:01");
    addPort(context, port, "mds-b");
    return context;
}
Also used : NetworkLite(com.emc.storageos.util.NetworkLite) StoragePort(com.emc.storageos.db.client.model.StoragePort) 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