[mthaddon,r=gnuoy] Allow for disk_cachemodes to be set via a config option
This commit is contained in:
@@ -56,6 +56,12 @@ options:
|
||||
default: "yes"
|
||||
type: string
|
||||
description: Whether to run nova-api and nova-network on the compute nodes.
|
||||
disk-cachemodes:
|
||||
default:
|
||||
type: string
|
||||
description: |
|
||||
Specific cachemodes to use for different disk types e.g:
|
||||
file=directsync,block=none
|
||||
enable-resize:
|
||||
default: False
|
||||
type: boolean
|
||||
|
||||
@@ -103,6 +103,9 @@ class NovaComputeLibvirtContext(context.OSContextGenerator):
|
||||
if config('instances-path') is not None:
|
||||
ctxt['instances_path'] = config('instances-path')
|
||||
|
||||
if config('disk-cachemodes'):
|
||||
ctxt['disk_cachemodes'] = config('disk-cachemodes')
|
||||
|
||||
return ctxt
|
||||
|
||||
|
||||
|
||||
@@ -114,3 +114,8 @@ keymap = {{ console_keymap }}
|
||||
server_listen = 0.0.0.0
|
||||
server_proxyclient_address = {{ console_listen_addr }}
|
||||
{% endif -%}
|
||||
|
||||
{% if disk_cachemodes -%}
|
||||
[libvirt]
|
||||
disk_cachemodes = {{ disk_cachemodes }}
|
||||
{% endif -%}
|
||||
|
||||
@@ -114,4 +114,6 @@ rbd_secret_uuid = {{ rbd_secret_uuid }}
|
||||
{% if live_migration_uri -%}
|
||||
live_migration_uri = {{ live_migration_uri }}
|
||||
{% endif -%}
|
||||
|
||||
{% if disk_cachemodes -%}
|
||||
disk_cachemodes = {{ disk_cachemodes }}
|
||||
{% endif -%}
|
||||
|
||||
@@ -181,6 +181,13 @@ class NovaComputeContextTests(CharmTestCase):
|
||||
self.assertEquals(
|
||||
{'libvirtd_opts': '-d -l', 'listen_tls': 0}, libvirt())
|
||||
|
||||
def test_libvirt_disk_cachemodes(self):
|
||||
self.test_config.set('disk-cachemodes', 'file=unsafe,block=none')
|
||||
libvirt = context.NovaComputeLibvirtContext()
|
||||
self.assertEquals(
|
||||
{'libvirtd_opts': '-d', 'listen_tls': 0,
|
||||
'disk_cachemodes': 'file=unsafe,block=none'}, libvirt())
|
||||
|
||||
@patch.object(context.NeutronComputeContext, 'network_manager')
|
||||
@patch.object(context.NeutronComputeContext, 'plugin')
|
||||
def test_disable_security_groups_true(self, plugin, nm):
|
||||
|
||||
Reference in New Issue
Block a user