use of com.emc.storageos.model.block.BlockConsistencyGroupRestRep in project coprhd-controller by CoprHD.
the class FailoverBlockVolumeService method precheck.
@Override
public void precheck() {
String sourceId = "";
String targetId = "";
String targetName = "";
String sourceName = "";
if (ConsistencyUtils.isVolumeStorageType(storageType)) {
// The type selected is volume
BlockObjectRestRep targetVolume = BlockStorageUtils.getVolume(protectionTarget);
BlockObjectRestRep sourceVolume = BlockStorageUtils.getVolume(protectionSource);
type = BlockStorageUtils.getFailoverType(targetVolume);
targetId = stringId(targetVolume);
targetName = targetVolume.getName();
sourceId = stringId(sourceVolume);
sourceName = sourceVolume.getName();
} else {
// The type selected is consistency group
BlockConsistencyGroupRestRep cg = BlockStorageUtils.getBlockConsistencyGroup(protectionSource);
VirtualArrayRestRep virtualArray = BlockStorageUtils.getVirtualArray(protectionTarget);
type = ConsistencyUtils.getFailoverType(cg);
targetId = stringId(virtualArray);
targetName = virtualArray.getName();
sourceId = stringId(cg);
sourceName = cg.getName();
}
if (type == null) {
ExecutionUtils.fail("failTask.FailoverBlockVolumeService", args(sourceId, targetId), args());
}
if (type.equals(RECOVER_POINT) && BlockProvider.PIT_IMAGE_OPTION_KEY.equals(imageToAccess) && pointInTime == null) {
ExecutionUtils.fail("failTask.FailoverBlockVolumeService.pit", new Object[] {}, new Object[] {});
}
// TODO: Add new fields
logInfo("fail.over.block.volume.service", type.toUpperCase(), sourceName, targetName);
}
use of com.emc.storageos.model.block.BlockConsistencyGroupRestRep in project coprhd-controller by CoprHD.
the class SwapContinuousCopiesService method precheck.
@Override
public void precheck() throws Exception {
super.precheck();
String sourceId = "";
String targetId = "";
String targetName = "";
String sourceName = "";
if (ConsistencyUtils.isVolumeStorageType(storageType)) {
// The type selected is volume
BlockObjectRestRep targetVolume = BlockStorageUtils.getVolume(protectionTarget);
BlockObjectRestRep sourceVolume = BlockStorageUtils.getVolume(protectionSource);
type = BlockStorageUtils.getFailoverType(targetVolume);
targetId = stringId(targetVolume);
targetName = targetVolume.getName();
sourceId = stringId(sourceVolume);
sourceName = sourceVolume.getName();
} else {
// The type selected is consistency group
BlockConsistencyGroupRestRep cg = BlockStorageUtils.getBlockConsistencyGroup(protectionSource);
VirtualArrayRestRep virtualArray = BlockStorageUtils.getVirtualArray(protectionTarget);
type = ConsistencyUtils.getFailoverType(cg);
targetId = stringId(virtualArray);
targetName = virtualArray.getName();
sourceId = stringId(cg);
sourceName = cg.getName();
}
if (type == null) {
ExecutionUtils.fail("failTask.SwapContinuousCopiesService", args(sourceId, targetId), args());
}
logInfo("swap.continuous.copies.service.precheck", type.toUpperCase(), sourceName, targetName);
}
use of com.emc.storageos.model.block.BlockConsistencyGroupRestRep in project coprhd-controller by CoprHD.
the class GetBlockConsistencyGroup method executeTask.
@Override
public BlockConsistencyGroupRestRep executeTask() throws Exception {
ViPRCoreClient client = getClient();
BlockConsistencyGroupRestRep cg = client.blockConsistencyGroups().get(resourceId);
if (cg != null) {
return cg;
}
throw stateException("GetBlockConsistencyGroup.illegalState.notFound", resourceId);
}
Aggregations