Merge "Move CPU and RAM allocation ratios to ResourceTracker"
This commit is contained in:
commit
9d8f84685d
|
@ -33,6 +33,7 @@ def list_opts():
|
|||
nova.compute.manager.timeout_opts,
|
||||
nova.compute.monitors.compute_monitors_opts,
|
||||
nova.compute.resource_tracker.resource_tracker_opts,
|
||||
nova.compute.resource_tracker.allocation_ratio_opts,
|
||||
nova.compute.rpcapi.rpcapi_opts,
|
||||
)),
|
||||
('ephemeral_storage_encryption',
|
||||
|
|
|
@ -53,8 +53,25 @@ resource_tracker_opts = [
|
|||
help='The names of the extra resources to track.'),
|
||||
]
|
||||
|
||||
allocation_ratio_opts = [
|
||||
cfg.FloatOpt('cpu_allocation_ratio',
|
||||
default=16.0,
|
||||
help='Virtual CPU to physical CPU allocation ratio which affects '
|
||||
'all CPU filters. This configuration specifies a global ratio '
|
||||
'for CoreFilter. For AggregateCoreFilter, it will fall back to '
|
||||
'this configuration value if no per-aggregate setting found.'),
|
||||
cfg.FloatOpt('ram_allocation_ratio',
|
||||
default=1.5,
|
||||
help='Virtual ram to physical ram allocation ratio which affects '
|
||||
'all ram filters. This configuration specifies a global ratio '
|
||||
'for RamFilter. For AggregateRamFilter, it will fall back to '
|
||||
'this configuration value if no per-aggregate setting found.'),
|
||||
]
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(resource_tracker_opts)
|
||||
CONF.register_opts(allocation_ratio_opts)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
COMPUTE_RESOURCE_SEMAPHORE = "compute_resources"
|
||||
|
|
|
@ -24,15 +24,11 @@ from nova.scheduler.filters import utils
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
cpu_allocation_ratio_opt = cfg.FloatOpt('cpu_allocation_ratio',
|
||||
default=16.0,
|
||||
help='Virtual CPU to physical CPU allocation ratio which affects '
|
||||
'all CPU filters. This configuration specifies a global ratio '
|
||||
'for CoreFilter. For AggregateCoreFilter, it will fall back to '
|
||||
'this configuration value if no per-aggregate setting found.')
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(cpu_allocation_ratio_opt)
|
||||
|
||||
# TODO(sbauza): Remove the import once all compute nodes are reporting the
|
||||
# allocation ratio to the HostState
|
||||
CONF.import_opt('cpu_allocation_ratio', 'nova.compute.resource_tracker')
|
||||
|
||||
|
||||
class BaseCoreFilter(filters.BaseHostFilter):
|
||||
|
|
|
@ -23,15 +23,11 @@ from nova.scheduler.filters import utils
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
ram_allocation_ratio_opt = cfg.FloatOpt('ram_allocation_ratio',
|
||||
default=1.5,
|
||||
help='Virtual ram to physical ram allocation ratio which affects '
|
||||
'all ram filters. This configuration specifies a global ratio '
|
||||
'for RamFilter. For AggregateRamFilter, it will fall back to '
|
||||
'this configuration value if no per-aggregate setting found.')
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(ram_allocation_ratio_opt)
|
||||
|
||||
# TODO(sbauza): Remove the import once all compute nodes are reporting the
|
||||
# allocation ratio to the HostState
|
||||
CONF.import_opt('ram_allocation_ratio', 'nova.compute.resource_tracker')
|
||||
|
||||
|
||||
class BaseRamFilter(filters.BaseHostFilter):
|
||||
|
|
|
@ -37,12 +37,10 @@ def list_opts():
|
|||
return [
|
||||
('DEFAULT',
|
||||
itertools.chain(
|
||||
[nova.scheduler.filters.core_filter.cpu_allocation_ratio_opt],
|
||||
[nova.scheduler.filters.disk_filter.disk_allocation_ratio_opt],
|
||||
[nova.scheduler.filters.io_ops_filter.max_io_ops_per_host_opt],
|
||||
[nova.scheduler.filters.num_instances_filter.
|
||||
max_instances_per_host_opt],
|
||||
[nova.scheduler.filters.ram_filter.ram_allocation_ratio_opt],
|
||||
[nova.scheduler.scheduler_options.
|
||||
scheduler_json_config_location_opt],
|
||||
nova.scheduler.driver.scheduler_driver_opts,
|
||||
|
|
Loading…
Reference in New Issue