Search in sources :

Example 1 with GetBlockVolume

use of com.emc.sa.service.vipr.block.tasks.GetBlockVolume in project coprhd-controller by CoprHD.

the class BlockStorageUtils method getReplicationGroupVolumes.

public static Table<URI, String, VolumeRestRep> getReplicationGroupVolumes(List<NamedRelatedResourceRep> volumeUris) {
    // Group volumes by storage system and replication group
    Table<URI, String, VolumeRestRep> storageRgToVolumes = HashBasedTable.create();
    for (NamedRelatedResourceRep volumeUri : volumeUris) {
        VolumeRestRep vplexVolume = null;
        VolumeRestRep volume = execute(new GetBlockVolume(volumeUri.getId()));
        boolean isVPlex = volume.getSystemType().equals("vplex");
        if (isVPlex) {
            vplexVolume = volume;
            volume = getSourceVolume(volume);
        }
        String rgName = BlockStorageUtils.stripRPTargetFromReplicationGroup(volume.getReplicationGroupInstance());
        URI storage = volume.getStorageController();
        if (!storageRgToVolumes.contains(storage, rgName)) {
            if (isVPlex) {
                storageRgToVolumes.put(storage, rgName, vplexVolume);
            } else {
                storageRgToVolumes.put(storage, rgName, volume);
            }
        }
    }
    return storageRgToVolumes;
}
Also used : GetBlockVolume(com.emc.sa.service.vipr.block.tasks.GetBlockVolume) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) URI(java.net.URI)

Example 2 with GetBlockVolume

use of com.emc.sa.service.vipr.block.tasks.GetBlockVolume in project coprhd-controller by CoprHD.

the class BlockStorageUtils method getReplicationGroupSnapshots.

public static Table<URI, String, BlockSnapshotRestRep> getReplicationGroupSnapshots(List<NamedRelatedResourceRep> volumeUris) {
    Table<URI, String, BlockSnapshotRestRep> storageRgToVolumes = HashBasedTable.create();
    for (NamedRelatedResourceRep volumeUri : volumeUris) {
        BlockSnapshotRestRep snapshot = execute(new GetBlockSnapshot(volumeUri.getId()));
        VolumeRestRep volume = execute(new GetBlockVolume(snapshot.getParent().getId()));
        String rgName = volume.getReplicationGroupInstance();
        URI storage = volume.getStorageController();
        if (!storageRgToVolumes.contains(storage, rgName)) {
            storageRgToVolumes.put(storage, rgName, snapshot);
        }
    }
    return storageRgToVolumes;
}
Also used : GetBlockVolume(com.emc.sa.service.vipr.block.tasks.GetBlockVolume) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) GetBlockSnapshot(com.emc.sa.service.vipr.block.tasks.GetBlockSnapshot) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) URI(java.net.URI)

Example 3 with GetBlockVolume

use of com.emc.sa.service.vipr.block.tasks.GetBlockVolume in project coprhd-controller by CoprHD.

the class BlockStorageUtils method getReplicationGroupFullCopies.

public static Table<URI, String, VolumeRestRep> getReplicationGroupFullCopies(List<NamedRelatedResourceRep> volumeUris) {
    // Group volumes by storage system and replication group
    Table<URI, String, VolumeRestRep> storageRgToVolumes = HashBasedTable.create();
    List<URI> parentVolIds = Lists.newArrayList();
    for (NamedRelatedResourceRep volumeUri : volumeUris) {
        VolumeRestRep volume = execute(new GetBlockVolume(volumeUri.getId()));
        if (volume != null && volume.getProtection() != null && volume.getProtection().getFullCopyRep() != null && volume.getProtection().getFullCopyRep().getAssociatedSourceVolume() != null) {
            parentVolIds.add(volume.getProtection().getFullCopyRep().getAssociatedSourceVolume().getId());
        }
        List<VolumeRestRep> parentVolumes = execute(new GetBlockVolumes(parentVolIds));
        if (parentVolumes != null && !parentVolumes.isEmpty()) {
            for (VolumeRestRep parentVolume : parentVolumes) {
                String rgName = stripRPTargetFromReplicationGroup(parentVolume.getReplicationGroupInstance());
                URI storage = parentVolume.getStorageController();
                if (!storageRgToVolumes.contains(storage, rgName)) {
                    storageRgToVolumes.put(storage, rgName, volume);
                }
            }
        }
    }
    return storageRgToVolumes;
}
Also used : GetBlockVolume(com.emc.sa.service.vipr.block.tasks.GetBlockVolume) GetBlockVolumes(com.emc.sa.service.vipr.block.tasks.GetBlockVolumes) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) URI(java.net.URI)

Aggregations

GetBlockVolume (com.emc.sa.service.vipr.block.tasks.GetBlockVolume)3 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)3 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)3 URI (java.net.URI)3 GetBlockSnapshot (com.emc.sa.service.vipr.block.tasks.GetBlockSnapshot)1 GetBlockVolumes (com.emc.sa.service.vipr.block.tasks.GetBlockVolumes)1 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)1