use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters 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.GlusterVolumeOptionVDSParameters in project ovirt-engine by oVirt.
the class SetGlusterVolumeOptionCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetGlusterVolumeOption, new GlusterVolumeOptionVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getVolumeOption()));
setSucceeded(returnValue.getSucceeded());
if (getSucceeded()) {
updateOptionInDb(getParameters().getVolumeOption());
} else {
handleVdsError(AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
Aggregations