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);
}
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;
}
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;
}
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;
}
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));
}
Aggregations