From 8368c5da0aff2b201fe8b08ed854dc2fd1a6e421 Mon Sep 17 00:00:00 2001 From: Elena Ezhova Date: Wed, 1 Mar 2017 20:39:25 +0400 Subject: [PATCH] Add SR-IOV support This change adds options needed for configuting SR-IOV on the Nova side. Change-Id: I022391828c3fe15d4ed9dc4dbdc28ce8e91ca71f --- service/files/defaults.yaml | 3 +++ service/files/nova.conf.j2 | 15 +++++++++++++++ service/nova-libvirt.yaml | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/service/files/defaults.yaml b/service/files/defaults.yaml index 4b51769..2e305b9 100644 --- a/service/files/defaults.yaml +++ b/service/files/defaults.yaml @@ -38,6 +38,9 @@ configs: disk: 0.0 ram: 0.0 + sriov: + enabled: false + ceph: enable: false pool_name: "vms" diff --git a/service/files/nova.conf.j2 b/service/files/nova.conf.j2 index 205e1ad..cf01067 100644 --- a/service/files/nova.conf.j2 +++ b/service/files/nova.conf.j2 @@ -51,6 +51,21 @@ my_ip = {{ network_topology["private"]["address"] }} secure_proxy_ssl_header = HTTP_X_FORWARDED_PROTO {% endif %} +{% if nova.sriov.enabled %} +{% if nova.sriov.pci_alias %} +pci_alias = [ +{%- for alias in nova.sriov.pci_alias -%} +{%- if not loop.first %},{% endif -%} +{"name": "{{ alias.name }}", "product_id": "{{ alias.product_id }}", vendor_id": "{{ alias.vendor_id }}"} +{%- endfor %}] +{% endif %} +pci_passthrough_whitelist = [ +{%- for pci_dev in nova.sriov.pci_passthrough_whitelist -%} +{%- if not loop.first %},{% endif -%} +{"devname": "{{ pci_dev.devname }}", "physical_network": "{{ pci_dev.physical_network }}"} +{%- endfor %}] +{% endif %} + {% if nova.console == 'novnc' %} [vnc] {% if nova.tls.enabled %} diff --git a/service/nova-libvirt.yaml b/service/nova-libvirt.yaml index fbe4f5e..b8d1418 100644 --- a/service/nova-libvirt.yaml +++ b/service/nova-libvirt.yaml @@ -27,6 +27,11 @@ service: - name: cgroup type: host path: /sys/fs/cgroup + # {% if nova.sriov.enabled %} + - name: dev + type: host + path: /dev + # {% endif %} pre: - name: nova-libvirt-bootstrap command: /tmp/nova-libvirt-bootstrap.sh