use of com.emc.storageos.volumecontroller.impl.smis.MetaVolumeRecommendation in project coprhd-controller by CoprHD.
the class RPHelper method computeVmaxVolumeProvisionedCapacity.
/**
* Helper method that determines what the potential provisioned capacity is of a VMAX volume.
* The size returned may or may not be what the eventual provisioned capacity will turn out to be, but its pretty accurate estimate.
*
* @param requestedSize Size of the volume requested
* @param volume volume
* @param storageSystem storagesystem of the volume
* @param dbClient DbClient ref
* @return potential provisioned capacity
*/
public static Long computeVmaxVolumeProvisionedCapacity(long requestedSize, Volume volume, StorageSystem storageSystem, DbClient dbClient) {
Long vmaxPotentialProvisionedCapacity = 0L;
StoragePool expandVolumePool = dbClient.queryObject(StoragePool.class, volume.getPool());
long metaMemberSize = volume.getIsComposite() ? volume.getMetaMemberSize() : volume.getCapacity();
long metaCapacity = volume.getIsComposite() ? volume.getTotalMetaMemberCapacity() : volume.getCapacity();
MetaVolumeRecommendation metaRecommendation = MetaVolumeUtils.getExpandRecommendation(storageSystem, expandVolumePool, metaCapacity, requestedSize, metaMemberSize, volume.getThinlyProvisioned(), dbClient.queryObject(VirtualPool.class, volume.getVirtualPool()).getFastExpansion());
if (metaRecommendation.isCreateMetaVolumes()) {
long metaMemberCount = volume.getIsComposite() ? metaRecommendation.getMetaMemberCount() + volume.getMetaMemberCount() : metaRecommendation.getMetaMemberCount() + 1;
vmaxPotentialProvisionedCapacity = metaMemberCount * metaRecommendation.getMetaMemberSize();
} else {
vmaxPotentialProvisionedCapacity = requestedSize;
}
return vmaxPotentialProvisionedCapacity;
}
Aggregations