use of com.emc.storageos.model.vpool.ProtectionSourcePolicy 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 BlockVirtualPoolProtectionParam
*/
private void validateProtection(BlockVirtualPoolProtectionParam protectionParam) {
if (protectionParam != null) {
VirtualPoolProtectionRPParam rpParam = protectionParam.getRecoverPoint();
if (rpParam != null) {
if (!CollectionUtils.isEmpty(rpParam.getCopies())) {
throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
}
ProtectionSourcePolicy rpPolicy = rpParam.getSourcePolicy();
if (rpPolicy != null && (rpPolicy.getJournalSize() != null || rpPolicy.getJournalVarray() != null || rpPolicy.getJournalVpool() != null || rpPolicy.getRemoteCopyMode() != null || rpPolicy.getRpoType() != null || rpPolicy.getRpoValue() != null || rpPolicy.getStandbyJournalVarray() != null || rpPolicy.getStandbyJournalVpool() != null)) {
throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
}
}
VirtualPoolRemoteMirrorProtectionParam remoteProtection = protectionParam.getRemoteCopies();
if (remoteProtection != null) {
if (!CollectionUtils.isEmpty(remoteProtection.getRemoteCopySettings())) {
throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
}
}
}
}
use of com.emc.storageos.model.vpool.ProtectionSourcePolicy in project coprhd-controller by CoprHD.
the class BlockVirtualPoolBuilder method setJournalVarrayAndVpool.
public BlockVirtualPoolBuilder setJournalVarrayAndVpool(URI journalVarray, URI journalVpool) {
if (getProtectionSourcePolicy() == null) {
getRecoverPoint().setSourcePolicy(new ProtectionSourcePolicy());
}
getProtectionSourcePolicy().setJournalVarray(journalVarray);
getProtectionSourcePolicy().setJournalVpool(journalVpool);
return this;
}
use of com.emc.storageos.model.vpool.ProtectionSourcePolicy in project coprhd-controller by CoprHD.
the class BlockVirtualPoolBuilder method setStandByJournalVArrayVpool.
public BlockVirtualPoolBuilder setStandByJournalVArrayVpool(URI standbyJournalVarray, URI standbyJournalVpool) {
if (getProtectionSourcePolicy() == null) {
getRecoverPoint().setSourcePolicy(new ProtectionSourcePolicy());
}
getProtectionSourcePolicy().setStandbyJournalVarray(standbyJournalVarray);
getProtectionSourcePolicy().setStandbyJournalVpool(standbyJournalVpool);
return this;
}
use of com.emc.storageos.model.vpool.ProtectionSourcePolicy in project coprhd-controller by CoprHD.
the class BlockVirtualPoolUpdateBuilder method setRecoverPointRpo.
public BlockVirtualPoolUpdateBuilder setRecoverPointRpo(Long value, String type) {
if (value != null) {
if (getProtectionSourcePolicy() == null) {
getRecoverPoint().setSourcePolicy(new ProtectionSourcePolicy());
}
getProtectionSourcePolicy().setRpoValue(value);
getProtectionSourcePolicy().setRpoType(type);
}
return this;
}
use of com.emc.storageos.model.vpool.ProtectionSourcePolicy in project coprhd-controller by CoprHD.
the class BlockVirtualPoolForm method doLoad.
protected void doLoad(BlockVirtualPoolRestRep virtualPool) {
loadCommon(virtualPool);
minPaths = virtualPool.getMinPaths();
maxPaths = virtualPool.getMaxPaths();
initiatorPaths = virtualPool.getPathsPerInitiator();
driveType = virtualPool.getDriveType();
autoTierPolicy = virtualPool.getAutoTieringPolicyName();
enableCompression = virtualPool.getCompressionEnabled();
expandable = virtualPool.getExpandable();
fastExpansion = virtualPool.getFastExpansion();
multiVolumeConsistency = virtualPool.getMultiVolumeConsistent();
thinPreAllocationPercent = virtualPool.getThinVolumePreAllocationPercentage();
uniqueAutoTierPolicyNames = virtualPool.getUniquePolicyNames();
raidLevels = defaultSet(virtualPool.getRaidLevels());
hostIOLimitBandwidth = virtualPool.getHostIOLimitBandwidth();
hostIOLimitIOPs = virtualPool.getHostIOLimitIOPs();
enableDeDup = virtualPool.getDedupCapable();
placementPolicy = virtualPool.getPlacementPolicy();
VirtualPoolHighAvailabilityParam highAvailabilityType = virtualPool.getHighAvailability();
if (highAvailabilityType != null && HighAvailability.isHighAvailability(highAvailabilityType.getType())) {
highAvailability = highAvailabilityType.getType();
if (highAvailability.equals(HighAvailability.VPLEX_LOCAL)) {
protectSourceSite = true;
}
enableAutoCrossConnExport = highAvailabilityType.getAutoCrossConnectExport();
if (highAvailabilityType.getHaVirtualArrayVirtualPool() != null) {
haVirtualArray = asString(highAvailabilityType.getHaVirtualArrayVirtualPool().getVirtualArray());
haVirtualPool = asString(highAvailabilityType.getHaVirtualArrayVirtualPool().getVirtualPool());
Boolean activeProtectionAtHASite = Boolean.TRUE.equals(highAvailabilityType.getHaVirtualArrayVirtualPool().getActiveProtectionAtHASite());
Boolean metroPoint = Boolean.TRUE.equals(highAvailabilityType.getMetroPoint());
if (metroPoint) {
protectSourceSite = true;
protectHASite = true;
if (activeProtectionAtHASite) {
activeSite = HighAvailability.VPLEX_HA.toString();
} else {
activeSite = HighAvailability.VPLEX_SOURCE.toString();
protectSourceSite = true;
}
} else {
protectHASite = activeProtectionAtHASite;
protectSourceSite = !protectHASite;
}
} else {
protectSourceSite = true;
}
} else {
protectSourceSite = true;
}
BlockVirtualPoolProtectionParam protection = virtualPool.getProtection();
if (protection != null) {
if (protection.getSnapshots() != null) {
maxSnapshots = protection.getSnapshots().getMaxSnapshots();
}
if (protection.getContinuousCopies() != null) {
maxContinuousCopies = protection.getContinuousCopies().getMaxMirrors();
continuousCopyVirtualPool = asString(protection.getContinuousCopies().getVpool());
}
VirtualPoolProtectionRPParam recoverPoint = protection.getRecoverPoint();
if (recoverPoint != null) {
remoteProtection = ProtectionSystemTypes.RECOVERPOINT;
ProtectionSourcePolicy sourcePolicy = recoverPoint.getSourcePolicy();
if (sourcePolicy != null) {
String journalSize = sourcePolicy.getJournalSize();
rpJournalSizeUnit = RPCopyForm.parseJournalSizeUnit(journalSize);
rpJournalSize = StringUtils.defaultIfBlank(RPCopyForm.parseJournalSize(journalSize, rpJournalSizeUnit), RPCopyForm.JOURNAL_SIZE_MIN);
rpRemoteCopyMode = sourcePolicy.getRemoteCopyMode();
rpRpoValue = sourcePolicy.getRpoValue();
rpRpoType = sourcePolicy.getRpoType();
if (protectHASite != null && protectSourceSite != null && protectHASite && protectSourceSite) {
// Backend will take care of swapping
// if(activeSite.equalsIgnoreCase(HighAvailability.VPLEX_SOURCE)){
sourceJournalVArray = asString(sourcePolicy.getJournalVarray());
sourceJournalVPool = asString(sourcePolicy.getJournalVpool());
haJournalVArray = asString(sourcePolicy.getStandbyJournalVarray());
haJournalVPool = asString(sourcePolicy.getStandbyJournalVpool());
} else {
if (protectHASite != null && protectHASite) {
haJournalVArray = asString(sourcePolicy.getJournalVarray());
haJournalVPool = asString(sourcePolicy.getJournalVpool());
} else if (protectSourceSite != null && protectSourceSite) {
sourceJournalVArray = asString(sourcePolicy.getJournalVarray());
sourceJournalVPool = asString(sourcePolicy.getJournalVpool());
}
}
}
List<RPCopyForm> rpCopyForms = Lists.newArrayList();
for (VirtualPoolProtectionVirtualArraySettingsParam copy : recoverPoint.getCopies()) {
RPCopyForm rpCopy = new RPCopyForm();
rpCopy.load(copy);
rpCopyForms.add(rpCopy);
}
rpCopies = rpCopyForms.toArray(new RPCopyForm[0]);
rpCopiesJson = new Gson().toJson(rpCopies);
}
VirtualPoolRemoteMirrorProtectionParam srdf = protection.getRemoteCopies();
if (srdf != null) {
remoteProtection = ProtectionSystemTypes.SRDF;
List<SrdfCopyForm> copyForms = Lists.newArrayList();
for (VirtualPoolRemoteProtectionVirtualArraySettingsParam copy : srdf.getRemoteCopySettings()) {
srdfCopyMode = copy.getRemoteCopyMode();
SrdfCopyForm srdfCopyForm = new SrdfCopyForm();
srdfCopyForm.load(copy);
copyForms.add(srdfCopyForm);
}
srdfCopies = copyForms.toArray(new SrdfCopyForm[0]);
Gson gson = new Gson();
srdfCopiesJson = gson.toJson(srdfCopies);
} else {
srdfCopiesJson = "[]";
}
}
}
Aggregations