summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hope-Morley <edward.hope-morley@canonical.com>2017-10-23 12:11:35 +0100
committerEdward Hope-Morley <edward.hope-morley@canonical.com>2017-10-23 12:11:35 +0100
commitaf5a4ec747992ba2ce2b19124ae681d9a6d9ffa1 (patch)
tree1db6fc72f51555efd78a359e5602c8181c2cb28d
parent5b85e562f40ccf4748c07658b2b963150233b86d (diff)
Add disk-allocation-ration config option
We already support configuring ram and cpu overcommit so this patch adds the ability to control disk overcommit. Change-Id: Ib172e8b48cb34de4beb9cec1a277dc43ded36eed Closes-Bug: 1726346
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+1: James Page <james.page@canonical.com> Code-Review+2: Edward Hope-Morley <edward.hope-morley@canonical.com> Workflow+1: Edward Hope-Morley <edward.hope-morley@canonical.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 24 Oct 2017 22:45:27 +0000 Reviewed-on: https://review.openstack.org/514259 Project: openstack/charm-nova-cloud-controller Branch: refs/heads/master
-rw-r--r--config.yaml8
-rw-r--r--hooks/nova_cc_context.py2
-rw-r--r--templates/icehouse/nova.conf1
-rw-r--r--templates/juno/nova.conf1
-rw-r--r--templates/kilo/nova.conf1
-rw-r--r--templates/liberty/nova.conf1
-rw-r--r--templates/mitaka/nova.conf1
-rw-r--r--templates/ocata/nova.conf1
-rw-r--r--unit_tests/test_nova_cc_contexts.py2
9 files changed, 18 insertions, 0 deletions
diff --git a/config.yaml b/config.yaml
index 965c25d..f1e5ac4 100644
--- a/config.yaml
+++ b/config.yaml
@@ -234,6 +234,14 @@ options:
234 . 234 .
235 Increasing this value will increase instance density on compute nodes 235 Increasing this value will increase instance density on compute nodes
236 at the potential expense of instance performance. 236 at the potential expense of instance performance.
237 disk-allocation-ratio:
238 type: float
239 default: 0.0
240 description: |
241 Increase the amount of disk space that nova can overcommit to guests.
242 .
243 Increasing this value will increase instance density on compute nodes
244 with an increased risk of hypervisor storage becoming full.
237 single-nova-consoleauth: 245 single-nova-consoleauth:
238 type: boolean 246 type: boolean
239 default: true 247 default: true
diff --git a/hooks/nova_cc_context.py b/hooks/nova_cc_context.py
index 1824051..631ba40 100644
--- a/hooks/nova_cc_context.py
+++ b/hooks/nova_cc_context.py
@@ -282,6 +282,8 @@ class NovaConfigContext(context.WorkerConfigContext):
282 ctxt['scheduler_default_filters'] = config('scheduler-default-filters') 282 ctxt['scheduler_default_filters'] = config('scheduler-default-filters')
283 if config('pci-alias'): 283 if config('pci-alias'):
284 ctxt['pci_alias'] = config('pci-alias') 284 ctxt['pci_alias'] = config('pci-alias')
285
286 ctxt['disk_allocation_ratio'] = config('disk-allocation-ratio')
285 ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio') 287 ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio')
286 ctxt['ram_allocation_ratio'] = config('ram-allocation-ratio') 288 ctxt['ram_allocation_ratio'] = config('ram-allocation-ratio')
287 addr = resolve_address(INTERNAL) 289 addr = resolve_address(INTERNAL)
diff --git a/templates/icehouse/nova.conf b/templates/icehouse/nova.conf
index 196367c..3ffa0ce 100644
--- a/templates/icehouse/nova.conf
+++ b/templates/icehouse/nova.conf
@@ -34,6 +34,7 @@ ec2_workers = {{ workers }}
34scheduler_default_filters = {{ scheduler_default_filters }} 34scheduler_default_filters = {{ scheduler_default_filters }}
35cpu_allocation_ratio = {{ cpu_allocation_ratio }} 35cpu_allocation_ratio = {{ cpu_allocation_ratio }}
36ram_allocation_ratio = {{ ram_allocation_ratio }} 36ram_allocation_ratio = {{ ram_allocation_ratio }}
37disk_allocation_ratio = {{ disk_allocation_ratio }}
37 38
38use_syslog={{ use_syslog }} 39use_syslog={{ use_syslog }}
39my_ip = {{ host_ip }} 40my_ip = {{ host_ip }}
diff --git a/templates/juno/nova.conf b/templates/juno/nova.conf
index 22d6b48..cae921e 100644
--- a/templates/juno/nova.conf
+++ b/templates/juno/nova.conf
@@ -34,6 +34,7 @@ ec2_workers = {{ workers }}
34scheduler_default_filters = {{ scheduler_default_filters }} 34scheduler_default_filters = {{ scheduler_default_filters }}
35cpu_allocation_ratio = {{ cpu_allocation_ratio }} 35cpu_allocation_ratio = {{ cpu_allocation_ratio }}
36ram_allocation_ratio = {{ ram_allocation_ratio }} 36ram_allocation_ratio = {{ ram_allocation_ratio }}
37disk_allocation_ratio = {{ disk_allocation_ratio }}
37 38
38use_syslog={{ use_syslog }} 39use_syslog={{ use_syslog }}
39my_ip = {{ host_ip }} 40my_ip = {{ host_ip }}
diff --git a/templates/kilo/nova.conf b/templates/kilo/nova.conf
index 5b0c7bf..5ef9fb7 100644
--- a/templates/kilo/nova.conf
+++ b/templates/kilo/nova.conf
@@ -40,6 +40,7 @@ pci_alias = {{ pci_alias }}
40{% endif %} 40{% endif %}
41cpu_allocation_ratio = {{ cpu_allocation_ratio }} 41cpu_allocation_ratio = {{ cpu_allocation_ratio }}
42ram_allocation_ratio = {{ ram_allocation_ratio }} 42ram_allocation_ratio = {{ ram_allocation_ratio }}
43disk_allocation_ratio = {{ disk_allocation_ratio }}
43 44
44use_syslog={{ use_syslog }} 45use_syslog={{ use_syslog }}
45my_ip = {{ host_ip }} 46my_ip = {{ host_ip }}
diff --git a/templates/liberty/nova.conf b/templates/liberty/nova.conf
index 347946b..d06fc43 100644
--- a/templates/liberty/nova.conf
+++ b/templates/liberty/nova.conf
@@ -40,6 +40,7 @@ pci_alias = {{ pci_alias }}
40{% endif %} 40{% endif %}
41cpu_allocation_ratio = {{ cpu_allocation_ratio }} 41cpu_allocation_ratio = {{ cpu_allocation_ratio }}
42ram_allocation_ratio = {{ ram_allocation_ratio }} 42ram_allocation_ratio = {{ ram_allocation_ratio }}
43disk_allocation_ratio = {{ disk_allocation_ratio }}
43 44
44use_syslog={{ use_syslog }} 45use_syslog={{ use_syslog }}
45my_ip = {{ host_ip }} 46my_ip = {{ host_ip }}
diff --git a/templates/mitaka/nova.conf b/templates/mitaka/nova.conf
index 14ab0ac..1a57be5 100644
--- a/templates/mitaka/nova.conf
+++ b/templates/mitaka/nova.conf
@@ -37,6 +37,7 @@ pci_alias = {{ pci_alias }}
37{% endif %} 37{% endif %}
38cpu_allocation_ratio = {{ cpu_allocation_ratio }} 38cpu_allocation_ratio = {{ cpu_allocation_ratio }}
39ram_allocation_ratio = {{ ram_allocation_ratio }} 39ram_allocation_ratio = {{ ram_allocation_ratio }}
40disk_allocation_ratio = {{ disk_allocation_ratio }}
40 41
41use_syslog={{ use_syslog }} 42use_syslog={{ use_syslog }}
42my_ip = {{ host_ip }} 43my_ip = {{ host_ip }}
diff --git a/templates/ocata/nova.conf b/templates/ocata/nova.conf
index 1ac7843..5e8cc8a 100644
--- a/templates/ocata/nova.conf
+++ b/templates/ocata/nova.conf
@@ -30,6 +30,7 @@ osapi_compute_workers = {{ workers }}
30 30
31cpu_allocation_ratio = {{ cpu_allocation_ratio }} 31cpu_allocation_ratio = {{ cpu_allocation_ratio }}
32ram_allocation_ratio = {{ ram_allocation_ratio }} 32ram_allocation_ratio = {{ ram_allocation_ratio }}
33disk_allocation_ratio = {{ disk_allocation_ratio }}
33 34
34use_syslog={{ use_syslog }} 35use_syslog={{ use_syslog }}
35my_ip = {{ host_ip }} 36my_ip = {{ host_ip }}
diff --git a/unit_tests/test_nova_cc_contexts.py b/unit_tests/test_nova_cc_contexts.py
index 6d23c16..1e72930 100644
--- a/unit_tests/test_nova_cc_contexts.py
+++ b/unit_tests/test_nova_cc_contexts.py
@@ -312,6 +312,8 @@ class NovaComputeContextTests(CharmTestCase):
312 self.config('cpu-allocation-ratio')) 312 self.config('cpu-allocation-ratio'))
313 self.assertEqual(ctxt['ram_allocation_ratio'], 313 self.assertEqual(ctxt['ram_allocation_ratio'],
314 self.config('ram-allocation-ratio')) 314 self.config('ram-allocation-ratio'))
315 self.assertEqual(ctxt['disk_allocation_ratio'],
316 self.config('disk-allocation-ratio'))
315 317
316 @mock.patch.object(context, 'format_ipv6_addr') 318 @mock.patch.object(context, 'format_ipv6_addr')
317 @mock.patch.object(context, 'resolve_address') 319 @mock.patch.object(context, 'resolve_address')