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();
}
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;
}
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();
}
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;
}
Aggregations