Search in sources :

Example 1 with GlusterVolumeSnapshotVDSParameters

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());
    }
}
Also used : GlusterVolumeSnapshotVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotVDSParameters) VDS(org.ovirt.engine.core.common.businessentities.VDS) GlusterVolumeSnapshotEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 2 with GlusterVolumeSnapshotVDSParameters

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());
    }
}
Also used : GlusterVolumeSnapshotVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotVDSParameters) VDS(org.ovirt.engine.core.common.businessentities.VDS) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

VDS (org.ovirt.engine.core.common.businessentities.VDS)2 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)2 GlusterVolumeSnapshotVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotVDSParameters)2 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)1 GlusterVolumeSnapshotEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity)1