Search in sources :

Example 1 with VirtualPoolRemoteProtectionUpdateParam

use of com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam in project coprhd-controller by CoprHD.

the class PlacementPolicyValidator method validateProtection.

/**
 * Validates protection
 * Array affinity policy cannot be used for VPool with RP or remote copies
 *
 * @param protectionParam BlockVirtualPoolProtectionUpdateParam
 * @param vPool Virtual Pool (null for creating new virtual pool, or validating current value is not necessary)
 */
private void validateProtection(BlockVirtualPoolProtectionUpdateParam protectionParam, VirtualPool vPool) {
    if (protectionParam != null) {
        VirtualPoolProtectionRPChanges rpChanges = protectionParam.getRecoverPoint();
        if (rpChanges != null) {
            if ((rpChanges.getAdd() != null && !rpChanges.getAdd().isEmpty()) || (rpChanges.getRemove() != null && !rpChanges.getRemove().isEmpty()) || rpChanges.getSourcePolicy() != null) {
                throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
            }
        }
        VirtualPoolRemoteProtectionUpdateParam remoteCopies = protectionParam.getRemoteCopies();
        if (remoteCopies != null) {
            if ((remoteCopies.getAdd() != null && !remoteCopies.getAdd().isEmpty()) || (remoteCopies.getRemove() != null && !remoteCopies.getRemove().isEmpty())) {
                throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
            }
        }
    } else if (vPool != null) {
        if (VirtualPool.vPoolSpecifiesProtection(vPool) || VirtualPool.vPoolSpecifiesSRDF(vPool)) {
            throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
        }
    }
}
Also used : VirtualPoolProtectionRPChanges(com.emc.storageos.model.vpool.VirtualPoolProtectionRPChanges) VirtualPoolRemoteProtectionUpdateParam(com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam)

Example 2 with VirtualPoolRemoteProtectionUpdateParam

use of com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam in project coprhd-controller by CoprHD.

the class BlockVirtualPoolUpdateBuilder method disableRemoteCopies.

public BlockVirtualPoolUpdateBuilder disableRemoteCopies() {
    getProtection().setRemoteCopies(new VirtualPoolRemoteProtectionUpdateParam());
    Set<VirtualPoolRemoteProtectionVirtualArraySettingsParam> noCopies = Sets.newHashSet();
    setRemoteCopies(noCopies);
    return this;
}
Also used : VirtualPoolRemoteProtectionVirtualArraySettingsParam(com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionVirtualArraySettingsParam) VirtualPoolRemoteProtectionUpdateParam(com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam)

Aggregations

VirtualPoolRemoteProtectionUpdateParam (com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam)2 VirtualPoolProtectionRPChanges (com.emc.storageos.model.vpool.VirtualPoolProtectionRPChanges)1 VirtualPoolRemoteProtectionVirtualArraySettingsParam (com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionVirtualArraySettingsParam)1