summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-10-07 02:29:22 +0000
committerGerrit Code Review <review@openstack.org>2022-10-07 02:29:22 +0000
commit03d2715ed492350fa11908aea0fdd0265993e284 (patch)
treee972b57fb3e7179d74a8ed67016fa4fbbd5a8aa3
parentdf8e0335fa978b952b580f37c301c0867f797508 (diff)
parent1260cdd49218f8bedf935190e2721422e5b5c6b6 (diff)
downloadnova-03d2715ed492350fa11908aea0fdd0265993e284.tar.gz
Merge "update default overcommit"
-rw-r--r--doc/source/admin/scheduling.rst10
-rw-r--r--nova/conf/compute.py4
-rw-r--r--nova/tests/functional/test_server_group.py5
-rw-r--r--nova/tests/functional/test_servers_provider_tree.py4
-rw-r--r--nova/tests/unit/objects/test_compute_node.py12
-rw-r--r--nova/tests/unit/virt/libvirt/test_driver.py4
-rw-r--r--nova/tests/unit/virt/vmwareapi/test_driver_api.py4
-rw-r--r--releasenotes/notes/update-initial-allocation-defaults-94106033b66b8fa0.yaml21
8 files changed, 49 insertions, 15 deletions
diff --git a/doc/source/admin/scheduling.rst b/doc/source/admin/scheduling.rst
index 3c2161fcf4..9071c92ac9 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 71707cfd53..224c802935 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 38804a671b..7cbe8bdb67 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 f48f91dc02..da562c4f19 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 1964117fd6..7e6894a1cc 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 86e3661a34..fee87d3bb5 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 e2a321b50b..ac473c8c09 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 0000000000..937c8d1c8a
--- /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.