use of com.emc.storageos.volumecontroller.placement.BlockStorageScheduler in project coprhd-controller by CoprHD.
the class ExportGroupService method filterOutInitiatorsNotAssociatedWithVArray.
/**
* Validate if the initiator is linked to the VirtualArray through some Network
* Routine will examine the 'newInitiators' list and remove any that do not have any association
* to the VirtualArrays associated with the StorageSystems.
*
* @param exportGroup [in] - ExportGroup object
* @param storageSystems [in] - Collection of StorageSystem URIs associated with this VArray
* @param connectedStorageSystems [in/out] - Optional parameter that will contain a list of
* StorageSystem URIs that have connections to the initiators
* @param newInitiators [in/out] - List of initiator URIs to examine.
*/
private void filterOutInitiatorsNotAssociatedWithVArray(ExportGroup exportGroup, Collection<URI> storageSystems, List<URI> connectedStorageSystems, List<URI> newInitiators) {
Iterator<URI> it = newInitiators.iterator();
BlockStorageScheduler blockScheduler = new BlockStorageScheduler();
blockScheduler.setDbClient(_dbClient);
List<URI> exportGroupInitiatorURIs = StringSetUtil.stringSetToUriList(exportGroup.getInitiators());
while (it.hasNext()) {
URI uri = it.next();
Initiator initiator = _dbClient.queryObject(Initiator.class, uri);
if (initiator == null) {
_log.info(String.format("Initiator %s was not found in DB. Will be eliminated from request payload.", uri.toString()));
it.remove();
continue;
}
Set<String> varraysConsidered = new HashSet<String>();
if (!hasConnectivityToAllSystems(initiator, storageSystems, connectedStorageSystems, exportGroup) || !isInitiatorInStorageSystemsNetwork(exportGroup, initiator, storageSystems, varraysConsidered)) {
_log.info(String.format("Initiator %s (%s) will be eliminated from the payload. " + "It was either not found to be connected to any of these StorageSystems [%s] that are " + "associated with VirtualArray(s) %s or not connected to any of its networks.", initiator.getInitiatorPort(), initiator.getId().toString(), Joiner.on(',').join(storageSystems), varraysConsidered.toString()));
// connections to the StorageSystems.
if (!exportGroupInitiatorURIs.contains(uri)) {
it.remove();
}
}
}
}
Aggregations