use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.
the class StoragePortsAssignerTest method createVmaxNet22.
protected static PortAllocationContext createVmaxNet22() {
NetworkLite tz = new NetworkLite(URI.create("net2"), "net2");
PortAllocationContext context = new PortAllocationContext(tz, "test");
StoragePort port;
port = createFCPort("FA-7F:2", "50:00:00:00:00:01:00:02");
addPort(context, port, "mds-a");
port = createFCPort("FA-7F:3", "50:00:00:00:00:01:00:03");
addPort(context, port, "mds-b");
port = createFCPort("FA-8F:2", "50:00:00:00:00:01:01:02");
addPort(context, port, "mds-a");
port = createFCPort("FA-8F:3", "50:00:00:00:00:01:01:03");
addPort(context, port, "mds-b");
port = createFCPort("FA-9F:2", "50:00:00:00:00:01:02:02");
addPort(context, port, "mds-a");
port = createFCPort("FA-9F:3", "50:00:00:00:00:01:02:03");
addPort(context, port, "mds-b");
port = createFCPort("FA-10F:2", "50:00:00:00:00:01:03:02");
addPort(context, port, "mds-a");
port = createFCPort("FA-10F:3", "50:00:00:00:00:01:03:03");
addPort(context, port, "mds-b");
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-12F:2", "50:00:00:00:00:01:05:02");
addPort(context, port, "mds-a");
port = createFCPort("FA-12F:3", "50:00:00:00:00:01:05:03");
addPort(context, port, "mds-b");
return context;
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.
the class StoragePortsAssignerTest method testVMAX2NetAllocIncrementalAssignWithSwitchAffinity.
public static void testVMAX2NetAllocIncrementalAssignWithSwitchAffinity(Map<URI, List<Initiator>> net2InitiatorsMapA, Map<URI, List<Initiator>> net2InitiatorsMapB, int initialMaxPaths, int initialPathsPerInitiator, int finalMaxPaths, int finalPathsPerInitiator) throws Exception {
Map<URI, Map<URI, List<Initiator>>> hostToNetToInitiatorsMap = new HashMap<URI, Map<URI, List<Initiator>>>();
URI hostA = getHostURI(net2InitiatorsMapA);
hostToNetToInitiatorsMap = getHostInitiatorsMap(net2InitiatorsMapA);
PortAllocationContext net1ctx = createVmaxNet11();
PortAllocationContext net2ctx = createVmaxNet22();
PortAllocationContext[] contexts = new PortAllocationContext[] { net1ctx, net2ctx };
// Allocate initial assignments
System.out.println("***** Initial assignments: *****");
Map<Initiator, List<StoragePort>> assignments = testAllocationAssignment(contexts, hostToNetToInitiatorsMap, initialMaxPaths, 0, initialPathsPerInitiator, 1, "vmax", null);
URI hostB = getHostURI(net2InitiatorsMapB);
if (hostA.equals(hostB)) {
Map<URI, List<Initiator>> mergedNet2Initiators = new HashMap<URI, List<Initiator>>();
for (URI netA : net2InitiatorsMapA.keySet()) {
mergedNet2Initiators.put(netA, new ArrayList<Initiator>(net2InitiatorsMapA.get(netA)));
}
for (URI netb : net2InitiatorsMapB.keySet()) {
if (mergedNet2Initiators.containsKey(netb)) {
mergedNet2Initiators.get(netb).addAll(net2InitiatorsMapB.get(netb));
} else {
mergedNet2Initiators.put(netb, new ArrayList<Initiator>(net2InitiatorsMapB.get(netb)));
}
}
hostToNetToInitiatorsMap = getHostInitiatorsMap(mergedNet2Initiators);
} else {
hostToNetToInitiatorsMap.put(hostB, net2InitiatorsMapB);
}
System.out.println("***** Incremental assignments for switch affinity: *****" + " maxPaths " + finalMaxPaths + " ppi " + finalPathsPerInitiator);
assignments = testAllocationAssignmentWithSwitchAffinity(contexts, hostToNetToInitiatorsMap, finalMaxPaths, 0, finalPathsPerInitiator, 1, "vmax", assignments);
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.
the class StoragePortsAssignerTest method testVNX2NetAllocAssign.
/**
* Test allocation in a VNX two network environment.
*
* @param net2InitiatorsMapA -- initiators for host A
* @param net2InitiatorsMapB -- initiators for host B (optional)
* @param net2InitiatorsMapC -- initiators for host C (optional)
* @param net2InitiatorsMapD -- initiators for host D (optional)
* @param maxPaths
* @param minPaths
* @param pathsPerInitiator
* @param initiatorsPerPort
*/
public static void testVNX2NetAllocAssign(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, boolean isSwitchAffinity) 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 = createVNXNet1();
PortAllocationContext net2ctx = createVNXNet2();
PortAllocationContext[] contexts = new PortAllocationContext[] { net1ctx, net2ctx };
if (!isSwitchAffinity) {
testAllocationAssignment(contexts, hostToNetToInitiatorsMap, maxPaths, minPaths, pathsPerInitiator, initiatorsPerPort, "vnxblock", null);
} else {
testAllocationAssignmentWithSwitchAffinity(contexts, hostToNetToInitiatorsMap, maxPaths, minPaths, pathsPerInitiator, initiatorsPerPort, "vnxblock", null);
}
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.
the class StoragePortsAssignerTest method testVMAX2NetAllocIncrementalAssign.
public static void testVMAX2NetAllocIncrementalAssign(Map<URI, List<Initiator>> net2InitiatorsMapA, Map<URI, List<Initiator>> net2InitiatorsMapB, int initialMaxPaths, int initialPathsPerInitiator, int finalMaxPaths, int finalPathsPerInitiator) throws Exception {
Map<URI, Map<URI, List<Initiator>>> hostToNetToInitiatorsMap = new HashMap<URI, Map<URI, List<Initiator>>>();
URI hostA = getHostURI(net2InitiatorsMapA);
hostToNetToInitiatorsMap = getHostInitiatorsMap(net2InitiatorsMapA);
PortAllocationContext net1ctx = createVmaxNet1();
PortAllocationContext net2ctx = createVmaxNet2();
PortAllocationContext[] contexts = new PortAllocationContext[] { net1ctx, net2ctx };
// Allocate initial assignments
System.out.println("***** Initial assignments: *****");
Map<Initiator, List<StoragePort>> assignments = testAllocationAssignment(contexts, hostToNetToInitiatorsMap, initialMaxPaths, 0, initialPathsPerInitiator, 1, "vmax", null);
URI hostB = getHostURI(net2InitiatorsMapB);
if (hostA.equals(hostB)) {
Map<URI, List<Initiator>> mergedNet2Initiators = new HashMap<URI, List<Initiator>>();
for (URI netA : net2InitiatorsMapA.keySet()) {
mergedNet2Initiators.put(netA, new ArrayList<Initiator>(net2InitiatorsMapA.get(netA)));
}
for (URI netb : net2InitiatorsMapB.keySet()) {
if (mergedNet2Initiators.containsKey(netb)) {
mergedNet2Initiators.get(netb).addAll(net2InitiatorsMapB.get(netb));
} else {
mergedNet2Initiators.put(netb, new ArrayList<Initiator>(net2InitiatorsMapB.get(netb)));
}
}
hostToNetToInitiatorsMap = getHostInitiatorsMap(mergedNet2Initiators);
} else {
hostToNetToInitiatorsMap.put(hostB, net2InitiatorsMapB);
}
System.out.println("***** Incremental assignments: *****" + " maxPaths " + finalMaxPaths + " ppi " + finalPathsPerInitiator);
assignments = testAllocationAssignment(contexts, hostToNetToInitiatorsMap, finalMaxPaths, 0, finalPathsPerInitiator, 1, "vmax", assignments);
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAllocator.PortAllocationContext in project coprhd-controller by CoprHD.
the class StoragePortsAssignerTest method createVNXNet3.
protected static PortAllocationContext createVNXNet3() {
NetworkLite tz = new NetworkLite(URI.create("net1"), "net1");
PortAllocationContext context = new PortAllocationContext(tz, "test");
StoragePort port;
port = createFCPort("SP_A:0", "50:00:00:00:00:00:00:00");
addPort(context, port, "mds-a");
port = createFCPort("SP_B:0", "50:00:00:00:00:00:01:00");
addPort(context, port, "mds-a");
return context;
}
Aggregations