Source:
<code>private void updateExistingAndNewVolumes(Guid clusterId, Map<Guid, GlusterVolumeEntity> volumesMap) { VDSGroup cluster = getClusterDao().get(clusterId); for (Entry<Guid, GlusterVolumeEntity> entry : volumesMap.entrySet()) { GlusterVolumeEntity volume = entry.getValue(); log.debug("Analyzing volume '{}'", volume.getName()); GlusterVolumeEntity existingVolume = getVolumeDao().getById(entry.getKey()); if (existingVolume == null) { try { createVolume(volume); } catch (Exception e) { log.error("Could not save volume in database: {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } } else { try { log.debug("Volume '{}' exists in engine. Checking if it needs to be updated.", existingVolume.getName()); updateVolume(existingVolume, volume); } catch (Exception e) { log.error("Error while updating volume '{}': {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } } if (GlusterFeatureSupported.glusterSnapshot(cluster.getCompatibilityVersion()) && cluster.isGlusterCliBasedSchedulingOn() <START> && (Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)).equalsIgnoreCase(volume.getName())) { <END> VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new DisableGlusterCliSnapshotScheduleParameters(volume.getId(), false), ExecutionHandler.createInternalJobContext()); if (!returnValue.getSucceeded()) { log.warn("Unbale to set volume snapshot scheduling flag to gluster CLI scheduler"); } else { logUtil.logVolumeMessage(volume, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } } } }</code><technical_language>assuming if oVirt is installed managing cluster, scheduling done oVirt? I disable CLI scheduler if existing schedule setup oVirt. handle case of multiple schedules a volume, if a customer wants it. Currently done CLI. Meta-volume exist of geo-rep case too</technical_language>

Target:
private void updateExistingAndNewVolumes(Guid clusterId, Map<Guid, GlusterVolumeEntity> volumesMap) { VDSGroup cluster = getClusterDao().get(clusterId); for (Entry<Guid, GlusterVolumeEntity> entry : volumesMap.entrySet()) { GlusterVolumeEntity volume = entry.getValue(); log.debug("Analyzing volume '{}'", volume.getName()); GlusterVolumeEntity existingVolume = getVolumeDao().getById(entry.getKey()); if (existingVolume == null) { try { createVolume(volume); } catch (Exception e) { log.error("Could not save volume in database: {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } } else { try { log.debug("Volume '{}' exists in engine. Checking if it needs to be updated.", existingVolume.getName()); updateVolume(existingVolume, volume); } catch (Exception e) { log.error("Error while updating volume '{}': {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } } if (GlusterFeatureSupported.glusterSnapshot(cluster.getCompatibilityVersion()) && cluster.isGlusterCliBasedSchedulingOn() && (Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)).equalsIgnoreCase(volume.getName())) { VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(volume.getId(), false), ExecutionHandler.createInternalJobContext()); if (!returnValue.getSucceeded()) { log.warn("Unbale to set volume snapshot scheduling flag to gluster CLI scheduler"); } else { logUtil.logVolumeMessage(volume, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } } } }