Search in sources :

Example 26 with BlockConsistencyGroupRestRep

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);
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep)

Example 27 with BlockConsistencyGroupRestRep

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);
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep)

Example 28 with BlockConsistencyGroupRestRep

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);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep)

Aggregations

BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)28 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)15 Asset (com.emc.sa.asset.annotation.Asset)12 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)10 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)10 URI (java.net.URI)9 ArrayList (java.util.ArrayList)8 AssetOption (com.emc.vipr.model.catalog.AssetOption)6 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)3 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)2 BlockObjectRestRep (com.emc.storageos.model.block.BlockObjectRestRep)2 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)2 ProtectionRestRep (com.emc.storageos.model.block.VolumeRestRep.ProtectionRestRep)2 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)2 SRDFSourceFilter (com.emc.vipr.client.core.filters.SRDFSourceFilter)2 FlashException (controllers.util.FlashException)2 HashSet (java.util.HashSet)2 CreateConsistencyGroupFullCopy (com.emc.sa.service.vipr.block.consistency.tasks.CreateConsistencyGroupFullCopy)1 DetachConsistencyGroupFullCopy (com.emc.sa.service.vipr.block.consistency.tasks.DetachConsistencyGroupFullCopy)1