use of com.emc.fapiclient.ws.SetVolumeParam in project coprhd-controller by CoprHD.
the class RecoverPointUtils method verifyCGVolumesAttachedToSplitter.
/**
* verify that the volumes in a consistency group are connected to a splitter
*
* @param impl - handle for FAPI
* @param groupUID - consistency group to examine volumes on
* @throws - RecoverPointException
*/
public static void verifyCGVolumesAttachedToSplitter(FunctionalAPIImpl impl, ConsistencyGroupUID groupUID) throws RecoverPointException {
ConsistencyGroupSettings groupSettings;
try {
groupSettings = impl.getGroupSettings(groupUID);
// Get the consistency group settings
for (ReplicationSetSettings replicationSet : groupSettings.getReplicationSetsSettings()) {
// Run over all replication sets
for (UserVolumeSettings userVolume : replicationSet.getVolumes()) {
logger.info("Volume : " + RecoverPointUtils.getGuidBufferAsString(userVolume.getVolumeInfo().getRawUids(), false) + " is of type " + userVolume.getVolumeType());
if (userVolume.getAttachedSplitters().isEmpty()) {
String volumeWWN = RecoverPointUtils.getGuidBufferAsString(userVolume.getVolumeInfo().getRawUids(), false);
logger.warn("Volume " + volumeWWN + " is not attached to any splitters");
Set<SplitterUID> splittersToAttachTo = getSplittersToAttachToForVolume(impl, userVolume.getClusterUID(), userVolume.getVolumeInfo().getVolumeID());
for (SplitterUID splitterUID : splittersToAttachTo) {
SetVolumeParam volumeParam = new SetVolumeParam();
volumeParam.setShouldAttachAsClean(false);
volumeParam.setVolumeID(userVolume.getVolumeInfo().getVolumeID());
logger.info("Attaching volume " + volumeWWN + " to splitter" + impl.getSplitterName(splitterUID));
impl.attachVolumeToSplitter(splitterUID, volumeParam);
}
} else {
for (SplitterUID splitterUID : userVolume.getAttachedSplitters()) {
logger.info("Volume " + RecoverPointUtils.getGuidBufferAsString(userVolume.getVolumeInfo().getRawUids(), false) + " is attached to splitter " + impl.getSplitterName(splitterUID));
}
}
}
}
} catch (FunctionalAPIActionFailedException_Exception e) {
logger.error(e.getMessage(), e);
throw RecoverPointException.exceptions.exceptionGettingSettingsCG(e);
} catch (FunctionalAPIInternalError_Exception e) {
logger.error(e.getMessage(), e);
throw RecoverPointException.exceptions.exceptionGettingSettingsCG(e);
}
}
Aggregations