Search in sources :

Example 46 with PortAllocationContext

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

the class VPlexHDSMaskingOrchestratorTest 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("FA-7F:0", "50:00:00:00:00:00:00:7F:00");
    ports.add(port);
    port = createFCPort("FA-8F:0", "50:00:00:00:00:00:00:8F:00");
    ports.add(port);
    port = createFCPort("FA-9F:0", "50:00:00:00:00:00:00:9F:00");
    ports.add(port);
    port = createFCPort("FA-10F:0", "50:00:00:00:00:00:00:AF:00");
    ports.add(port);
    port = createFCPort("FA-7H:0", "50:00:00:00:00:00:00:72:00");
    ports.add(port);
    port = createFCPort("FA-8H:0", "50:00:00:00:00:00:00:82:00");
    ports.add(port);
    port = createFCPort("FA-9H:0", "50:00:00:00:00:00:00:92:00");
    ports.add(port);
    port = createFCPort("FA-10H:0", "50:00:00:00:00:00:00:A2: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 47 with PortAllocationContext

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

the class VPlexHDSMaskingOrchestratorTest method getNet0Ports.

private static PortAllocationContext getNet0Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
    String label = "net0";
    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("FA-7E:1", "50:00:00:00:00:00:00:7E:01");
    addPort(context, port, null);
    ports.add(port);
    port = createFCPort("FA-7F:1", "50:00:00:00:00:00:00:7F:01");
    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 48 with PortAllocationContext

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

the class VPlexHDSMaskingOrchestratorTest 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);
    VPlexHDSMaskingOrchestrator orca = new VPlexHDSMaskingOrchestrator(null, null);
    VPlexBackendManager bemgr = new VPlexBackendManager();
    orca.setSimulation(true);
    URI arrayURI = URI.create("hdsArray");
    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);
    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);
    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);
    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");
    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);
    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);
    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);
    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);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) PortAllocatorTestContext(com.emc.storageos.volumecontroller.placement.PortAllocatorTestContext) HashMap(java.util.HashMap) NetworkLite(com.emc.storageos.util.NetworkLite) VPlexBackendManager(com.emc.storageos.vplexcontroller.VPlexBackendManager) StoragePort(com.emc.storageos.db.client.model.StoragePort) URI(java.net.URI) Initiator(com.emc.storageos.db.client.model.Initiator) DummyDbClient(com.emc.storageos.util.DummyDbClient) ArrayList(java.util.ArrayList) List(java.util.List) 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 49 with PortAllocationContext

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

the class VPlexHDSMaskingOrchestratorTest method getNet5Ports.

private static PortAllocationContext getNet5Ports(Map<URI, NetworkLite> networkMap, Map<URI, List<StoragePort>> allocatablePorts) {
    String label = "net5";
    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("FA-6E:0", "50:00:00:00:00:00:00:6E:00");
    ports.add(port);
    port = createFCPort("FA-7E:0", "50:00:00:00:00:00:00:7E:00");
    ports.add(port);
    port = createFCPort("FA-8E:0", "50:00:00:00:00:00:00:8E:00");
    ports.add(port);
    port = createFCPort("FA-9E:0", "50:00:00:00:00:00:00:9E:00");
    ports.add(port);
    port = createFCPort("FA-10E:0", "50:00:00:00:00:00:00:AE:00");
    ports.add(port);
    port = createFCPort("FA-11E:0", "50:00:00:00:00:00:00:BE:00");
    ports.add(port);
    port = createFCPort("FA-6G:0", "50:00:00:00:00:00:00:61:00");
    ports.add(port);
    port = createFCPort("FA-7G:0", "50:00:00:00:00:00:00:71:00");
    ports.add(port);
    port = createFCPort("FA-8G:0", "50:00:00:00:00:00:00:81:00");
    ports.add(port);
    port = createFCPort("FA-9G:0", "50:00:00:00:00:00:00:91:00");
    ports.add(port);
    port = createFCPort("FA-10G:0", "50:00:00:00:00:00:00:A1:00");
    ports.add(port);
    port = createFCPort("FA-11G:0", "50:00:00:00:00:00:00:B1: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 50 with PortAllocationContext

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

the class VPlexHDSMaskingOrchestratorTest 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("FA-10E:0", "50:00:00:00:00:00:00:AE:00");
    addPort(context, port, null);
    ports.add(port);
    port = createFCPort("FA-10F:0", "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