Search in sources :

Example 11 with MetaVolumeRecommendation

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;
}
Also used : StoragePool(com.emc.storageos.db.client.model.StoragePool) MetaVolumeRecommendation(com.emc.storageos.volumecontroller.impl.smis.MetaVolumeRecommendation)

Aggregations

MetaVolumeRecommendation (com.emc.storageos.volumecontroller.impl.smis.MetaVolumeRecommendation)11 StoragePool (com.emc.storageos.db.client.model.StoragePool)7 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)7 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)4 Volume (com.emc.storageos.db.client.model.Volume)4 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)3 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)3 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)3 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)3 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)3 ControllerException (com.emc.storageos.volumecontroller.ControllerException)3 WorkflowException (com.emc.storageos.workflow.WorkflowException)3 DataBindingException (javax.xml.bind.DataBindingException)3 VolumeCreateCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.VolumeCreateCompleter)2 ArrayList (java.util.ArrayList)2 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 NamedURI (com.emc.storageos.db.client.model.NamedURI)1 FCTN_MIRROR_TO_URI (com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_MIRROR_TO_URI)1 ApplicationAddVolumeList (com.emc.storageos.volumecontroller.ApplicationAddVolumeList)1 MultiVolumeTaskCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.MultiVolumeTaskCompleter)1