use of com.emc.sa.service.vipr.block.tasks.GetUnmanagedVolumesByHostOrCluster in project coprhd-controller by CoprHD.
the class IngestExportedUnmanagedVolumesService method execute.
@Override
public void execute() throws Exception {
if (ingestionMethod == null || ingestionMethod.isEmpty()) {
ingestionMethod = IngestionMethodEnum.FULL.toString();
}
int succeed = execute(new IngestExportedUnmanagedVolumes(virtualPool, virtualArray, project, host == null ? null : host.getId(), cluster == null ? null : cluster.getId(), uris(volumeIds), ingestionMethod)).getTasks().size();
logInfo("ingest.exported.unmanaged.volume.service.ingested", succeed);
logInfo("ingest.exported.unmanaged.volume.service.skipped", volumeIds.size() - succeed);
int remaining = execute(new GetUnmanagedVolumesByHostOrCluster(host != null ? host.getId() : cluster.getId())).size();
logInfo("ingest.exported.unmanaged.volume.service.remaining", remaining);
}
use of com.emc.sa.service.vipr.block.tasks.GetUnmanagedVolumesByHostOrCluster 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