From 89554fc29efaf848cbc2c26074d0bfd548902c84 Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Tue, 31 Mar 2015 14:22:53 +0100 Subject: [PATCH] Fixes broken rev 112 by using /etc/init.d/libvirt-bin.override instead of /etc/default/libvirt-bin --- hooks/nova_compute_context.py | 10 ++++++++++ hooks/nova_compute_utils.py | 6 ++++++ templates/libvirt-bin | 3 --- templates/libvirt-bin.override | 3 +++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 templates/libvirt-bin.override diff --git a/hooks/nova_compute_context.py b/hooks/nova_compute_context.py index 83c7b33f..5281cddd 100644 --- a/hooks/nova_compute_context.py +++ b/hooks/nova_compute_context.py @@ -128,6 +128,16 @@ class NovaComputeLibvirtContext(context.OSContextGenerator): return ctxt +class NovaComputeLibvirtOverrideContext(context.OSContextGenerator): + """Provides overrides to the libvirt-bin service""" + interfaces = [] + + def __call__(self): + ctxt = {} + ctxt['overrides'] = "limit nofile 65535 65535" + return ctxt + + class NovaComputeVirtContext(context.OSContextGenerator): interfaces = [] diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index ea20274a..06bdf57c 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -41,6 +41,7 @@ from nova_compute_context import ( CloudComputeContext, MetadataServiceContext, NovaComputeLibvirtContext, + NovaComputeLibvirtOverrideContext, NovaComputeCephContext, NeutronComputeContext, InstanceConsoleContext, @@ -63,6 +64,7 @@ NOVA_CONF_DIR = "/etc/nova" QEMU_CONF = '/etc/libvirt/qemu.conf' LIBVIRTD_CONF = '/etc/libvirt/libvirtd.conf' LIBVIRT_BIN = '/etc/default/libvirt-bin' +LIBVIRT_BIN_OVERRIDES = '/etc/init/libvirt-bin.override' NOVA_CONF = '%s/nova.conf' % NOVA_CONF_DIR BASE_RESOURCE_MAP = { @@ -78,6 +80,10 @@ BASE_RESOURCE_MAP = { 'services': ['libvirt-bin'], 'contexts': [NovaComputeLibvirtContext()], }, + LIBVIRT_BIN_OVERRIDES: { + 'services': ['libvirt-bin'], + 'contexts': [NovaComputeLibvirtOverrideContext()], + }, NOVA_CONF: { 'services': ['nova-compute'], 'contexts': [context.AMQPContext(ssl_dir=NOVA_CONF_DIR), diff --git a/templates/libvirt-bin b/templates/libvirt-bin index ddaf2677..9e65b261 100644 --- a/templates/libvirt-bin +++ b/templates/libvirt-bin @@ -14,6 +14,3 @@ libvirtd_opts="{{ libvirtd_opts }}" # pass in location of kerberos keytab #export KRB5_KTNAME=/etc/libvirt/libvirt.keytab - -# Increase nofile limits to support use with ceph rbd volumes -limit nofile 65535 65535 diff --git a/templates/libvirt-bin.override b/templates/libvirt-bin.override new file mode 100644 index 00000000..d29009c5 --- /dev/null +++ b/templates/libvirt-bin.override @@ -0,0 +1,3 @@ +{% if overrides -%} +{{ overrides }} +{% endif -%}