diff --git a/doc/source/admin/scheduling.rst b/doc/source/admin/scheduling.rst index e0e5b7188b33..e863554fe747 100644 --- a/doc/source/admin/scheduling.rst +++ b/doc/source/admin/scheduling.rst @@ -1100,6 +1100,16 @@ control the initial allocation ratio values for a compute node: * :oslo.config:option:`initial_disk_allocation_ratio` the initial DISK_GB inventory allocation ratio for a new compute node record, defaults to 1.0 +Starting with the 27.0.0 Antelope release, the following default values are used +for the initial allocation ratio values for a compute node: + +* :oslo.config:option:`initial_cpu_allocation_ratio` the initial VCPU + inventory allocation ratio for a new compute node record, defaults to 4.0 +* :oslo.config:option:`initial_ram_allocation_ratio` the initial MEMORY_MB + inventory allocation ratio for a new compute node record, defaults to 1.0 +* :oslo.config:option:`initial_disk_allocation_ratio` the initial DISK_GB + inventory allocation ratio for a new compute node record, defaults to 1.0 + Scheduling considerations ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/nova/conf/compute.py b/nova/conf/compute.py index 71707cfd531a..224c80293510 100644 --- a/nova/conf/compute.py +++ b/nova/conf/compute.py @@ -529,7 +529,7 @@ Related options: * ``initial_disk_allocation_ratio`` """), cfg.FloatOpt('initial_cpu_allocation_ratio', - default=16.0, + default=4.0, min=0.0, help=""" Initial virtual CPU to physical CPU allocation ratio. @@ -545,7 +545,7 @@ Related options: * ``cpu_allocation_ratio`` """), cfg.FloatOpt('initial_ram_allocation_ratio', - default=1.5, + default=1.0, min=0.0, help=""" Initial virtual RAM to physical RAM allocation ratio. diff --git a/nova/tests/functional/test_server_group.py b/nova/tests/functional/test_server_group.py index 38804a671b57..7cbe8bdb679d 100644 --- a/nova/tests/functional/test_server_group.py +++ b/nova/tests/functional/test_server_group.py @@ -103,7 +103,10 @@ class ServerGroupFakeDriver(fake.SmallFakeDriver): """ vcpus = 1000 - memory_mb = 8192 + # the testcases were built with a default ram allocation ratio + # of 1.5 and 8192 mb of ram so to maintain the same capacity with + # the new default allocation ratio of 1.0 we use 8192+4096=12288 + memory_mb = 12288 local_gb = 100000 diff --git a/nova/tests/functional/test_servers_provider_tree.py b/nova/tests/functional/test_servers_provider_tree.py index f48f91dc026f..da562c4f19f5 100644 --- a/nova/tests/functional/test_servers_provider_tree.py +++ b/nova/tests/functional/test_servers_provider_tree.py @@ -82,7 +82,7 @@ class ProviderTreeTests(integrated_helpers.ProviderUsageBaseTestCase): }, 'MEMORY_MB': { 'total': 8192, - 'allocation_ratio': 1.5, + 'allocation_ratio': 1.0, 'max_unit': 8192, 'min_unit': 1, 'reserved': 512, @@ -90,7 +90,7 @@ class ProviderTreeTests(integrated_helpers.ProviderUsageBaseTestCase): }, 'VCPU': { 'total': 10, - 'allocation_ratio': 16.0, + 'allocation_ratio': 4.0, 'max_unit': 10, 'min_unit': 1, 'reserved': 0, diff --git a/nova/tests/unit/objects/test_compute_node.py b/nova/tests/unit/objects/test_compute_node.py index 1964117fd6df..7e6894a1cc49 100644 --- a/nova/tests/unit/objects/test_compute_node.py +++ b/nova/tests/unit/objects/test_compute_node.py @@ -666,8 +666,8 @@ class _TestComputeNodeObject(object): CONF.initial_disk_allocation_ratio, compute.disk_allocation_ratio) mock_update.assert_called_once_with( - self.context, 123, {'cpu_allocation_ratio': 16.0, - 'ram_allocation_ratio': 1.5, + self.context, 123, {'cpu_allocation_ratio': 4.0, + 'ram_allocation_ratio': 1.0, 'disk_allocation_ratio': 1.0}) @mock.patch('nova.db.main.api.compute_node_update') @@ -694,8 +694,8 @@ class _TestComputeNodeObject(object): CONF.initial_disk_allocation_ratio, compute.disk_allocation_ratio) mock_update.assert_called_once_with( - self.context, 123, {'cpu_allocation_ratio': 16.0, - 'ram_allocation_ratio': 1.5, + self.context, 123, {'cpu_allocation_ratio': 4.0, + 'ram_allocation_ratio': 1.0, 'disk_allocation_ratio': 1.0}) @mock.patch('nova.db.main.api.compute_node_update') @@ -722,8 +722,8 @@ class _TestComputeNodeObject(object): CONF.initial_disk_allocation_ratio, compute.disk_allocation_ratio) mock_update.assert_called_once_with( - self.context, 123, {'cpu_allocation_ratio': 16.0, - 'ram_allocation_ratio': 1.5, + self.context, 123, {'cpu_allocation_ratio': 4.0, + 'ram_allocation_ratio': 1.0, 'disk_allocation_ratio': 1.0}) def test_get_all_by_not_mapped(self): diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 86e3661a3432..fee87d3bb5ac 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -21366,7 +21366,7 @@ class TestUpdateProviderTree(test.NoDBTestCase): 'min_unit': 1, 'max_unit': self.vcpus, 'step_size': 1, - 'allocation_ratio': 16.0, + 'allocation_ratio': 4.0, 'reserved': 0, }, orc.PCPU: { @@ -21382,7 +21382,7 @@ class TestUpdateProviderTree(test.NoDBTestCase): 'min_unit': 1, 'max_unit': self.memory_mb, 'step_size': 1, - 'allocation_ratio': 1.5, + 'allocation_ratio': 1.0, 'reserved': 512, }, orc.DISK_GB: { diff --git a/nova/tests/unit/virt/vmwareapi/test_driver_api.py b/nova/tests/unit/virt/vmwareapi/test_driver_api.py index e2a321b50b0f..ac473c8c098a 100644 --- a/nova/tests/unit/virt/vmwareapi/test_driver_api.py +++ b/nova/tests/unit/virt/vmwareapi/test_driver_api.py @@ -2123,7 +2123,7 @@ class VMwareAPIVMTestCase(test.NoDBTestCase, 'min_unit': 1, 'max_unit': 16, 'step_size': 1, - 'allocation_ratio': 16.0, + 'allocation_ratio': 4.0, }, orc.MEMORY_MB: { 'total': 2048, @@ -2131,7 +2131,7 @@ class VMwareAPIVMTestCase(test.NoDBTestCase, 'min_unit': 1, 'max_unit': 1024, 'step_size': 1, - 'allocation_ratio': 1.5, + 'allocation_ratio': 1.0, }, orc.DISK_GB: { 'total': 95, diff --git a/releasenotes/notes/update-initial-allocation-defaults-94106033b66b8fa0.yaml b/releasenotes/notes/update-initial-allocation-defaults-94106033b66b8fa0.yaml new file mode 100644 index 000000000000..937c8d1c8a28 --- /dev/null +++ b/releasenotes/notes/update-initial-allocation-defaults-94106033b66b8fa0.yaml @@ -0,0 +1,21 @@ +--- +upgrade: + - | + In this release the default values for the initial ram and cpu allocation + ratios have been updated to 1.0 and 4.0 respectively. This will not + affect any existing compute node resource providers but the new default + will take effect on the creation of new resource providers. +other: + - | + The default initial allocation ratios enabled ram over commit by default + with a factor of ``1.5``. This value was chosen early in nova's history + as the predominant workload was web hosting or other light weight + virtualization. Similarly the default initial cpu allocation ratio + defaulted to 16. As more demanding workload from telco, enterprise, + scientific and governmental users became the norm the initial values we + had chosen became less and less correct overtime. These have now been + updated to reflect a more reasonable default for the majority of our users. + As of this release the initial ram allocation value is 1.0 disabling + overcommit by default for new compute nodes and the initial cpu allocation + ratio is now 4.0 which is a more reasonable overcommit for non idle + workloads.