Search in sources :

Example 6 with ConsistencyGroupLinkPolicy

use of com.emc.fapiclient.ws.ConsistencyGroupLinkPolicy in project coprhd-controller by CoprHD.

the class RecoverPointClient method setLinkPolicy.

/**
 * Convenience method to set the link policy.
 *
 * @param remote whether to set the "protect over wan" to true
 * @param prodCopyUID production copy id
 * @param targetCopyUID target copy id
 * @param cgUID cg id
 * @throws FunctionalAPIActionFailedException_Exception
 * @throws FunctionalAPIInternalError_Exception
 */
private void setLinkPolicy(boolean remote, ConsistencyGroupCopyUID prodCopyUID, ConsistencyGroupCopyUID targetCopyUID, ConsistencyGroupUID cgUID) throws FunctionalAPIActionFailedException_Exception, FunctionalAPIInternalError_Exception {
    ConsistencyGroupLinkUID groupLink = new ConsistencyGroupLinkUID();
    ConsistencyGroupLinkPolicy linkPolicy = new ConsistencyGroupLinkPolicy();
    linkPolicy.setAdvancedPolicy(new LinkAdvancedPolicy());
    linkPolicy.getAdvancedPolicy().setPerformLongInitialization(true);
    linkPolicy.getAdvancedPolicy().setSnapshotGranularity(SnapshotGranularity.FIXED_PER_SECOND);
    linkPolicy.setProtectionPolicy(new LinkProtectionPolicy());
    linkPolicy.getProtectionPolicy().setBandwidthLimit(0.0);
    linkPolicy.getProtectionPolicy().setCompression(WanCompression.NONE);
    linkPolicy.getProtectionPolicy().setDeduplication(false);
    linkPolicy.getProtectionPolicy().setMeasureLagToTargetRPA(true);
    linkPolicy.getProtectionPolicy().setProtectionType(ProtectionMode.ASYNCHRONOUS);
    linkPolicy.getProtectionPolicy().setReplicatingOverWAN(remote);
    linkPolicy.getProtectionPolicy().setRpoPolicy(new RpoPolicy());
    linkPolicy.getProtectionPolicy().getRpoPolicy().setAllowRegulation(false);
    linkPolicy.getProtectionPolicy().getRpoPolicy().setMaximumAllowedLag(getQuantity(QuantityType.MICROSECONDS, 25000000));
    linkPolicy.getProtectionPolicy().getRpoPolicy().setMinimizationType(RpoMinimizationType.IRRELEVANT);
    linkPolicy.getProtectionPolicy().setSyncReplicationLatencyThresholds(new SyncReplicationThreshold());
    linkPolicy.getProtectionPolicy().getSyncReplicationLatencyThresholds().setResumeSyncReplicationBelow(getQuantity(QuantityType.MICROSECONDS, 3000));
    linkPolicy.getProtectionPolicy().getSyncReplicationLatencyThresholds().setStartAsyncReplicationAbove(getQuantity(QuantityType.MICROSECONDS, 5000));
    linkPolicy.getProtectionPolicy().getSyncReplicationLatencyThresholds().setThresholdEnabled(false);
    linkPolicy.getProtectionPolicy().setSyncReplicationThroughputThresholds(new SyncReplicationThreshold());
    linkPolicy.getProtectionPolicy().getSyncReplicationThroughputThresholds().setResumeSyncReplicationBelow(getQuantity(QuantityType.KB, 35000));
    linkPolicy.getProtectionPolicy().getSyncReplicationThroughputThresholds().setStartAsyncReplicationAbove(getQuantity(QuantityType.KB, 45000));
    linkPolicy.getProtectionPolicy().getSyncReplicationThroughputThresholds().setThresholdEnabled(false);
    linkPolicy.getProtectionPolicy().setWeight(1);
    groupLink.setFirstCopy(prodCopyUID.getGlobalCopyUID());
    groupLink.setSecondCopy(targetCopyUID.getGlobalCopyUID());
    groupLink.setGroupUID(cgUID);
    functionalAPI.addConsistencyGroupLink(groupLink, linkPolicy);
    waitForRpOperation();
}
Also used : SyncReplicationThreshold(com.emc.fapiclient.ws.SyncReplicationThreshold) LinkProtectionPolicy(com.emc.fapiclient.ws.LinkProtectionPolicy) RpoPolicy(com.emc.fapiclient.ws.RpoPolicy) LinkAdvancedPolicy(com.emc.fapiclient.ws.LinkAdvancedPolicy) ConsistencyGroupLinkUID(com.emc.fapiclient.ws.ConsistencyGroupLinkUID) FullConsistencyGroupLinkPolicy(com.emc.fapiclient.ws.FullConsistencyGroupLinkPolicy) ConsistencyGroupLinkPolicy(com.emc.fapiclient.ws.ConsistencyGroupLinkPolicy)

Aggregations

ConsistencyGroupLinkPolicy (com.emc.fapiclient.ws.ConsistencyGroupLinkPolicy)6 FullConsistencyGroupLinkPolicy (com.emc.fapiclient.ws.FullConsistencyGroupLinkPolicy)6 ConsistencyGroupLinkUID (com.emc.fapiclient.ws.ConsistencyGroupLinkUID)4 LinkProtectionPolicy (com.emc.fapiclient.ws.LinkProtectionPolicy)3 ConsistencyGroupCopySettings (com.emc.fapiclient.ws.ConsistencyGroupCopySettings)2 ConsistencyGroupCopyUID (com.emc.fapiclient.ws.ConsistencyGroupCopyUID)2 ConsistencyGroupLinkSettings (com.emc.fapiclient.ws.ConsistencyGroupLinkSettings)2 ConsistencyGroupSettings (com.emc.fapiclient.ws.ConsistencyGroupSettings)2 FunctionalAPIActionFailedException_Exception (com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception)2 FunctionalAPIInternalError_Exception (com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception)2 GlobalCopyUID (com.emc.fapiclient.ws.GlobalCopyUID)2 LinkAdvancedPolicy (com.emc.fapiclient.ws.LinkAdvancedPolicy)2 ProtectionMode (com.emc.fapiclient.ws.ProtectionMode)2 RpoPolicy (com.emc.fapiclient.ws.RpoPolicy)2 SyncReplicationThreshold (com.emc.fapiclient.ws.SyncReplicationThreshold)2 ClusterUID (com.emc.fapiclient.ws.ClusterUID)1 ConsistencyGroupUID (com.emc.fapiclient.ws.ConsistencyGroupUID)1 FullConsistencyGroupCopyPolicy (com.emc.fapiclient.ws.FullConsistencyGroupCopyPolicy)1 FullConsistencyGroupPolicy (com.emc.fapiclient.ws.FullConsistencyGroupPolicy)1 FunctionalAPIValidationException_Exception (com.emc.fapiclient.ws.FunctionalAPIValidationException_Exception)1