use of com.emc.storageos.util.NetworkLite in project coprhd-controller by CoprHD.
the class VPlexVmaxMaskingOrchestratorTest method main.
public static void main(String[] args) {
VdcUtil.setDbClient(new DummyDbClient());
PropertyConfigurator.configure("log4j.properties");
_log.info("Beginning logging");
PortAllocatorTestContext contextPrototype = new PortAllocatorTestContext();
StoragePortsAllocator.setContextPrototype(contextPrototype);
VPlexVmaxMaskingOrchestrator orca = new VPlexVmaxMaskingOrchestrator(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");
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null, null);
Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
// orca.getInitiatorGroups(directorToInitiators, initiatorIdToNetwork, initiatorMap);
Set<Map<URI, List<List<StoragePort>>>> portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet0Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net0", null, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
context = getNet4XPorts(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", "net4X", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet5Ports(networkMap, allocatablePorts);
context = getNet6Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net5", "net6", null, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet7Ports(networkMap, allocatablePorts);
context = getNet8Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet573APorts(networkMap, allocatablePorts);
context = getNet573BPorts(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net573A", "net573B", null, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
// switch affinity tests
networkMap.clear();
allocatablePorts.clear();
Map<URI, Map<String, List<StoragePort>>> portSwitchMap = new HashMap<URI, Map<String, List<StoragePort>>>();
Map<URI, PortAllocationContext> contextMap = new HashMap<URI, PortAllocationContext>();
PortAllocationContext context1 = getNet1PortsSA(networkMap, allocatablePorts, portSwitchMap);
PortAllocationContext context2 = getNet2PortsSA(networkMap, allocatablePorts, portSwitchMap);
contextMap.put(context1._initiatorNetwork.getId(), context1);
contextMap.put(context2._initiatorNetwork.getId(), context2);
logNetworks(allocatablePorts);
Map<URI, String> initiatorSwitchMap = new HashMap<URI, String>();
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net11", "net12", null, initiatorSwitchMap);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), getSwitchToPortNumber(networkMap.keySet(), 2), contextMap, null);
makeExportMasksSA(arrayURI, orca, portGroups, initiatorGroups, networkMap, initiatorSwitchMap, portSwitchMap);
}
use of com.emc.storageos.util.NetworkLite in project coprhd-controller by CoprHD.
the class VPlexVnxMaskingOrchestratorTest method getNet1PortsSA.
private static PortAllocationContext getNet1PortsSA(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts, Map<URI, Map<String, List<StoragePort>>> portSwitchMap) {
String label = "net11";
URI id = URI.create(label);
NetworkLite net = new NetworkLite(id, label);
networkMap.put(id, net);
Map<String, List<StoragePort>> switchMap = new HashMap<String, List<StoragePort>>();
PortAllocationContext context = new PortAllocationContext(net, label);
StoragePort port = null;
List<StoragePort> ports = new ArrayList<StoragePort>();
List<StoragePort> switchAPorts = new ArrayList<StoragePort>();
List<StoragePort> switchBPorts = new ArrayList<StoragePort>();
port = createFCPort("SP_A:1", "50:00:00:00:00:00:00:7E:00");
addPort(context, port, "mds-a");
ports.add(port);
switchAPorts.add(port);
port = createFCPort("SP_B:1", "50:00:00:00:00:00:00:7F:00");
addPort(context, port, "mds-a");
ports.add(port);
switchAPorts.add(port);
port = createFCPort("SP_A:3", "50:00:00:00:00:00:00:9E:00");
addPort(context, port, "mds-b");
ports.add(port);
switchBPorts.add(port);
port = createFCPort("SP_B:3", "50:00:00:00:00:00:00:AE:00");
addPort(context, port, "mds-b");
ports.add(port);
switchBPorts.add(port);
allocatablePorts.put(id, ports);
switchMap.put("mds-a", switchAPorts);
switchMap.put("mds-b", switchBPorts);
portSwitchMap.put(id, switchMap);
return context;
}
use of com.emc.storageos.util.NetworkLite in project coprhd-controller by CoprHD.
the class VPlexVnxMaskingOrchestratorTest method main.
public static void main(String[] args) {
VdcUtil.setDbClient(new DummyDbClient());
PropertyConfigurator.configure("log4j.properties");
_log.info("Beginning logging");
PortAllocatorTestContext contextPrototype = new PortAllocatorTestContext();
StoragePortsAllocator.setContextPrototype(contextPrototype);
VPlexVnxMaskingOrchestrator orca = new VPlexVnxMaskingOrchestrator(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");
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null, false, null);
Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, true, true);
Set<Map<URI, List<List<StoragePort>>>> portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null, false, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, true, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null, true, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, true, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null, true, null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, true, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
// switch affinity tests
networkMap.clear();
allocatablePorts.clear();
Map<URI, Map<String, List<StoragePort>>> portSwitchMap = new HashMap<URI, Map<String, List<StoragePort>>>();
Map<URI, PortAllocationContext> contextMap = new HashMap<URI, PortAllocationContext>();
PortAllocationContext context1 = getNet1PortsSA(networkMap, allocatablePorts, portSwitchMap);
PortAllocationContext context2 = getNet2PortsSA(networkMap, allocatablePorts, portSwitchMap);
contextMap.put(context1._initiatorNetwork.getId(), context1);
contextMap.put(context2._initiatorNetwork.getId(), context2);
logNetworks(allocatablePorts);
Map<URI, String> initiatorSwitchMap = new HashMap<URI, String>();
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net11", "net12", null, true, initiatorSwitchMap);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), getSwitchToPortNumber(networkMap.keySet(), 2), contextMap, null);
makeExportMasksSA(arrayURI, orca, portGroups, initiatorGroups, networkMap, initiatorSwitchMap, portSwitchMap);
}
use of com.emc.storageos.util.NetworkLite in project coprhd-controller by CoprHD.
the class VPlexVnxMaskingOrchestratorTest method getNet4Ports.
private static PortAllocationContext getNet4Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
String label = "net4";
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:2", "50:00:00:00:00:00:00:7F:00");
ports.add(port);
port = createFCPort("SP_B:2", "50:00:00:00:00:00:00:8F:00");
ports.add(port);
port = createFCPort("SP_A:4", "50:00:00:00:00:00:00:9F:00");
ports.add(port);
port = createFCPort("SP_B:4", "50:00:00:00:00:00:00:AF:00");
ports.add(port);
port = createFCPort("SP_A:6", "50:00:00:00:00:00:00:72:00");
ports.add(port);
port = createFCPort("SP_B:6", "50:00:00:00:00:00:00:82:00");
ports.add(port);
port = createFCPort("SP_B:8", "50:00:00:00:00:00:00:92:00");
ports.add(port);
allocatablePorts.put(id, ports);
return context;
}
use of com.emc.storageos.util.NetworkLite in project coprhd-controller by CoprHD.
the class VPlexXtremIOMaskingOrchestratorTest method getNet7Ports.
private static PortAllocationContext getNet7Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
String label = "net7";
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:fc1", "50:00:00:00:00:00:00:1E:00");
ports.add(port);
port = createFCPort("X1-SC2:fc1", "50:00:00:00:00:00:00:2E:00");
ports.add(port);
port = createFCPort("X2-SC1:fc1", "50:00:00:00:00:00:00:3E:00");
ports.add(port);
port = createFCPort("X2-SC2:fc1", "50:00:00:00:00:00:00:4E:00");
ports.add(port);
port = createFCPort("X3-SC1:fc1", "50:00:00:00:00:00:00:5E:00");
ports.add(port);
port = createFCPort("X3-SC2:fc1", "50:00:00:00:00:00:00:6E:00");
ports.add(port);
port = createFCPort("X4-SC1:fc1", "50:00:00:00:00:00:00:7E:00");
ports.add(port);
port = createFCPort("X4-SC2:fc1", "50:00:00:00:00:00:00:8E:00");
ports.add(port);
allocatablePorts.put(id, ports);
return context;
}
Aggregations