Search in sources :

Example 1 with HighAvailabilityVolume

use of com.emc.storageos.vasa.data.internal.Volume.HighAvailabilityVolume in project coprhd-controller by CoprHD.

the class SOSAlarmManager method getThinlyProvisionStatusOfHAVolumes.

private String getThinlyProvisionStatusOfHAVolumes(SyncManager manager, List<HighAvailabilityVolume> haVolList) throws StorageFault {
    final String methodName = "getThinlyProvisionStatusOfHAVolumes(): ";
    log.debug(methodName + "Entry with input: haVolList" + haVolList);
    String alarmStatus = null;
    StoragePool storagePool = null;
    Set<String> alarmSet = new HashSet<String>();
    for (HighAvailabilityVolume haVol : haVolList) {
        try {
            AssociatedPool associatedPool = manager.fetchAssociatedPoolOfVolume(haVol.getId());
            if (log.isTraceEnabled()) {
                log.trace(methodName + haVol.getId() + " is associated with " + associatedPool);
            }
            storagePool = manager.fetchStoragePoolByHref(associatedPool.getStoragepool().getLink().getHref());
            alarmStatus = this.getThinlyProvisionStatusOfStoragePool(storagePool);
            alarmSet.add(alarmStatus);
        } catch (SOSFailure e) {
            log.error(methodName + "SOSFailure failure occured", e);
            throw FaultUtil.StorageFault(e);
        }
    }
    if (alarmSet.contains(AlarmStatusEnum.Red.getValue())) {
        log.debug(methodName + "Exit returning [RED]");
        return AlarmStatusEnum.Red.getValue();
    }
    if (alarmSet.contains(AlarmStatusEnum.Yellow.getValue())) {
        log.debug(methodName + "Exit returning [YELLOW]");
        return AlarmStatusEnum.Yellow.getValue();
    }
    log.debug(methodName + "Exit returning [GREEN]");
    return AlarmStatusEnum.Green.getValue();
}
Also used : HighAvailabilityVolume(com.emc.storageos.vasa.data.internal.Volume.HighAvailabilityVolume) AssociatedPool(com.emc.storageos.vasa.data.internal.Volume.AssociatedPool) StoragePool(com.emc.storageos.vasa.data.internal.StoragePool) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) HashSet(java.util.HashSet)

Aggregations

StoragePool (com.emc.storageos.vasa.data.internal.StoragePool)1 AssociatedPool (com.emc.storageos.vasa.data.internal.Volume.AssociatedPool)1 HighAvailabilityVolume (com.emc.storageos.vasa.data.internal.Volume.HighAvailabilityVolume)1 SOSFailure (com.emc.storageos.vasa.fault.SOSFailure)1 HashSet (java.util.HashSet)1