use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotVDSParameters in project ovirt-engine by oVirt.
the class GlusterSnapshotSyncJob method refreshSnapshotsInCluster.
private void refreshSnapshotsInCluster(Cluster cluster) {
if (!supportsGlusterSnapshotFeature(cluster)) {
return;
}
final VDS upServer = glusterUtil.getRandomUpServer(cluster.getId());
if (upServer == null) {
log.info("No UP server found in cluster '{}' for snapshot monitoring", cluster.getName());
return;
}
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), cluster.getId(), null));
if (returnValue.getSucceeded()) {
addOrUpdateSnapshots(cluster.getId(), (ArrayList<GlusterVolumeSnapshotEntity>) returnValue.getReturnValue());
// check if the snapshot soft limit reached for a volume and alert
List<GlusterVolumeEntity> volumes = volumeDao.getByClusterId(cluster.getId());
for (final GlusterVolumeEntity volume : volumes) {
// check if the snapshot soft limit reached for the volume and alert
glusterUtil.alertVolumeSnapshotLimitsReached(volume);
// Check and remove soft limit alert for the volume.
// It might have fallen below the soft limit as part of deletions of snapshots
glusterUtil.checkAndRemoveVolumeSnapshotLimitsAlert(volume);
}
} else {
log.error("VDS Error {}", returnValue.getVdsError().getMessage());
log.debug("VDS Error {}", returnValue.getVdsError());
}
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotVDSParameters in project ovirt-engine by oVirt.
the class GlusterSnapshotSyncJob method refreshSnapshotConfigInCluster.
public void refreshSnapshotConfigInCluster(Cluster cluster) {
if (!supportsGlusterSnapshotFeature(cluster)) {
return;
}
final VDS upServer = glusterUtil.getRandomUpServer(cluster.getId());
if (upServer == null) {
log.info("No UP server found in cluster '{}' for snapshot configurations monitoring", cluster.getName());
return;
}
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotConfigInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), cluster.getId(), null));
if (returnValue.getSucceeded()) {
addOrUpdateSnapshotsConfig(cluster.getId(), (GlusterSnapshotConfigInfo) returnValue.getReturnValue());
} else {
log.error("VDS Error {}", returnValue.getVdsError().getMessage());
log.debug("VDS Error {}", returnValue.getVdsError());
}
}
Aggregations