Search in sources :

Example 1 with StoragePool

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

the class SOSAlarmManager method getThinlyProvisionedStatus.

public String getThinlyProvisionedStatus(SyncManager manager, Volume volume) throws StorageFault {
    final String methodName = "getThinlyProvisioningStatus(): ";
    log.debug(methodName + "Called with input:" + volume);
    if (volume != null && volume.isThinlyProvisioned()) {
        if (volume.getAllocatedCapacityInGB() >= volume.getRequestedCapacityInGB()) {
            return AlarmStatusEnum.Green.getValue();
        }
        try {
            if (volume.getHaVolumeList() != null && volume.getHaVolumeList().getHaVolumeList() != null) {
                // This is a VPlex volume
                return getThinlyProvisionStatusOfHAVolumes(manager, volume.getHaVolumeList().getHaVolumeList());
            } else {
                // This is a normal volume
                AssociatedPool associatedPool = manager.fetchAssociatedPoolOfVolume(volume.getId());
                StoragePool storagePool = manager.fetchStoragePoolByHref(associatedPool.getStoragepool().getLink().getHref());
                return this.getThinlyProvisionStatusOfStoragePool(storagePool);
            }
        } catch (SOSFailure e) {
            log.error(methodName + "SOSFailure failure occured", e);
            throw FaultUtil.StorageFault(e);
        }
    }
    return AlarmStatusEnum.Green.getValue();
}
Also used : AssociatedPool(com.emc.storageos.vasa.data.internal.Volume.AssociatedPool) StoragePool(com.emc.storageos.vasa.data.internal.StoragePool) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure)

Example 2 with StoragePool

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

the class SyncManager method fetchStoragePoolByHref.

public synchronized StoragePool fetchStoragePoolByHref(String href) throws SOSFailure {
    final String methodName = "fetchStoragePoolByHref(): ";
    log.trace(methodName + "Entry with href[" + href + "]");
    StoragePool storagePool = null;
    try {
        storagePool = _client.queryObject(href, StoragePool.class);
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    }
    log.trace(methodName + "Exit returning storagePool[ " + storagePool + "]");
    return storagePool;
}
Also used : StoragePool(com.emc.storageos.vasa.data.internal.StoragePool) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 3 with StoragePool

use of com.emc.storageos.vasa.data.internal.StoragePool 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)

Example 4 with StoragePool

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

the class SyncManager method fetchStoragePool.

public synchronized StoragePool fetchStoragePool(String storageSystemId, String storagePoolId) throws SOSFailure {
    final String methodName = "fetchStoragePool(): ";
    final String STORAGE_POOL_DETAIL_URI = "/vdc/storage-systems/%s/storage-pools/%s";
    log.trace(methodName + "Entry with storageSystemId[" + storageSystemId + "] storagePoolId[" + storagePoolId + "]");
    StoragePool storagePool = null;
    try {
        storagePool = _client.queryObject(String.format(STORAGE_POOL_DETAIL_URI, storageSystemId, storagePoolId), StoragePool.class);
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    }
    log.trace(methodName + "Exit returning storagePool[ " + storagePool + "]");
    return storagePool;
}
Also used : StoragePool(com.emc.storageos.vasa.data.internal.StoragePool) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Aggregations

StoragePool (com.emc.storageos.vasa.data.internal.StoragePool)4 SOSFailure (com.emc.storageos.vasa.fault.SOSFailure)4 AssociatedPool (com.emc.storageos.vasa.data.internal.Volume.AssociatedPool)2 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 HighAvailabilityVolume (com.emc.storageos.vasa.data.internal.Volume.HighAvailabilityVolume)1 HashSet (java.util.HashSet)1