use of com.emc.storageos.db.client.model.ZoneInfo in project coprhd-controller by CoprHD.
the class ExportMaskUtils method getZoneMapFromZoneInfoMap.
/**
* Given zoneInfoMap stored in an UnManagedExportMask, create a zone map for the
* initiators in the list.
*
* @param zoneInfoMap zoneInfoMap stored from a UnManagedExportMask
* @param initiators a list of initiators for which the zone map should created
* @return a zone map of initiator-uri-to-list-of-ports-uris
*/
public static StringSetMap getZoneMapFromZoneInfoMap(ZoneInfoMap zoneInfoMap, List<Initiator> initiators) {
StringSetMap zoneMap = new StringSetMap();
if (zoneInfoMap != null && initiators != null) {
for (Initiator initiator : initiators) {
for (ZoneInfo info : zoneInfoMap.values()) {
if (info.getInitiatorId().equals(initiator.getId().toString())) {
zoneMap.put(initiator.getId().toString(), info.getPortId());
}
}
}
}
_log.info("getZoneMapFromZoneInfoMap created zone map {}", zoneMap);
return zoneMap;
}
use of com.emc.storageos.db.client.model.ZoneInfo in project coprhd-controller by CoprHD.
the class VNXUnityUnManagedObjectDiscoverer method updateZoningMap.
/**
* Set mask zoning map
*
* @param mask
* @param initiators
* @param storagePorts
*/
private void updateZoningMap(UnManagedExportMask mask, List<Initiator> initiators, List<StoragePort> storagePorts) {
ZoneInfoMap zoningMap = networkDeviceController.getInitiatorsZoneInfoMap(initiators, storagePorts);
for (ZoneInfo zoneInfo : zoningMap.values()) {
log.info("Found zone: {} for initiator {} and port {}", new Object[] { zoneInfo.getZoneName(), zoneInfo.getInitiatorWwn(), zoneInfo.getPortWwn() });
}
mask.setZoningMap(zoningMap);
}
use of com.emc.storageos.db.client.model.ZoneInfo in project coprhd-controller by CoprHD.
the class ExportMaskUtils method checkZoneUseInUnManagedExportMasks.
/**
* Check if a particular zone (as represented by a ZoneInfo) is in use by an UnManagedExportMask
* (excluding the UnManagedExportMask corresponding to the named exportMask.
* @param exportMaskName -- ExportMask name filed
* @param info -- ZoneInfo representing the Zone
* @param dbClient == databasehandle
* @return -- true IFF the same zone was found in other UnManagedExportMasks
*/
private static boolean checkZoneUseInUnManagedExportMasks(String exportMaskName, ZoneInfo info, DbClient dbClient) {
String initiatorWwn = info.getInitiatorWwn();
boolean inUse = false;
List<UnManagedExportMask> unmanagedMasks = CustomQueryUtility.queryActiveResourcesByAltId(dbClient, UnManagedExportMask.class, "knownInitiatorNetworkIds", initiatorWwn);
for (UnManagedExportMask umask : unmanagedMasks) {
if (umask.getKnownInitiatorNetworkIds().contains(initiatorWwn) && !umask.getUnmanagedVolumeUris().isEmpty()) {
for (ZoneInfo umZoneInfo : umask.getZoningMap().values()) {
if (exportMaskName.equals(umask.getMaskName())) {
continue;
}
if (info.getInitiatorWwn().equals(umZoneInfo.getInitiatorWwn()) && info.getPortWwn().equals(umZoneInfo.getPortWwn())) {
_log.info(String.format("UnManagedExportMask %s zone %s is using the same initiator %s and port %s", umask.getNativeId(), umZoneInfo.getZoneName(), umZoneInfo.getInitiatorWwn(), umZoneInfo.getPortWwn()));
inUse = true;
break;
}
}
}
}
return inUse;
}
use of com.emc.storageos.db.client.model.ZoneInfo in project coprhd-controller by CoprHD.
the class XtremIOUnManagedVolumeDiscoverer method updateZoningMap.
private void updateZoningMap(UnManagedExportMask mask, List<Initiator> initiators, List<StoragePort> storagePorts) {
ZoneInfoMap zoningMap = networkDeviceController.getInitiatorsZoneInfoMap(initiators, storagePorts);
for (ZoneInfo zoneInfo : zoningMap.values()) {
log.info("Found zone: {} for initiator {} and port {}", new Object[] { zoneInfo.getZoneName(), zoneInfo.getInitiatorWwn(), zoneInfo.getPortWwn() });
}
mask.setZoningMap(zoningMap);
}
use of com.emc.storageos.db.client.model.ZoneInfo in project coprhd-controller by CoprHD.
the class ExportProcessor method updateZoningMap.
private void updateZoningMap(UnManagedExportMask mask, List<Initiator> initiators, List<StoragePort> storagePorts) {
NetworkDeviceController networkDeviceController = (NetworkDeviceController) _keyMap.get(Constants.networkDeviceController);
try {
ZoneInfoMap zoningMap = networkDeviceController.getInitiatorsZoneInfoMap(initiators, storagePorts);
for (ZoneInfo zoneInfo : zoningMap.values()) {
_logger.info("Found zone: {} for initiator {} and port {}", new Object[] { zoneInfo.getZoneName(), zoneInfo.getInitiatorWwn(), zoneInfo.getPortWwn() });
}
mask.setZoningMap(zoningMap);
} catch (Exception ex) {
_logger.error("Failed to get the zoning map for mask {}", mask.getMaskName());
mask.setZoningMap(null);
}
}
Aggregations