From 422c2797b3502a5839c93b0b301a6903334ea075 Mon Sep 17 00:00:00 2001 From: Timothy Kuhlman Date: Tue, 24 May 2016 16:51:25 -0600 Subject: [PATCH] Add support for SR-IOV enablement via neutron-api The neutron-api charm will present an 'enable-sriov' flag to the nova-cloud-controller charm when SR-IOV support has been enabled by the end user; ensure that the PciPassthroughFilter is added to the filter chain when SR-IOV is enabled, so that instances with SR-IOV device assignments are scheduled to the correct compute hosts. Change-Id: Iffa77abf22823ce37999ea08f943ce5eeb6af492 --- hooks/nova_cc_context.py | 2 ++ templates/kilo/nova.conf | 4 ++++ templates/liberty/nova.conf | 4 ++++ templates/mitaka/nova.conf | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/hooks/nova_cc_context.py b/hooks/nova_cc_context.py index a54e1e7c..e38fc859 100644 --- a/hooks/nova_cc_context.py +++ b/hooks/nova_cc_context.py @@ -102,6 +102,8 @@ class NeutronAPIContext(context.OSContextGenerator): rdata.get('neutron-security-groups'), 'network_manager': 'neutron', } + if rdata.get('enable-sriov'): + ctxt['additional_neutron_filters'] = 'PciPassthroughFilter' if context_complete(ctxt): return ctxt return {} diff --git a/templates/kilo/nova.conf b/templates/kilo/nova.conf index f0a2b32d..56b586f8 100644 --- a/templates/kilo/nova.conf +++ b/templates/kilo/nova.conf @@ -30,7 +30,11 @@ ec2_listen = {{ bind_host }} osapi_compute_workers = {{ workers }} ec2_workers = {{ workers }} +{% if additional_neutron_filters is defined %} +scheduler_default_filters = {{ scheduler_default_filters }},{{ additional_neutron_filters }} +{% else %} scheduler_default_filters = {{ scheduler_default_filters }} +{% endif %} cpu_allocation_ratio = {{ cpu_allocation_ratio }} ram_allocation_ratio = {{ ram_allocation_ratio }} diff --git a/templates/liberty/nova.conf b/templates/liberty/nova.conf index f3847203..646c1261 100644 --- a/templates/liberty/nova.conf +++ b/templates/liberty/nova.conf @@ -30,7 +30,11 @@ ec2_listen = {{ bind_host }} osapi_compute_workers = {{ workers }} ec2_workers = {{ workers }} +{% if additional_neutron_filters is defined %} +scheduler_default_filters = {{ scheduler_default_filters }},{{ additional_neutron_filters }} +{% else %} scheduler_default_filters = {{ scheduler_default_filters }} +{% endif %} cpu_allocation_ratio = {{ cpu_allocation_ratio }} ram_allocation_ratio = {{ ram_allocation_ratio }} diff --git a/templates/mitaka/nova.conf b/templates/mitaka/nova.conf index d9440d62..b1fb99ca 100644 --- a/templates/mitaka/nova.conf +++ b/templates/mitaka/nova.conf @@ -27,7 +27,11 @@ s3_listen = {{ bind_host }} osapi_compute_workers = {{ workers }} +{% if additional_neutron_filters is defined %} +scheduler_default_filters = {{ scheduler_default_filters }},{{ additional_neutron_filters }} +{% else %} scheduler_default_filters = {{ scheduler_default_filters }} +{% endif %} cpu_allocation_ratio = {{ cpu_allocation_ratio }} ram_allocation_ratio = {{ ram_allocation_ratio }}