Search in sources :

Example 1 with GlusterVolumeActionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters in project ovirt-engine by oVirt.

the class StopGlusterVolumeCommand method executeCommand.

@Override
protected void executeCommand() {
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopGlusterVolume, new GlusterVolumeActionVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().isForceAction()));
    setSucceeded(returnValue.getSucceeded());
    if (getSucceeded()) {
        glusterDBUtils.updateVolumeStatus(getParameters().getVolumeId(), GlusterStatus.DOWN);
    } else {
        handleVdsError(AuditLogType.GLUSTER_VOLUME_STOP_FAILED, returnValue.getVdsError().getMessage());
        return;
    }
}
Also used : GlusterVolumeActionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 2 with GlusterVolumeActionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters in project ovirt-engine by oVirt.

the class DisableGlusterCliSnapshotScheduleInternalCommand method executeCommand.

@Override
protected void executeCommand() {
    Cluster cluster = getCluster();
    VDSReturnValue retValue = runVdsCommand(VDSCommandType.OverrideGlusterVolumeSnapshotSchedule, new GlusterVolumeActionVDSParameters(getUpServer().getId(), getGlusterVolumeName(), getParameters().isForceAction()));
    setSucceeded(retValue.getSucceeded());
    if (!retValue.getSucceeded()) {
        handleVdsError(AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLE_FAILED, retValue.getVdsError().getMessage());
    } else {
        // cliBasedSnapshotSchedulingOn=false and persist in engine side
        if (getParameters().isForceAction()) {
            cluster.setGlusterCliBasedSchedulingOn(false);
            clusterDao.update(cluster);
        }
    }
}
Also used : GlusterVolumeActionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 3 with GlusterVolumeActionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters in project ovirt-engine by oVirt.

the class StartGlusterVolumeCommand method executeCommand.

@Override
protected void executeCommand() {
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StartGlusterVolume, new GlusterVolumeActionVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().isForceAction()));
    setSucceeded(returnValue.getSucceeded());
    if (getSucceeded()) {
        glusterDBUtils.updateVolumeStatus(getParameters().getVolumeId(), GlusterStatus.UP);
        /* Refresh volume details once the volume is started.
             * A specific requirement for this was user might create a volume for the sake of using it for geo-replication.
             * However, for suggesting volumes eligible for session creation, the size information of the volume is very important.
             * Having the user to wait for the sync job to sync the volume detail might not be appropriate.
             */
        glusterSyncJob.refreshVolumeDetails(upServer, glusterVolumeDao.getById(getParameters().getVolumeId()));
    /* GlusterSyncJob.getInstance().refreshVolumeDetails(upServer, getGlusterVolume());
             * will not suffice bcoz, getGlusterVolume fetches new volume only if its not yet been fetched from db and hence, refreshVolumeDetails figures out
             * that the info about volume-bricks are stale and hence attempts a update and correspondingly raises events for brick state change.
             * But here in the previous step we changed the volumes state(To GlusterStatus.UP) due to a successful execution of start command.
             * Hence fetch the volume afresh after the state change and use it to refresh volume details.
             */
    } else {
        handleVdsError(AuditLogType.GLUSTER_VOLUME_START_FAILED, returnValue.getVdsError().getMessage());
        return;
    }
}
Also used : GlusterVolumeActionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)3 GlusterVolumeActionVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1