Eli Mesika has uploaded a new change for review. Change subject: core: support custom fencing params for PPC ......................................................................
core: support custom fencing params for PPC Adding support for PPC hosts in 3.4 raised the need of having separate default fencing parameters for PPC. Default parameters are actually parameters with certain values per agent that are sent implicitly to VDSM when the agent is used. The problem is that those parameters that insures the correctness of the call to the agent script may vary between X86 and PPC This patch introduces a separate fencing default parameters for PPC. Please note that the architecture checked is of the target fenced host for the operation. Change-Id: I89717ac346e2ca1b44021b18dbe989ca5399f3f5 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1158090 Signed-off-by: Eli Mesika <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/pm/VdsFenceOptions.java M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql 5 files changed, 26 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/34577/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java index 4ccf704..d025155 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java @@ -4,6 +4,7 @@ import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.common.AuditLogType; +import org.ovirt.engine.core.common.businessentities.ArchitectureType; import org.ovirt.engine.core.common.businessentities.FenceActionType; import org.ovirt.engine.core.common.businessentities.FenceAgentOrder; import org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue; @@ -203,12 +204,16 @@ private String getManagementOptions(FenceAgentOrder order) { String managementOptions = ""; + ArchitectureType architectureType = null; + if (_vds.getCpuName() != null) { + architectureType = _vds.getCpuName().getArchitecture(); + } if (order == FenceAgentOrder.Primary) { - managementOptions = VdsFenceOptions.getDefaultAgentOptions(_vds.getPmType(), _vds.getPmOptions()); + managementOptions = VdsFenceOptions.getDefaultAgentOptions(_vds.getPmType(), _vds.getPmOptions(), architectureType ); } else if (order == FenceAgentOrder.Secondary) { managementOptions = - VdsFenceOptions.getDefaultAgentOptions(_vds.getPmSecondaryType(), _vds.getPmSecondaryOptions()); + VdsFenceOptions.getDefaultAgentOptions(_vds.getPmSecondaryType(), _vds.getPmSecondaryOptions(), architectureType); } return managementOptions; } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java index 866a64f..5524dbb 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java @@ -17,6 +17,7 @@ import org.ovirt.engine.core.common.action.FenceVdsActionParameters; import org.ovirt.engine.core.common.action.IdParameters; import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.businessentities.ArchitectureType; import org.ovirt.engine.core.common.businessentities.FenceActionType; import org.ovirt.engine.core.common.businessentities.FenceAgentOrder; import org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue; @@ -512,7 +513,8 @@ // subsequent 'on' command issued during this delay will be overridden by the actual shutdown String agent = (order == FenceAgentOrder.Primary) ? getVds().getPmType() : getVds().getPmSecondaryType(); String options = (order == FenceAgentOrder.Primary) ? getVds().getPmOptions() : getVds().getPmSecondaryOptions(); - options = VdsFenceOptions.getDefaultAgentOptions(agent, options); + ArchitectureType architectureType = (getVds().getCpuName() != null) ? getVds().getCpuName().getArchitecture() : null; + options = VdsFenceOptions.getDefaultAgentOptions(agent, options, architectureType); HashMap<String, String> optionsMap = VdsStatic.pmOptionsStringToMap(options); String powerWaitParamSettings = Config.getValue(ConfigValues.FencePowerWaitParam); String powerWaitParam = VdsFenceOptions.getAgentPowerWaitParam(agent, powerWaitParamSettings); diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java index 720af50..d48fb39 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java @@ -805,6 +805,11 @@ @DefaultValueAttribute("ilo3:lanplus,power_wait=4") FenceAgentDefaultParams, + @Reloadable + @TypeConverterAttribute(String.class) + @DefaultValueAttribute("ilo3:lanplus=1,cipher=1,privlvl=administrator,power_wait=4;ilo4:lanplus=1,cipher=1,privlvl=administrator,power_wait=4;ipmilan:lanplus=1,cipher=1,privlvl=administrator,power_wait=4") + FenceAgentDefaultParamsForPPC, + @TypeConverterAttribute(String.class) @DefaultValueAttribute("admin") AdminUser, diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/pm/VdsFenceOptions.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/pm/VdsFenceOptions.java index b84f643..c932347 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/pm/VdsFenceOptions.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/pm/VdsFenceOptions.java @@ -8,7 +8,9 @@ import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; +import org.ovirt.engine.core.common.businessentities.ArchitectureType; import org.ovirt.engine.core.common.config.Config; +import org.ovirt.engine.core.common.config.ConfigCommon; import org.ovirt.engine.core.common.config.ConfigValues; import org.ovirt.engine.core.compat.IntegerCompat; import org.ovirt.engine.core.utils.log.Log; @@ -321,11 +323,16 @@ * @param fenceOptions * @return String the options after adding default agent parameters */ - public static String getDefaultAgentOptions(String agent, String fenceOptions) { - String agentdefaultParams = Config.<String> getValue(ConfigValues.FenceAgentDefaultParams); + public static String getDefaultAgentOptions(String agent, String fenceOptions, ArchitectureType architectureType) { + String agentDefaultParams = (architectureType != null && architectureType == ArchitectureType.ppc64) + ? + Config.getValue(ConfigValues.FenceAgentDefaultParamsForPPC, ConfigCommon.defaultConfigurationVersion).toString() + : + Config.getValue(ConfigValues.FenceAgentDefaultParams, ConfigCommon.defaultConfigurationVersion).toString(); + StringBuilder realOptions = new StringBuilder(fenceOptions); // result has the format [<agent>:param=value[,]...;]* - String[] params = agentdefaultParams.split(Pattern.quote(SEMICOLON), -1); + String[] params = agentDefaultParams.split(Pattern.quote(SEMICOLON), -1); for (String agentOptionsStr : params) { String[] parts = agentOptionsStr.split(Pattern.quote(COLON), -1); if (parts.length == 2) { diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql index 9c03dbe..7fb4853 100644 --- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql +++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql @@ -653,6 +653,7 @@ select fn_db_update_config_value('DBEngine','Postgres','general'); select fn_db_update_config_value('DefaultTimeZone','(GMT) GMT Standard Time','general'); select fn_db_update_config_value('FenceAgentDefaultParams','ilo3:lanplus,power_wait=4;ilo4:lanplus,power_wait=4','general'); +select fn_db_add_config_value('FenceAgentDefaultParamsForPPC','ilo3:lanplus=1,cipher=1,privlvl=administrator,power_wait=4;ilo4:ilanplus=1,cipher=1,privlvl=administrator,power_wait=4;ipmilan:lanplus=1,cipher=1,privlvl=administrator,power_wait=4','general'); select fn_db_update_config_value('FenceAgentMapping','drac7=ipmilan,ilo2=ilo,ilo3=ipmilan,ilo4=ipmilan','general'); select fn_db_update_config_value('FenceStartStatusDelayBetweenRetriesInSec','10','general'); select fn_db_update_config_value('FenceStartStatusRetries','18','general'); -- To view, visit http://gerrit.ovirt.org/34577 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89717ac346e2ca1b44021b18dbe989ca5399f3f5 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Eli Mesika <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
