use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.
the class VirtualDataCenterProvider method getVolumeFilter.
@Asset("volumeFilter")
@AssetDependencies({ "unmanagedBlockStorageSystem", "blockVirtualPool" })
public List<AssetOption> getVolumeFilter(AssetOptionsContext ctx, URI storageSystemId, URI vpool) {
List<String> volumeNames = Lists.newArrayList();
for (UnManagedVolumeRestRep volume : listUnmanagedVolumes(ctx, storageSystemId, vpool)) {
if (!isNonRPExported(volume.getVolumeCharacteristics())) {
volumeNames.add(getLabel(volume));
}
}
Collections.sort(volumeNames, new StringComparator(false));
return getVolumeFilterOptions(volumeNames);
}
use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.
the class RPIngestionTest method test3.
@Ignore
@Test
public void test3() {
printLog("test3");
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));
URI cg = util.getURIFromLabel(BlockConsistencyGroup.class, properties.getProperty(CONSISTENCY_GROUP));
URI vplexURI = util.getURIFromLabel(StorageSystem.class, properties.getProperty(VPLEX_GUID));
// Look up the unmanaged volume by nativeId.
List<UnManagedVolumeRestRep> uvols = client.unmanagedVolumes().getByStorageSystem(vplexURI);
List<URI> uvolId = new ArrayList<URI>();
for (UnManagedVolumeRestRep uvol : uvols) {
if (uvol.getNativeGuid().equals(args.get("test3NativeId"))) {
printLog("UnManagedVolume: " + uvol.getNativeGuid());
uvolId.add(uvol.getId());
}
}
Assert.assertFalse("Unmanaged volume id null", uvolId.isEmpty());
// Do ingestion of virtual volume.
start();
List<String> nativeGuids = util.ingestUnManagedVolume(uvolId, project, varray, vpool);
stop("Test3 ingestion of volume: " + uvolId);
// Lookup the volumes in the database.
List<Volume> volumes = util.findVolumesByNativeGuid(vplexURI, nativeGuids);
for (Volume vvol : volumes) {
printLog(String.format("Volume %s %s %s", vvol.getLabel(), vvol.getNativeGuid(), vvol.getId()));
Assert.assertNotNull("No associated volumes", vvol.getAssociatedVolumes());
Assert.assertFalse("Associated volumes empty", vvol.getAssociatedVolumes().isEmpty());
for (String assocVolume : vvol.getAssociatedVolumes()) {
Volume bvol = dbClient.queryObject(Volume.class, URI.create(assocVolume));
printLog(String.format(" Backend Volume %s %s %s", bvol.getLabel(), bvol.getNativeGuid(), bvol.getId()));
}
}
}
use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.
the class VPlexIngestionTest method test2.
@Ignore
@Test
public void test2() {
printLog("test2");
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));
URI cg = util.getURIFromLabel(BlockConsistencyGroup.class, properties.getProperty(CONSISTENCY_GROUP));
URI vplexURI = util.getURIFromLabel(StorageSystem.class, properties.getProperty(VPLEX_GUID));
// Look up the unmanaged volume by nativeId.
List<UnManagedVolumeRestRep> uvols = client.unmanagedVolumes().getByStorageSystem(vplexURI);
List<URI> uvolId = new ArrayList<URI>();
for (UnManagedVolumeRestRep uvol : uvols) {
if (uvol.getNativeGuid().equals(args.get("test2NativeId"))) {
printLog("UnManagedVolume: " + uvol.getNativeGuid());
uvolId.add(uvol.getId());
}
}
Assert.assertFalse("Unmanaged volume id null", uvolId.isEmpty());
// Do ingestion of virtual volume.
start();
List<String> nativeGuids = util.ingestUnManagedVolume(uvolId, project, varray, vpool);
stop("Test2 ingestion of virtual volume: " + uvolId);
// Lookup the volumes in the database.
List<Volume> volumes = util.findVolumesByNativeGuid(vplexURI, nativeGuids);
for (Volume vvol : volumes) {
printLog(String.format("Volume %s %s %s", vvol.getLabel(), vvol.getNativeGuid(), vvol.getId()));
Assert.assertNotNull("No associated volumes", vvol.getAssociatedVolumes());
Assert.assertFalse("Associated volumes empty", vvol.getAssociatedVolumes().isEmpty());
for (String assocVolume : vvol.getAssociatedVolumes()) {
Volume bvol = dbClient.queryObject(Volume.class, URI.create(assocVolume));
printLog(String.format(" Backend Volume %s %s %s", bvol.getLabel(), bvol.getNativeGuid(), bvol.getId()));
}
}
}
use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.
the class VPlexIngestionTest method test3.
@Test
public void test3() {
printLog("test3");
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));
URI cg = util.getURIFromLabel(BlockConsistencyGroup.class, properties.getProperty(CONSISTENCY_GROUP));
URI vplexURI = util.getURIFromLabel(StorageSystem.class, properties.getProperty(VPLEX_GUID));
// Look up the unmanaged volume by nativeId.
List<UnManagedVolumeRestRep> uvols = client.unmanagedVolumes().getByStorageSystem(vplexURI);
List<URI> uvolId = new ArrayList<URI>();
for (UnManagedVolumeRestRep uvol : uvols) {
if (uvol.getNativeGuid().equals(args.get("test3NativeId"))) {
printLog("UnManagedVolume: " + uvol.getNativeGuid());
uvolId.add(uvol.getId());
}
}
Assert.assertFalse("Unmanaged volume id null", uvolId.isEmpty());
// Do ingestion of virtual volume.
start();
List<String> nativeGuids = util.ingestUnManagedVolume(uvolId, project, varray, vpool);
stop("Test3 ingestion of volume: " + uvolId);
// Lookup the volumes in the database.
List<Volume> volumes = util.findVolumesByNativeGuid(vplexURI, nativeGuids);
for (Volume vvol : volumes) {
printLog(String.format("Volume %s %s %s", vvol.getLabel(), vvol.getNativeGuid(), vvol.getId()));
Assert.assertNotNull("No associated volumes", vvol.getAssociatedVolumes());
Assert.assertFalse("Associated volumes empty", vvol.getAssociatedVolumes().isEmpty());
for (String assocVolume : vvol.getAssociatedVolumes()) {
Volume bvol = dbClient.queryObject(Volume.class, URI.create(assocVolume));
printLog(String.format(" Backend Volume %s %s %s", bvol.getLabel(), bvol.getNativeGuid(), bvol.getId()));
}
}
}
use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.
the class MobilityGroupMigrationService method ingestVolumes.
private void ingestVolumes() {
List<NamedRelatedResourceRep> hostsOrClusters = Lists.newArrayList();
if (mobilityGroup.getMigrationGroupBy().equals(VolumeGroup.MigrationGroupBy.HOSTS.name())) {
hostsOrClusters = execute(new GetMobilityGroupHosts(mobilityGroup.getId()));
} else if (mobilityGroup.getMigrationGroupBy().equals(VolumeGroup.MigrationGroupBy.CLUSTERS.name())) {
hostsOrClusters = execute(new GetMobilityGroupClusters(mobilityGroup.getId()));
}
for (NamedRelatedResourceRep hostOrCluster : hostsOrClusters) {
int remaining = execute(new GetUnmanagedVolumesByHostOrCluster(hostOrCluster.getId())).size();
logInfo("ingest.exported.unmanaged.volume.service.remaining", remaining);
}
for (NamedRelatedResourceRep hostOrCluster : hostsOrClusters) {
URI host = BlockStorageUtils.isHost(hostOrCluster.getId()) ? hostOrCluster.getId() : null;
URI cluster = BlockStorageUtils.isCluster(hostOrCluster.getId()) ? hostOrCluster.getId() : null;
List<UnManagedVolumeRestRep> volumeIds = execute(new GetUnmanagedVolumesByHostOrCluster(hostOrCluster.getId()));
List<URI> ingestVolumeIds = Lists.newArrayList();
for (UnManagedVolumeRestRep unmanaged : volumeIds) {
if (VirtualDataCenterProvider.matchesVpool(unmanaged, virtualPool)) {
ingestVolumeIds.add(unmanaged.getId());
}
}
int succeed = execute(new IngestExportedUnmanagedVolumes(virtualPool, virtualArray, project, host == null ? null : host, cluster == null ? null : cluster, ingestVolumeIds, IngestionMethodEnum.VIRTUAL_VOLUMES_ONLY.toString())).getTasks().size();
logInfo("ingest.exported.unmanaged.volume.service.ingested", succeed);
logInfo("ingest.exported.unmanaged.volume.service.skipped", volumeIds.size() - succeed);
}
}
Aggregations