Merge "Expose max_local_block_devices as an explicit charm option"

This commit is contained in:
Zuul 2022-03-11 08:41:05 +00:00 committed by Gerrit Code Review
commit f55776445f
13 changed files with 53 additions and 0 deletions

View File

@ -781,3 +781,12 @@ options:
Allow resizing to the same host. Setting this option to True will add the
source host to the destination options for consideration by the
scheduler when resizing an instance.
max-local-block-devices:
type: int
default:
description: |
Maximum number of local devices which can be attached to an
instance. Possible values are 0: Creating a local disk is not
allowed and letting the request fail, Negative number: Allows
unlimited number of local devices, Positive number: Allows only
these many number of local devices.

View File

@ -451,6 +451,8 @@ class NovaConfigContext(ch_context.WorkerConfigContext):
'placement-aggregate-required-for-tenants')
ctxt['enable_isolated_aggregate_filtering'] = hookenv.config(
'enable-isolated-aggregate-filtering')
ctxt['max_local_block_devices'] = hookenv.config(
'max-local-block-devices')
return ctxt

View File

@ -93,6 +93,10 @@ keystone_ec2_url = {{ keystone_ec2_url }}
glance_api_servers = {{ glance_api_servers }}
{% endif -%}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -99,6 +99,10 @@ keystone_ec2_url = {{ keystone_ec2_url }}
glance_api_servers = {{ glance_api_servers }}
{% endif -%}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -99,6 +99,10 @@ memcached_servers = {{ memcached_servers }}
keystone_ec2_url = {{ keystone_ec2_url }}
{% endif -%}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -102,6 +102,10 @@ memcached_servers = {{ memcached_servers }}
keystone_ec2_url = {{ keystone_ec2_url }}
{% endif -%}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -87,6 +87,10 @@ quota_server_group_members = {{ quota_server_group_members }}
{% include "parts/novnc" %}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -90,6 +90,10 @@ quota_server_group_members = {{ quota_server_group_members }}
{% include "parts/novnc" %}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -47,6 +47,10 @@ my_ip = {{ host_ip }}
{% include "parts/novnc" %}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -52,6 +52,10 @@ my_ip = {{ host_ip }}
{% include "parts/novnc" %}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -52,6 +52,10 @@ my_ip = {{ host_ip }}
{% include "parts/novnc" %}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -52,6 +52,10 @@ my_ip = {{ host_ip }}
{% include "parts/novnc" %}
{% if max_local_block_devices is not none -%}
max_local_block_devices = {{ max_local_block_devices }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}

View File

@ -404,6 +404,8 @@ class NovaComputeContextTests(CharmTestCase):
)
self.assertEqual(ctxt['enable_isolated_aggregate_filtering'],
self.config('enable-isolated-aggregate-filtering'))
self.assertEqual(ctxt['max_local_block_devices'],
self.config('max-local-block-devices'))
_pci_alias1 = {
"name": "IntelNIC",