Search in sources :

Example 6 with VolumeRestRep

use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.

the class VPlexIngestionTest method prepare1.

@Ignore
@Test
public // test1a creates unmanaged  vplex local volume create. Ingestion handled in test1b.
void prepare1() {
    // Create the volume to be ingested
    start();
    String timeInt = getTimeInt();
    String volumeName = "vpingest" + timeInt;
    printLog("Creating virtual volume: " + volumeName);
    URI vpool = util.getURIFromLabel(VirtualPool.class, properties.getProperty(LOCAL_VPOOL));
    URI varray = util.getURIFromLabel(VirtualArray.class, properties.getProperty(LOCAL_VARRAY));
    URI project = util.getURIFromLabel(Project.class, properties.getProperty(PROJECT));
    String cgName = properties.getProperty(CONSISTENCY_GROUP) + timeInt;
    URI cg = null;
    if (cgName != null) {
        cg = util.createConsistencyGroup(cgName, project);
    }
    List<URI> volumeURIs = util.createVolume(volumeName, "1GB", 1, vpool, varray, project, cg);
    // Look up the volume
    VolumeRestRep volume = client.blockVolumes().get(volumeURIs.get(0));
    String nativeId = volume.getNativeId();
    args.put("test1NativeId", nativeId);
    printLog("Virtual volume: " + nativeId);
    stop("Test 1 virtual volume creation: " + volumeName);
    // Inventory only delete it.
    util.deleteVolumes(volumeURIs, true);
}
Also used : VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) UnManagedVolumeRestRep(com.emc.storageos.model.block.UnManagedVolumeRestRep) URI(java.net.URI) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 7 with VolumeRestRep

use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.

the class AbstractBlockFullCopyApiImpl method checkProgress.

/**
 * {@inheritDoc}
 */
@Override
public VolumeRestRep checkProgress(URI sourceURI, Volume fullCopyVolume) {
    Integer result = getSyncPercentage(sourceURI, fullCopyVolume);
    VolumeRestRep volumeRestRep = BlockMapper.map(_dbClient, fullCopyVolume);
    volumeRestRep.getProtection().getFullCopyRep().setPercentSynced(result);
    return volumeRestRep;
}
Also used : VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep)

Example 8 with VolumeRestRep

use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.

the class BlockFullCopyManager method checkFullCopyProgress.

/**
 * Checks the progress of the data copy from the source with the
 * passed URI to the full copy with the passed URI.
 *
 * TBD Maybe vice versa for restore?
 *
 * @param sourceURI The URI of the source.
 * @param fullCopyURI The URI of the full copy volume.
 *
 * @return VolumeRestRep
 *
 * @throws InternalException
 */
public VolumeRestRep checkFullCopyProgress(URI sourceURI, URI fullCopyURI) throws InternalException {
    s_logger.info("START full copy progress check for {}", fullCopyURI);
    // Verify passed URIs for the full copy request.
    Map<URI, BlockObject> resourceMap = BlockFullCopyUtils.verifySourceAndFullCopy(sourceURI, fullCopyURI, _uriInfo, _dbClient);
    // Get the full copy volume.
    Volume fullCopyVolume = (Volume) resourceMap.get(fullCopyURI);
    // Check if the full copy is detached.
    if (BlockFullCopyUtils.isFullCopyDetached(fullCopyVolume, _dbClient)) {
        throw APIException.badRequests.cannotCheckProgressFullCopyDetached(fullCopyURI.toString());
    }
    // Get the platform specific full copy implementation.
    BlockFullCopyApi fullCopyApiImpl = getPlatformSpecificFullCopyImpl(fullCopyVolume);
    // Now check the progress.
    s_logger.info("FINISH full copy progress check for {}", fullCopyURI);
    VolumeRestRep volumeRestRep = fullCopyApiImpl.checkProgress(sourceURI, fullCopyVolume);
    return volumeRestRep;
}
Also used : Volume(com.emc.storageos.db.client.model.Volume) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) URI(java.net.URI) BlockObject(com.emc.storageos.db.client.model.BlockObject)

Example 9 with VolumeRestRep

use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.

the class VPlexBlockFullCopyApiImpl method checkProgress.

/**
 * {@inheritDoc}
 */
@Override
public VolumeRestRep checkProgress(URI sourceURI, Volume fullCopyVolume) {
    // Get the native backend full copy volume for this VPLEX
    // full copy volume.
    Volume nativeFullCopyVolume = VPlexUtil.getVPLEXBackendVolume(fullCopyVolume, true, _dbClient);
    // Call super to check the progress of the backend full
    // copy volume.
    Integer percentSynced = getSyncPercentage(nativeFullCopyVolume.getAssociatedSourceVolume(), nativeFullCopyVolume);
    // The synchronization progress of the VPLEX full copy is that
    // of the backend full copy.
    VolumeRestRep volumeRestRep = BlockMapper.map(_dbClient, fullCopyVolume);
    volumeRestRep.getProtection().getFullCopyRep().setPercentSynced(percentSynced);
    return volumeRestRep;
}
Also used : Volume(com.emc.storageos.db.client.model.Volume) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep)

Example 10 with VolumeRestRep

use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.

the class BlockApplications method getAssociatedVolumesJSON.

public static void getAssociatedVolumesJSON(String copyLabel) {
    List<VolumeApplication> volumeDetails = Lists.newArrayList();
    String[] copySets = copyLabel.split("~~~");
    List<NamedRelatedResourceRep> volumeDetailClone = AppSupportUtil.getVolumeGroupFullCopiesForSet(copySets[0], copySets[1]);
    Map<URI, String> virtualArrays = ResourceUtils.mapNames(BourneUtil.getViprClient().varrays().list());
    Map<URI, String> virtualPools = ResourceUtils.mapNames(BourneUtil.getViprClient().blockVpools().list());
    for (NamedRelatedResourceRep volume : volumeDetailClone) {
        VolumeRestRep blockVolume = BourneUtil.getViprClient().blockVolumes().get(volume.getId());
        volumeDetails.add(new VolumeApplication(blockVolume, virtualArrays, virtualPools));
    }
    renderJSON(DataTablesSupport.createJSON(volumeDetails, params));
}
Also used : NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) VolumeApplication(controllers.resources.BlockApplications.VolumeApplicationDataTable.VolumeApplication) URI(java.net.URI)

Aggregations

VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)136 URI (java.net.URI)74 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)49 Asset (com.emc.sa.asset.annotation.Asset)35 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)35 ArrayList (java.util.ArrayList)25 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)23 AssetOption (com.emc.vipr.model.catalog.AssetOption)20 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)13 HashSet (java.util.HashSet)13 UnManagedVolumeRestRep (com.emc.storageos.model.block.UnManagedVolumeRestRep)12 Test (org.junit.Test)12 NamedVolumesList (com.emc.storageos.model.block.NamedVolumesList)11 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)10 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)9 BlockObjectRestRep (com.emc.storageos.model.block.BlockObjectRestRep)8 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)7 VolumeCreate (com.emc.storageos.model.block.VolumeCreate)7 List (java.util.List)7 SnapshotList (com.emc.storageos.model.SnapshotList)6