use of com.emc.storageos.xtremio.restapi.model.response.XtremIOVolume in project coprhd-controller by CoprHD.
the class XtremIOExportMaskVolumesValidator method validate.
@Override
public boolean validate() throws Exception {
log.info("Initiating volume validation of XtremIO ExportMask: " + id);
try {
XtremIOClient client = XtremIOProvUtils.getXtremIOClient(getDbClient(), storage, getClientFactory());
String xioClusterName = client.getClusterDetails(storage.getSerialNumber()).getName();
Set<String> knownVolumes = new HashSet<>();
Set<String> igVols = new HashSet<>();
// get the volumes in the IGs and validate against passed impacted block objects
for (BlockObject maskVolume : blockObjects) {
knownVolumes.add(maskVolume.getDeviceLabel());
}
List<XtremIOVolume> igVolumes = new ArrayList<>();
for (String igName : igNames) {
igVolumes.addAll(XtremIOProvUtils.getInitiatorGroupVolumes(igName, xioClusterName, client));
}
for (XtremIOVolume igVolume : igVolumes) {
igVols.add(igVolume.getVolInfo().get(1));
}
log.info("ViPR known volumes present in IG: {}, volumes in IG: {}", knownVolumes, igVols);
igVols.removeAll(knownVolumes);
for (String igVol : igVols) {
getLogger().logDiff(id, "volumes", ValidatorLogger.NO_MATCHING_ENTRY, igVol);
}
} catch (Exception ex) {
log.error("Unexpected exception validating ExportMask volumes: " + ex.getMessage(), ex);
if (getConfig().isValidationEnabled()) {
throw DeviceControllerException.exceptions.unexpectedCondition("Unexpected exception validating ExportMask volumes: " + ex.getMessage());
}
}
checkForErrors();
log.info("Completed volume validation of XtremIO ExportMask: " + id);
return true;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOVolume in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getVolumeByIndex.
@Override
public XtremIOVolume getVolumeByIndex(String index, String clusterName) throws Exception {
String uriString = XtremIOConstants.XTREMIO_V2_VOLUMES_STR.concat(XtremIOConstants.SLASH).concat(index).concat(XtremIOConstants.getInputClusterString(clusterName));
ClientResponse response = get(URI.create(uriString));
XtremIOVolumes volumesResponse = getResponseObject(XtremIOVolumes.class, response);
XtremIOVolume volume = volumesResponse.getContent();
log.info(volume.toString());
return volume;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOVolume in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getSnapShotDetails.
@Override
public XtremIOVolume getSnapShotDetails(String snapName, String clusterName) throws Exception {
String uriStr = XtremIOConstants.XTREMIO_V2_SNAPS_STR.concat(XtremIOConstants.getInputNameForClusterString(snapName, clusterName));
ClientResponse response = get(URI.create(uriStr));
XtremIOVolumes volumesResponse = getResponseObject(XtremIOVolumes.class, response);
XtremIOVolume snap = volumesResponse.getContent();
log.info(snap.toString());
return snap;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOVolume in project coprhd-controller by CoprHD.
the class XtremIOV1Client method getSnapShotDetails.
@Override
public XtremIOVolume getSnapShotDetails(String snapName, String clusterName) throws Exception {
String uriStr = XtremIOConstants.XTREMIO_SNAPS_STR.concat(XtremIOConstants.getInputNameString(snapName));
ClientResponse response = get(URI.create(uriStr));
XtremIOVolumes volumesResponse = getResponseObject(XtremIOVolumes.class, response);
XtremIOVolume snap = volumesResponse.getContent();
log.info(snap.toString());
return snap;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOVolume in project coprhd-controller by CoprHD.
the class XtremIOArrayAffinityDiscoverer method filterKnownVolumes.
/**
* Filter the known volumes in DB, as the preferredPools list in Host needs
* to have pools of unmanaged volumes alone.
*/
private void filterKnownVolumes(StorageSystem system, DbClient dbClient, XtremIOClient xtremIOClient, String xioClusterName, Set<String> igVolumes) throws Exception {
Iterator<String> itr = igVolumes.iterator();
while (itr.hasNext()) {
String volumeName = itr.next();
XtremIOVolume xioVolume = xtremIOClient.getVolumeDetails(volumeName, xioClusterName);
String managedVolumeNativeGuid = NativeGUIDGenerator.generateNativeGuidForVolumeOrBlockSnapShot(system.getNativeGuid(), xioVolume.getVolInfo().get(0));
Volume dbVolume = DiscoveryUtils.checkStorageVolumeExistsInDB(dbClient, managedVolumeNativeGuid);
if (dbVolume != null) {
itr.remove();
}
}
}
Aggregations