use of com.emc.storageos.volumecontroller.placement.StoragePortsAssigner in project coprhd-controller by CoprHD.
the class RPDeviceController method computeNumPaths.
/**
* Compute the number of paths to use on the back end array.
* This is done on a per Network basis and then summed together.
* Within each Network, we determine the number of ports available, and then
* convert to paths. Currently we don't allocate more paths than initiators.
*
* @param initiatorPortMap
* -- used to determine networks and initiator counts
* @param varray
* -- only Networks in the specified varray are considered
* @param array
* -- StorageSystem -- used to determine available ports
* @return
*/
private Integer computeNumPaths(Map<URI, List<StoragePort>> initiatorPortMap, URI varray, StorageSystem array) {
// Get the number of ports per path.
StoragePortsAssigner assigner = StoragePortsAssignerFactory.getAssigner(array.getSystemType());
int portsPerPath = assigner.getNumberOfPortsPerPath();
// Get the array's front end ports for this varray only
Map<URI, List<StoragePort>> arrayTargetMap = ConnectivityUtil.getStoragePortsOfTypeAndVArray(_dbClient, array.getId(), StoragePort.PortType.frontend, varray);
int numPaths = 0;
for (URI networkURI : initiatorPortMap.keySet()) {
if (arrayTargetMap.get(networkURI) != null) {
int pathsInNetwork = arrayTargetMap.get(networkURI).size() / portsPerPath;
int initiatorsInNetwork = initiatorPortMap.get(networkURI).size();
if (pathsInNetwork > initiatorsInNetwork) {
pathsInNetwork = initiatorsInNetwork;
}
_log.info(String.format("Network %s has %s paths", networkURI, pathsInNetwork));
numPaths += pathsInNetwork;
} else {
_log.info(String.format("Storage Array %s has no ports in Network %s", array.getNativeGuid(), networkURI));
}
}
return numPaths;
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAssigner in project coprhd-controller by CoprHD.
the class VPlexBackendManager method computeNumPaths.
/**
* Compute the number of paths to use on the back end array.
* This is done on a per Network basis and then summed together.
* Within each Network, we determine the number of ports available, and then
* convert to paths. Currently we don't allocate more paths than initiators.
*
* @param initiatorPortMap
* -- used to determine networks and initiator counts
* @param varray
* -- only Networks in the specified varray are considered
* @param array
* -- StorageSystem -- used to determine available ports
* @return
*/
private Integer computeNumPaths(Map<URI, List<StoragePort>> initiatorPortMap, URI varray, StorageSystem array) {
// Get the number of ports per path.
StoragePortsAssigner assigner = StoragePortsAssignerFactory.getAssigner(array.getSystemType());
int portsPerPath = assigner.getNumberOfPortsPerPath();
// Get the array's front end ports
Map<URI, List<StoragePort>> arrayTargetMap = ConnectivityUtil.getStoragePortsOfTypeAndVArray(_dbClient, array.getId(), StoragePort.PortType.frontend, varray);
int numPaths = 0;
for (URI networkURI : initiatorPortMap.keySet()) {
if (arrayTargetMap.get(networkURI) != null) {
int pathsInNetwork = arrayTargetMap.get(networkURI).size() / portsPerPath;
int initiatorsInNetwork = initiatorPortMap.get(networkURI).size();
if (pathsInNetwork > initiatorsInNetwork) {
pathsInNetwork = initiatorsInNetwork;
}
_log.info(String.format("Network %s has %s paths", networkURI, pathsInNetwork));
numPaths += pathsInNetwork;
} else {
_log.info(String.format("Storage Array %s has no ports in Network %s", array.getNativeGuid(), networkURI));
}
}
return numPaths;
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAssigner in project coprhd-controller by CoprHD.
the class VPlexVmaxMaskingOrchestratorTest method makeExportMasks.
private static void makeExportMasks(URI arrayURI, VPlexVmaxMaskingOrchestrator orca, Set<Map<URI, List<List<StoragePort>>>> portGroups, Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups, Map<URI, NetworkLite> networkMap) {
// Iterate through the PortGroups generating zoning info and an ExportMask
Iterator<Map<String, Map<URI, Set<Initiator>>>> igIterator = initiatorGroups.iterator();
for (Map<URI, List<List<StoragePort>>> portGroup : portGroups) {
String maskName = "testMask" + maskCounter.toString();
maskCounter++;
_log.info("Generating ExportMask: " + maskName);
if (!igIterator.hasNext()) {
igIterator = initiatorGroups.iterator();
}
Map<String, Map<URI, Set<Initiator>>> initiatorGroup = igIterator.next();
StoragePortsAssigner assigner = StoragePortsAssignerFactory.getAssignerForZones("vmax", null);
StringSetMap zoningMap = orca.configureZoning(portGroup, initiatorGroup, networkMap, assigner, null, null, null);
VPlexBackendManager mgr = new VPlexBackendManager(null, null, null, null, null, URI.create("project"), URI.create("tenant"), null, null);
mgr.generateExportMask(arrayURI, maskName, portGroup, initiatorGroup, zoningMap);
}
_log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAssigner in project coprhd-controller by CoprHD.
the class VPlexVnxMaskingOrchestratorTest method makeExportMasksSA.
private static void makeExportMasksSA(URI arrayURI, VPlexVnxMaskingOrchestrator orca, Set<Map<URI, List<List<StoragePort>>>> portGroups, Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups, Map<URI, NetworkLite> networkMap, Map<URI, String> initiatorSwitchMap, Map<URI, Map<String, List<StoragePort>>> portSwitchMap) {
// Iterate through the PortGroups generating zoning info and an ExportMask
Iterator<Map<String, Map<URI, Set<Initiator>>>> igIterator = initiatorGroups.iterator();
for (Map<URI, List<List<StoragePort>>> portGroup : portGroups) {
String maskName = "testMask" + maskCounter.toString();
maskCounter++;
_log.info("Generating ExportMask: " + maskName);
if (!igIterator.hasNext()) {
igIterator = initiatorGroups.iterator();
}
Map<String, Map<URI, Set<Initiator>>> initiatorGroup = igIterator.next();
StoragePortsAssigner assigner = StoragePortsAssignerFactory.getAssignerForZones("vnxblock", null);
StringSetMap zoningMap = orca.configureZoning(portGroup, initiatorGroup, networkMap, assigner, initiatorSwitchMap, portSwitchMap, VPlexVmaxMaskingOrchestratorTest.getPortSwitchNameMap(portSwitchMap));
VPlexBackendManager mgr = new VPlexBackendManager(null, null, null, null, null, URI.create("project"), URI.create("tenant"), null, null);
ExportMask exportMask = mgr.generateExportMask(arrayURI, maskName, portGroup, initiatorGroup, zoningMap);
}
_log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
}
use of com.emc.storageos.volumecontroller.placement.StoragePortsAssigner in project coprhd-controller by CoprHD.
the class VPlexXtremIOMaskingOrchestratorTest method makeExportMasksSA.
/**
* Make export masks with switch affinity
*
* @param arrayURI
* @param orca
* @param portGroups
* @param initiatorGroups
* @param networkMap
*/
private static void makeExportMasksSA(URI arrayURI, VplexXtremIOMaskingOrchestrator orca, Set<Map<URI, List<List<StoragePort>>>> portGroups, Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups, Map<URI, NetworkLite> networkMap, Map<URI, String> initiatorSwitchMap, Map<URI, Map<String, List<StoragePort>>> portSwitchMap) {
// Iterate through the PortGroups generating zoning info and an ExportMask
Iterator<Map<String, Map<URI, Set<Initiator>>>> igIterator = initiatorGroups.iterator();
for (Map<URI, List<List<StoragePort>>> portGroup : portGroups) {
String maskName = "testMask" + maskCounter.toString();
maskCounter++;
_log.info("Generating ExportMask: " + maskName);
if (!igIterator.hasNext()) {
igIterator = initiatorGroups.iterator();
}
Map<String, Map<URI, Set<Initiator>>> initiatorGroup = igIterator.next();
StoragePortsAssigner assigner = StoragePortsAssignerFactory.getAssignerForZones("vmax", null);
StringSetMap zoningMap = orca.configureZoning(portGroup, initiatorGroup, networkMap, assigner, initiatorSwitchMap, portSwitchMap, VPlexVmaxMaskingOrchestratorTest.getPortSwitchNameMap(portSwitchMap));
VPlexBackendManager mgr = new VPlexBackendManager(null, null, null, null, null, URI.create("project"), URI.create("tenant"), null, null);
ExportMask exportMask = mgr.generateExportMask(arrayURI, maskName, portGroup, initiatorGroup, zoningMap);
}
_log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
}
Aggregations