Search in sources :

Example 21 with VPlexStorageViewInfo

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);
        }
    }
}
Also used : VPlexStorageViewInfo(com.emc.storageos.vplex.api.VPlexStorageViewInfo) StringSet(com.emc.storageos.db.client.model.StringSet)

Aggregations

VPlexStorageViewInfo (com.emc.storageos.vplex.api.VPlexStorageViewInfo)21 URI (java.net.URI)18 VPlexApiClient (com.emc.storageos.vplex.api.VPlexApiClient)16 ExportMask (com.emc.storageos.db.client.model.ExportMask)15 ArrayList (java.util.ArrayList)15 NamedURI (com.emc.storageos.db.client.model.NamedURI)14 URISyntaxException (java.net.URISyntaxException)14 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)12 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)12 VPlexApiException (com.emc.storageos.vplex.api.VPlexApiException)12 IOException (java.io.IOException)12 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)11 Initiator (com.emc.storageos.db.client.model.Initiator)10 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)10 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)10 ControllerException (com.emc.storageos.volumecontroller.ControllerException)10 WorkflowException (com.emc.storageos.workflow.WorkflowException)10 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)9 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)9 HashMap (java.util.HashMap)9