Merge "New service parameter for intel_pstate"
This commit is contained in:
commit
9ed2e51be1
@ -633,13 +633,17 @@ class ServiceParameterController(rest.RestController):
|
||||
svc_params.append(new_parm)
|
||||
|
||||
try:
|
||||
# Pass name to update_service_config only in case the parameter is the Intel
|
||||
# NIC driver version
|
||||
# Pass name to update_service_config only in case the parameters are the Intel
|
||||
# NIC driver version and intel_pstate.
|
||||
new_name = None
|
||||
if section == constants.SERVICE_PARAM_SECTION_PLATFORM_CONFIG and \
|
||||
name == constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_NIC_DRIVER_VERSION:
|
||||
new_name = name
|
||||
|
||||
elif section == constants.SERVICE_PARAM_SECTION_PLATFORM_CONFIG and \
|
||||
name == constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE:
|
||||
new_name = name
|
||||
|
||||
pecan.request.rpcapi.update_service_config(
|
||||
pecan.request.context, service, section=section, name=new_name)
|
||||
except rpc_common.RemoteError as e:
|
||||
@ -790,6 +794,10 @@ class ServiceParameterController(rest.RestController):
|
||||
parameter.name == constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_NIC_DRIVER_VERSION:
|
||||
name = parameter.name
|
||||
|
||||
elif parameter.section == constants.SERVICE_PARAM_SECTION_PLATFORM_CONFIG and \
|
||||
parameter.name == constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE:
|
||||
name = parameter.name
|
||||
|
||||
pecan.request.rpcapi.update_service_config(
|
||||
pecan.request.context,
|
||||
parameter.service,
|
||||
|
@ -1117,6 +1117,24 @@ SERVICE_PARAM_PLAT_CONFIG_INTEL_CVL_VALUES = (
|
||||
'cvl-4.10',
|
||||
'cvl-4.0.1')
|
||||
|
||||
SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE = 'intel_pstate'
|
||||
# Valid 'intel_pstate' values
|
||||
# Kernel Command Line Options for intel_pstate at
|
||||
# https://www.kernel.org/doc/html/v4.12/admin-guide/pm/intel_pstate.html
|
||||
# The last entry is used as the default. Currently none was kept as default
|
||||
# to be consistent with previous(there is not intel_pstate in the boot
|
||||
# commandline). The user can set none if they do not want pass argument to
|
||||
# the kernel in the command line for intel_pstate.
|
||||
SERVICE_PARAM_PLAT_CONFIG_INTEL_PSTATE_VALUES = (
|
||||
'disable',
|
||||
'passive',
|
||||
'force',
|
||||
'per_cpu_perf_limits',
|
||||
'hwp_only',
|
||||
'support_acpi_ppc',
|
||||
'no_hwp',
|
||||
'none')
|
||||
|
||||
# default time to live seconds
|
||||
PM_TTL_DEFAULT = 86400
|
||||
|
||||
|
@ -287,6 +287,15 @@ def _validate_intel_nic_driver_version(name, value):
|
||||
name, constants.SERVICE_PARAM_PLAT_CONFIG_INTEL_CVL_VALUES)))
|
||||
|
||||
|
||||
def _validate_intel_pstate(name, value):
|
||||
"""Check if intel_pstate value is valid"""
|
||||
|
||||
if value not in constants.SERVICE_PARAM_PLAT_CONFIG_INTEL_PSTATE_VALUES:
|
||||
raise wsme.exc.ClientSideError(_(
|
||||
"Parameter '{}' value must be one of {}".format(
|
||||
name, constants.SERVICE_PARAM_PLAT_CONFIG_INTEL_PSTATE_VALUES)))
|
||||
|
||||
|
||||
def _get_network_pool_from_ip_address(ip, networks):
|
||||
for name in networks:
|
||||
try:
|
||||
@ -751,6 +760,7 @@ PLATFORM_CONFIG_PARAMETER_OPTIONAL = [
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_VIRTUAL,
|
||||
constants.SERVICE_PARAM_NAME_PLATFORM_MAX_CPU_PERCENTAGE,
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_NIC_DRIVER_VERSION,
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE,
|
||||
]
|
||||
|
||||
PLATFORM_CONFIG_PARAMETER_READONLY = [
|
||||
@ -764,12 +774,16 @@ PLATFORM_CONFIG_PARAMETER_VALIDATOR = {
|
||||
_validate_max_cpu_min_percentage,
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_NIC_DRIVER_VERSION:
|
||||
_validate_intel_nic_driver_version,
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE:
|
||||
_validate_intel_pstate,
|
||||
}
|
||||
|
||||
PLATFORM_CONFIG_PARAMETER_RESOURCE = {
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_VIRTUAL: 'platform::params::virtual_system',
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_NIC_DRIVER_VERSION:
|
||||
'platform::compute::grub::params::g_intel_nic_driver_version',
|
||||
constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE:
|
||||
'platform::compute::grub::params::g_intel_pstate',
|
||||
}
|
||||
|
||||
IDENTITY_LDAP_PARAMETER_OPTIONAL = [
|
||||
|
@ -817,6 +817,11 @@ class ConductorManager(service.PeriodicService):
|
||||
'name': constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_NIC_DRIVER_VERSION,
|
||||
'value': constants.SERVICE_PARAM_PLAT_CONFIG_INTEL_CVL_VALUES[-1],
|
||||
},
|
||||
{'service': constants.SERVICE_TYPE_PLATFORM,
|
||||
'section': constants.SERVICE_PARAM_SECTION_PLATFORM_CONFIG,
|
||||
'name': constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE,
|
||||
'value': constants.SERVICE_PARAM_PLAT_CONFIG_INTEL_PSTATE_VALUES[-1],
|
||||
},
|
||||
{'service': constants.SERVICE_TYPE_RADOSGW,
|
||||
'section': constants.SERVICE_PARAM_SECTION_RADOSGW_CONFIG,
|
||||
'name': constants.SERVICE_PARAM_NAME_RADOSGW_SERVICE_ENABLED,
|
||||
@ -10283,6 +10288,23 @@ class ConductorManager(service.PeriodicService):
|
||||
"classes": ['platform::compute::grub::runtime']
|
||||
}
|
||||
|
||||
# Apply runtime config but keep reboot required flag set in
|
||||
# _config_update_hosts() above. Node needs a reboot to clear it.
|
||||
config_uuid = self._config_clear_reboot_required(config_uuid)
|
||||
self._config_apply_runtime_manifest(context, config_uuid, config_dict, force=True)
|
||||
elif section == constants.SERVICE_PARAM_SECTION_PLATFORM_CONFIG and \
|
||||
name == constants.SERVICE_PARAM_NAME_PLAT_CONFIG_INTEL_PSTATE:
|
||||
reboot = True
|
||||
personalities = [constants.CONTROLLER,
|
||||
constants.WORKER,
|
||||
constants.STORAGE]
|
||||
config_uuid = self._config_update_hosts(context, personalities, reboot=True)
|
||||
|
||||
config_dict = {
|
||||
'personalities': personalities,
|
||||
"classes": ['platform::compute::grub::runtime']
|
||||
}
|
||||
|
||||
# Apply runtime config but keep reboot required flag set in
|
||||
# _config_update_hosts() above. Node needs a reboot to clear it.
|
||||
config_uuid = self._config_clear_reboot_required(config_uuid)
|
||||
|
Loading…
Reference in New Issue
Block a user