Search in sources :

Example 1 with LunCreateParam

use of com.emc.storageos.vnxe.models.LunCreateParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method createLunsInLunGroup.

/**
 * Create multiple volumes in a lun group
 *
 * @param names
 * @param poolId
 * @param size
 * @param isThin
 * @param tieringPolicy
 * @param lunGroupId
 * @return
 */
public VNXeCommandJob createLunsInLunGroup(List<String> names, String poolId, Long size, boolean isThin, String tieringPolicy, String lunGroupId) {
    _logger.info("creating luns in the lun group: {}", lunGroupId);
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunCreateParam> lunCreates = new ArrayList<LunCreateParam>();
    boolean isPolicyOn = false;
    FastVPParam fastVP = new FastVPParam();
    if (tieringPolicy != null && !tieringPolicy.isEmpty()) {
        TieringPolicyEnum tierValue = TieringPolicyEnum.valueOf(tieringPolicy);
        if (tierValue != null) {
            fastVP.setTieringPolicy(tierValue.getValue());
            isPolicyOn = true;
        }
    }
    for (String lunName : names) {
        LunParam lunParam = new LunParam();
        lunParam.setIsThinEnabled(isThin);
        lunParam.setSize(size);
        lunParam.setPool(new VNXeBase(poolId));
        LunCreateParam createParam = new LunCreateParam();
        createParam.setName(lunName);
        createParam.setLunParameters(lunParam);
        if (isPolicyOn) {
            lunParam.setFastVPParameters(fastVP);
        }
        lunCreates.add(createParam);
    }
    param.setLunCreate(lunCreates);
    LunGroupRequests req = new LunGroupRequests(_khClient);
    return req.modifyLunGroupAsync(lunGroupId, param);
}
Also used : TieringPolicyEnum(com.emc.storageos.vnxe.models.StorageResource.TieringPolicyEnum) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) FastVPParam(com.emc.storageos.vnxe.models.FastVPParam) LunParam(com.emc.storageos.vnxe.models.LunParam) LunGroupRequests(com.emc.storageos.vnxe.requests.LunGroupRequests) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList) LunCreateParam(com.emc.storageos.vnxe.models.LunCreateParam)

Example 2 with LunCreateParam

use of com.emc.storageos.vnxe.models.LunCreateParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method createLunsInConsistencyGroup.

/**
 * Create multiple volumes in a lun group
 *
 * @param names
 * @param poolId
 * @param size
 * @param isThin
 * @param tieringPolicy
 * @param cgId
 * @return
 */
public VNXeCommandJob createLunsInConsistencyGroup(List<String> names, String poolId, Long size, boolean isThin, String tieringPolicy, String cgId) {
    _logger.info("creating luns in the consistencyGroup group: {}", cgId);
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunCreateParam> lunCreates = new ArrayList<LunCreateParam>();
    boolean isPolicyOn = false;
    FastVPParam fastVP = new FastVPParam();
    if (tieringPolicy != null && !tieringPolicy.isEmpty()) {
        TieringPolicyEnum tierValue = TieringPolicyEnum.valueOf(tieringPolicy);
        if (tierValue != null) {
            fastVP.setTieringPolicy(tierValue.getValue());
            isPolicyOn = true;
        }
    }
    StorageResourceRequest cgRequest = new StorageResourceRequest(_khClient);
    StorageResource cg = cgRequest.get(cgId);
    for (String lunName : names) {
        LunParam lunParam = new LunParam();
        lunParam.setIsThinEnabled(isThin);
        lunParam.setSize(size);
        lunParam.setPool(new VNXeBase(poolId));
        List<BlockHostAccess> hostAccesses = cg.getBlockHostAccess();
        if (hostAccesses != null && !hostAccesses.isEmpty()) {
            for (BlockHostAccess hostAccess : hostAccesses) {
                hostAccess.setAccessMask(HostLUNAccessEnum.NOACCESS.getValue());
            }
            lunParam.setHostAccess(hostAccesses);
        }
        LunCreateParam createParam = new LunCreateParam();
        createParam.setName(lunName);
        createParam.setLunParameters(lunParam);
        if (isPolicyOn) {
            lunParam.setFastVPParameters(fastVP);
        }
        lunCreates.add(createParam);
    }
    param.setLunCreate(lunCreates);
    ConsistencyGroupRequests req = new ConsistencyGroupRequests(_khClient);
    return req.modifyConsistencyGroupAsync(cgId, param);
}
Also used : StorageResource(com.emc.storageos.vnxe.models.StorageResource) FastVPParam(com.emc.storageos.vnxe.models.FastVPParam) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList) ConsistencyGroupRequests(com.emc.storageos.vnxe.requests.ConsistencyGroupRequests) BlockHostAccess(com.emc.storageos.vnxe.models.BlockHostAccess) TieringPolicyEnum(com.emc.storageos.vnxe.models.StorageResource.TieringPolicyEnum) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunParam(com.emc.storageos.vnxe.models.LunParam) StorageResourceRequest(com.emc.storageos.vnxe.requests.StorageResourceRequest) DeleteStorageResourceRequest(com.emc.storageos.vnxe.requests.DeleteStorageResourceRequest) LunCreateParam(com.emc.storageos.vnxe.models.LunCreateParam)

Example 3 with LunCreateParam

use of com.emc.storageos.vnxe.models.LunCreateParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method createLun.

/**
 * Create standalone lun
 *
 * @param name
 * @param poolId
 * @param size
 * @param isThin
 * @param tieringPolicy
 * @param lunGroupId
 * @return
 */
public VNXeCommandJob createLun(String name, String poolId, Long size, boolean isThin, String tieringPolicy) {
    LunParam lunParam = new LunParam();
    lunParam.setIsThinEnabled(isThin);
    lunParam.setSize(size);
    lunParam.setPool(new VNXeBase(poolId));
    FastVPParam fastVP = new FastVPParam();
    if (tieringPolicy != null && !tieringPolicy.isEmpty()) {
        TieringPolicyEnum tierValue = TieringPolicyEnum.valueOf(tieringPolicy);
        if (tierValue != null) {
            fastVP.setTieringPolicy(tierValue.getValue());
            lunParam.setFastVPParameters(fastVP);
        }
    }
    LunCreateParam createParam = new LunCreateParam();
    createParam.setName(name);
    createParam.setLunParameters(lunParam);
    BlockLunRequests req = new BlockLunRequests(_khClient);
    return req.createLun(createParam);
}
Also used : TieringPolicyEnum(com.emc.storageos.vnxe.models.StorageResource.TieringPolicyEnum) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunParam(com.emc.storageos.vnxe.models.LunParam) FastVPParam(com.emc.storageos.vnxe.models.FastVPParam) BlockLunRequests(com.emc.storageos.vnxe.requests.BlockLunRequests) LunCreateParam(com.emc.storageos.vnxe.models.LunCreateParam)

Aggregations

FastVPParam (com.emc.storageos.vnxe.models.FastVPParam)3 LunCreateParam (com.emc.storageos.vnxe.models.LunCreateParam)3 LunParam (com.emc.storageos.vnxe.models.LunParam)3 TieringPolicyEnum (com.emc.storageos.vnxe.models.StorageResource.TieringPolicyEnum)3 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)3 LunGroupModifyParam (com.emc.storageos.vnxe.models.LunGroupModifyParam)2 ArrayList (java.util.ArrayList)2 BlockHostAccess (com.emc.storageos.vnxe.models.BlockHostAccess)1 StorageResource (com.emc.storageos.vnxe.models.StorageResource)1 BlockLunRequests (com.emc.storageos.vnxe.requests.BlockLunRequests)1 ConsistencyGroupRequests (com.emc.storageos.vnxe.requests.ConsistencyGroupRequests)1 DeleteStorageResourceRequest (com.emc.storageos.vnxe.requests.DeleteStorageResourceRequest)1 LunGroupRequests (com.emc.storageos.vnxe.requests.LunGroupRequests)1 StorageResourceRequest (com.emc.storageos.vnxe.requests.StorageResourceRequest)1