diff --git a/defaults/main.yml b/defaults/main.yml index 32410a36..22f19f90 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -632,3 +632,9 @@ lxd_storage_backend: dir # Example: # nova_pci_passthrough_whitelist: '{ "physical_network": "physnet1", "devname": "p1p1" }' nova_pci_passthrough_whitelist: {} +# PCI alias, +# Example: +# nova_pci_alias: +# - '{ "name": "card-alias1", "product_id": "XXXX", "vendor_id": "XXXX" }' +# - '{ "name": "card-alias2", "product_id": "XXXY", "vendor_id": "XXXY" }' +nova_pci_alias: [] diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index b9da8018..7b17f75b 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -346,8 +346,16 @@ compute=auto enabled_vgpu_types = {{ enabled_vgpu_types | join(',') }} {% endif %} -{% if nova_pci_passthrough_whitelist %} +{% if nova_pci_passthrough_whitelist or nova_pci_alias %} [pci] +{% if nova_pci_passthrough_whitelist %} # White list of PCI devices available to VMs. passthrough_whitelist = "{{ nova_pci_passthrough_whitelist }}" {% endif %} +{% if nova_pci_alias %} +# PCI Alias +{% for item in nova_pci_alias %} +alias = "{{item}}" +{% endfor %} +{% endif %} +{% endif %}