use of com.emc.storageos.xtremio.restapi.model.response.XtremIOSystem in project coprhd-controller by CoprHD.
the class XtremIOProvUtils method updateStoragePoolCapacity.
public static void updateStoragePoolCapacity(XtremIOClient client, DbClient dbClient, StoragePool storagePool) {
try {
StorageSystem storageSystem = dbClient.queryObject(StorageSystem.class, storagePool.getStorageDevice());
_log.info(String.format("Old storage pool capacity data for %n pool %s/%s --- %n free capacity: %s; subscribed capacity: %s", storageSystem.getId(), storagePool.getId(), storagePool.calculateFreeCapacityWithoutReservations(), storagePool.getSubscribedCapacity()));
List<XtremIOSystem> systems = client.getXtremIOSystemInfo();
for (XtremIOSystem system : systems) {
if (system.getSerialNumber().equalsIgnoreCase(storageSystem.getSerialNumber())) {
storagePool.setFreeCapacity(system.getTotalCapacity() - system.getUsedCapacity());
storagePool.setSubscribedCapacity(system.getSubscribedCapacity());
dbClient.updateObject(storagePool);
break;
}
}
_log.info(String.format("New storage pool capacity data for %n pool %s/%s --- %n free capacity: %s; subscribed capacity: %s", storageSystem.getId(), storagePool.getId(), storagePool.calculateFreeCapacityWithoutReservations(), storagePool.getSubscribedCapacity()));
} catch (Exception e) {
_log.warn("Problem when updating pool capacity for pool {}", storagePool.getNativeGuid());
}
}
Aggregations