Search in sources :

Example 1 with StorageScheduler

use of com.emc.storageos.api.service.impl.placement.StorageScheduler in project coprhd-controller by CoprHD.

the class DefaultBlockFullCopyApiImpl method getPlacementRecommendations.

/**
 * Get the placement recommendations for the passed full copy source.
 *
 * @param blockObject A reference to the full copy source.
 * @param capabilities Encapsulates the copy capabilities
 * @param varray A reference to the virtual array.
 * @param vpoolURI The URI of the virtual pool for the source.
 *
 * @return A list of volume placement recommendations.
 */
private List<VolumeRecommendation> getPlacementRecommendations(BlockObject blockObject, VirtualPoolCapabilityValuesWrapper capabilities, VirtualArray varray, URI vpoolURI) {
    // Find placement for block volume copies
    VirtualPool vPool = _dbClient.queryObject(VirtualPool.class, vpoolURI);
    List<VolumeRecommendation> placementRecommendations = ((StorageScheduler) _scheduler).getRecommendationsForVolumeClones(varray, vPool, blockObject, capabilities);
    if (placementRecommendations.isEmpty()) {
        throw APIException.badRequests.invalidParameterNoStorageFoundForVolume(varray.getId(), vPool.getId(), blockObject.getId());
    }
    return placementRecommendations;
}
Also used : StorageScheduler(com.emc.storageos.api.service.impl.placement.StorageScheduler) VirtualPool(com.emc.storageos.db.client.model.VirtualPool) VolumeRecommendation(com.emc.storageos.api.service.impl.placement.VolumeRecommendation)

Aggregations

StorageScheduler (com.emc.storageos.api.service.impl.placement.StorageScheduler)1 VolumeRecommendation (com.emc.storageos.api.service.impl.placement.VolumeRecommendation)1 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)1