Configure a Flavor to Use a Generic PCI Device¶
To provide VM access to a generic PCI passthrough device, you must use a flavor with an extra specification identifying the device PCI alias.
The Nova scheduler attempts to schedule the VM on a host containing the device. If no suitable compute node is available, the error No valid host was found is reported. If a suitable compute node is available, then the scheduler attempts to instantiate the VM in a NUMA node with direct access to the device, subject to the PCI NUMA Affinity extra specification.
When this extra spec is used, an eligible host NUMA node is required for each virtual NUMA node in the instance. If this requirement cannot be met, the instantiation fails.
You can use the OpenStack Horizon interface or the CLI to add a PCI alias extra specification. From the OpenStack Horizon interface, use the Custom Extra Spec selection in the Create Flavor Extra Spec drop-down menu. For the Key, use pci_passthrough:alias.
To edit the PCI alias for a QuickAssist-SR-IOV device, you can use the Update Flavor Metadata dialog box accessible from the Flavors page. This supports editing for a QuickAssist-SR-IOV PCI alias only. It cannot be used to edit the PCI Alias for GPU devices or multiple devices.
To access the Update Flavor Metadata dialog box, go to the Flavors page, open the Edit Flavor drop-down menu, and then select Update Metadata.
To be available for use by VMs, the device must be exposed, and it must also have a PCI alias. To expose a device, see Exposing a Generic PCI Device Using the CLI or Expose a Generic PCI Device for Use by VMs. To assign a PCI alias, see Configuring a PCI Alias in Nova
Use the openstack flavor set command to add the extra spec.
~(keystone_admin)$ openstack flavor set flavor_name --property "pci_passthrough:alias"="pci_alias[:number_of_devices]"
is the name of the flavor
is the PCI alias of the device
The parameter pci_passthrough:alias is used for both PCI passthrough devices and SR-IOV devices.
Depending on the device type, the following default PCI alias options are available:
Exposes an Intel AV-ICE02 VPN Acceleration Card for SR-IOV access. For more information, see SR-IOV Encryption Acceleration.
The following device specific options are available for qat-vf:
Due to driver limitations, PCI passthrough access for the Intel AV-ICE02 VPN Acceleration Card (qat-pf option) is not supported.
On a system with multiple cards that use the same default PCI alias, you must assign and use a unique PCI alias for each one.
is the number of SR-IOV or PCI passthrough devices to expose to the VM
For example, to make two QuickAssist SR-IOV devices available to a guest:
~(keystone_admin)$ openstack flavor set <flavor_name> --property "pci_passthrough:alias"="qat-dh895xcc-vf:2"
To make multiple PCI devices available, use the following command:
~(keystone_admin)$ openstack flavor set flavor_name --property "pci_passthrough:alias"="gpu:1, qat-c62x-vf:2"