use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method attachContinuousCopy.
public List<URI> attachContinuousCopy(URI volumeURI, String copyName) {
try {
List<URI> mirrors = new ArrayList<URI>();
Copy copy = new Copy("native", Copy.SyncDirection.SOURCE_TO_TARGET.name(), null, copyName, 1);
CopiesParam input = new CopiesParam();
List<Copy> copies = input.getCopies();
copies.add(copy);
input.setCopies((copies));
;
Tasks<VolumeRestRep> tasks = client.blockVolumes().startContinuousCopies(volumeURI, input);
for (VolumeRestRep volumeRestRep : tasks.get()) {
log.info(String.format("Mirror %s (%s)", volumeRestRep.getName(), volumeRestRep.getNativeId()));
mirrors.add(volumeRestRep.getId());
}
return mirrors;
} catch (ServiceErrorException ex) {
log.info(String.format("Could not attach mirror %s to volume %s", copyName, volumeURI));
throw ex;
}
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method deleteVolumes.
public void deleteVolumes(List<URI> volumes, boolean inventoryOnly) {
try {
Tasks<VolumeRestRep> tasks = client.blockVolumes().deactivate(volumes, (inventoryOnly ? VolumeDeleteTypeEnum.VIPR_ONLY : VolumeDeleteTypeEnum.FULL));
for (VolumeRestRep volumeRestRep : tasks.get()) {
log.info(String.format("Volume %s (%s) deleted", volumeRestRep.getName(), volumeRestRep.getId()));
volumes.add(volumeRestRep.getId());
}
} catch (ServiceErrorException ex) {
log.error("Exception creating deleting volumes " + ex.getMessage(), ex);
throw ex;
}
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class RPIngestionTest method prepare2.
@Ignore
@Test
public // test2a creates unmanaged distributed local volume create. Ingestion handled in test2b.
void prepare2() {
// 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(DIST_VPOOL));
URI varray = util.getURIFromLabel(VirtualArray.class, properties.getProperty(DIST_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("test2NativeId", nativeId);
printLog("Virtual volume: " + nativeId);
stop("Test 2 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 VPlexIngestionTest method prepare3.
@Test
public // test3a creates unmanaged vplex local volume create. Ingestion handled in test1b.
void prepare3() {
// 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(MIRROR_VPOOL));
URI varray = util.getURIFromLabel(VirtualArray.class, properties.getProperty(MIRROR_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, null);
// Look up the volume
VolumeRestRep volume = client.blockVolumes().get(volumeURIs.get(0));
String nativeId = volume.getNativeId();
args.put("test3NativeId", nativeId);
printLog("Virtual volume: " + nativeId);
stop("Test 3 virtual volume creation: " + volumeName);
// Attach the mirror
List<URI> mirrorURIs = util.attachContinuousCopy(volumeURIs.get(0), volumeName + "-mirror");
printLog("Mirror volume: " + mirrorURIs.get(0).toString());
// Inventory only delete it.
// N.B. There is currently a problem... the VplexMirror object is not currently being deleted
// by inventory delete.
util.deleteVolumes(volumeURIs, true);
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class VPlexIngestionTest method prepare2.
@Ignore
@Test
public // test2a creates unmanaged distributed local volume create. Ingestion handled in test2b.
void prepare2() {
// 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(DIST_VPOOL));
URI varray = util.getURIFromLabel(VirtualArray.class, properties.getProperty(DIST_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("test2NativeId", nativeId);
printLog("Virtual volume: " + nativeId);
stop("Test 2 virtual volume creation: " + volumeName);
// Inventory only delete it.
util.deleteVolumes(volumeURIs, true);
}
Aggregations