Added the ability to configuring white list of PCI devices
Change-Id: I94e72ad9fe2aa6a9a687e916fea6314521b87002
Related-Prod: PROD-23161 (PROD:23161)
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..c3b59b4
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.mcp.mirantis.com
+port=29418
+project=salt-formulas/nova.git
diff --git a/README.rst b/README.rst
index 0943db2..f271647 100644
--- a/README.rst
+++ b/README.rst
@@ -368,6 +368,9 @@
name: "a1"
product_id: "154d"
vendor_id: "8086"
+ passthrough_whitelist:
+ - vendor_id: "10de"
+ product_id: "1db4"
network:
engine: neutron
host: 127.0.0.1
@@ -524,7 +527,7 @@
barbican:
enabled: true
-Define aliases for PCI devices:
+Define aliases for a PCI passthrough devices:
.. code-block:: yaml
nova:
@@ -538,6 +541,17 @@
product_id: "154d"
vendor_id: "8086"
+Define white list of PCI devices available to VMs:
+.. code-block:: yaml
+
+ nova:
+ compute:
+ ...
+ pci:
+ passthrough_whitelist:
+ - vendor_id: "10de"
+ product_id: "1db4"
+
Nova metadata custom bindings:
.. code-block:: yaml
diff --git a/nova/files/ocata/nova-compute.conf.Debian b/nova/files/ocata/nova-compute.conf.Debian
index 3cbfa92..6d6e28f 100644
--- a/nova/files/ocata/nova-compute.conf.Debian
+++ b/nova/files/ocata/nova-compute.conf.Debian
@@ -8356,6 +8356,13 @@
{%- endfor %}
{%- endif %}
+{%- if compute.get('pci', {}).get('passthrough_whitelist', false) %}
+ {%- for item in compute.pci.passthrough_whitelist %}
+passthrough_whitelist = {{ item | json }}
+ {%- endfor %}
+{%- endif %}
+
+
[placement]
#
diff --git a/nova/files/ocata/nova-controller.conf.Debian b/nova/files/ocata/nova-controller.conf.Debian
index 4474a13..5a1b5b1 100644
--- a/nova/files/ocata/nova-controller.conf.Debian
+++ b/nova/files/ocata/nova-controller.conf.Debian
@@ -8337,6 +8337,11 @@
# (multi valued)
# Deprecated group/name - [DEFAULT]/pci_passthrough_whitelist
#passthrough_whitelist =
+{%- if controller.get('pci', {}).get('passthrough_whitelist', false) %}
+ {%- for item in controller.pci.passthrough_whitelist %}
+passthrough_whitelist = {{ item | json }}
+ {%- endfor %}
+{%- endif %}
[placement]
diff --git a/nova/files/pike/nova-compute.conf.Debian b/nova/files/pike/nova-compute.conf.Debian
index b094ac6..41d83f6 100644
--- a/nova/files/pike/nova-compute.conf.Debian
+++ b/nova/files/pike/nova-compute.conf.Debian
@@ -8609,6 +8609,13 @@
{%- endfor %}
{%- endif %}
+{%- if compute.get('pci', {}).get('passthrough_whitelist', false) %}
+ {%- for item in compute.pci.passthrough_whitelist %}
+passthrough_whitelist = {{ item | json }}
+ {%- endfor %}
+{%- endif %}
+
+
[placement]
#
diff --git a/nova/files/pike/nova-controller.conf.Debian b/nova/files/pike/nova-controller.conf.Debian
index a95b8d2..e746ad5 100644
--- a/nova/files/pike/nova-controller.conf.Debian
+++ b/nova/files/pike/nova-controller.conf.Debian
@@ -8606,6 +8606,11 @@
# (multi valued)
# Deprecated group/name - [DEFAULT]/pci_passthrough_whitelist
#passthrough_whitelist =
+{%- if controller.get('pci', {}).get('passthrough_whitelist', false) %}
+ {%- for item in controller.pci.passthrough_whitelist %}
+passthrough_whitelist = {{ item | json }}
+ {%- endfor %}
+{%- endif %}
[placement]
diff --git a/nova/files/queens/nova-compute.conf.Debian b/nova/files/queens/nova-compute.conf.Debian
index 024263b..7bb5628 100644
--- a/nova/files/queens/nova-compute.conf.Debian
+++ b/nova/files/queens/nova-compute.conf.Debian
@@ -8278,6 +8278,13 @@
{%- endfor %}
{%- endif %}
+{%- if compute.get('pci', {}).get('passthrough_whitelist', false) %}
+ {%- for item in compute.pci.passthrough_whitelist %}
+passthrough_whitelist = {{ item | json }}
+ {%- endfor %}
+{%- endif %}
+
+
[placement]
#
diff --git a/nova/files/queens/nova-controller.conf.Debian b/nova/files/queens/nova-controller.conf.Debian
index 07b676c..134ceca 100644
--- a/nova/files/queens/nova-controller.conf.Debian
+++ b/nova/files/queens/nova-controller.conf.Debian
@@ -8165,6 +8165,13 @@
{%- endfor %}
{%- endif %}
+{%- if controller.get('pci', {}).get('passthrough_whitelist', false) %}
+ {%- for item in controller.pci.passthrough_whitelist %}
+passthrough_whitelist = {{ item | json }}
+ {%- endfor %}
+{%- endif %}
+
+
[placement]
{%- set _data = controller.identity %}