use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepConfigVdsParameters in project ovirt-engine by oVirt.
the class SetGeoRepConfigCommand method executeCommand.
@Override
protected void executeCommand() {
GlusterGeoRepSession session = getGeoRepSession();
String configKey = getParameters().getConfigKey();
String configValue = getParameters().getConfigValue();
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetGlusterVolumeGeoRepConfig, new GlusterVolumeGeoRepConfigVdsParameters(upServer.getId(), session.getMasterVolumeName(), session.getSlaveHostName(), session.getSlaveVolumeName(), configKey, configValue, session.getUserName()));
boolean succeeded = returnValue.getSucceeded();
if (succeeded && configKey.equals("use_meta_volume")) {
// Not handling failures as there's no way to figure out if the error is that the option is already set.
runVdsCommand(VDSCommandType.SetGlusterVolumeOption, new GlusterVolumeOptionVDSParameters(upServer.getId(), "all", new GlusterVolumeOptionEntity(getGeoRepSession().getMasterVolumeId(), "cluster.enable-shared-storage", "enable")));
}
setSucceeded(succeeded);
if (getSucceeded()) {
GlusterGeoRepSessionConfiguration geoRepSessionConfig = new GlusterGeoRepSessionConfiguration();
geoRepSessionConfig.setValue(configValue);
geoRepSessionConfig.setKey(configKey);
geoRepSessionConfig.setId(session.getId());
if (glusterGeoRepDao.getGeoRepSessionConfigByKey(session.getId(), configKey) == null) {
glusterGeoRepDao.saveConfig(geoRepSessionConfig);
} else {
glusterGeoRepDao.updateConfig(geoRepSessionConfig);
}
} else {
handleVdsError(AuditLogType.GLUSTER_GEOREP_CONFIG_SET_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepConfigVdsParameters in project ovirt-engine by oVirt.
the class ResetDefaultGeoRepConfigCommand method executeCommand.
@Override
protected void executeCommand() {
GlusterGeoRepSession session = getGeoRepSession();
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetGlusterVolumeGeoRepConfigDefault, new GlusterVolumeGeoRepConfigVdsParameters(upServer.getId(), session.getMasterVolumeName(), session.getSlaveHostName(), session.getSlaveVolumeName(), getParameters().getConfigKey(), null, session.getUserName()));
glusterGeoRepSyncJob.updateDiscoveredSessionConfig(getCluster(), session);
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_GEOREP_CONFIG_SET_DEFAULT_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
Aggregations