use of com.emc.storageos.vplex.api.VPlexStorageViewInfo in project coprhd-controller by CoprHD.
the class VPlexCommunicationInterface method updateWwnAndHluInfo.
/**
* For a given UnManagedVolume, determine the wwn from the storage views it is in.
*
* @param unManagedVolume the UnManagedVolume to check
* @param volumeName the original name of the Virtual Volume
* @param storageViews the VPlexStorageViewInfo set the unmanaged volume is found in
*/
private void updateWwnAndHluInfo(UnManagedVolume unManagedVolume, String volumeName, Set<VPlexStorageViewInfo> storageViews) {
if (null != storageViews) {
String wwn = unManagedVolume.getWwn();
StringSet hluMappings = new StringSet();
for (VPlexStorageViewInfo storageView : storageViews) {
if (wwn == null || wwn.isEmpty()) {
// the wwn may have been found in the virtual volume, if this is a 5.4+ VPLEX
// otherwise, we need to check in the storage view mappings for a WWN (5.3 and before)
wwn = storageView.getWWNForStorageViewVolume(volumeName);
s_logger.info("found wwn {} for unmanaged volume {}", wwn, volumeName);
if (wwn != null) {
unManagedVolume.setWwn(BlockObject.normalizeWWN(wwn));
}
}
Integer hlu = storageView.getHLUForStorageViewVolume(volumeName);
if (hlu != null) {
hluMappings.add(storageView.getName() + "=" + hlu.toString());
}
}
if (!hluMappings.isEmpty()) {
s_logger.info("setting HLU_TO_EXPORT_MASK_NAME_MAP for unmanaged volume {} to " + hluMappings, volumeName);
unManagedVolume.putVolumeInfo(SupportedVolumeInformation.HLU_TO_EXPORT_MASK_NAME_MAP.name(), hluMappings);
}
}
}
Aggregations