Replace the ocata config-reference URLs with URLs in each project repo. Change-Id: I48d7c77a6e0eaaf0efe66f848f45ae99007577e1 Closes-Bug: #1715545
4.8 KiB
Attaching physical PCI devices to guests
The PCI passthrough feature in OpenStack allows full access and direct control of a physical PCI device in guests. This mechanism is generic for any kind of PCI device, and runs with a Network Interface Card (NIC), Graphics Processing Unit (GPU), or any other devices that can be attached to a PCI bus. Correct driver installation is the only requirement for the guest to properly use the devices.
Some PCI devices provide Single Root I/O Virtualization and Sharing (SR-IOV) capabilities. When SR-IOV is used, a physical device is virtualized and appears as multiple PCI devices. Virtual PCI devices are assigned to the same or different guests. In the case of PCI passthrough, the full physical device is assigned to only one guest and cannot be shared.
Note
For information on attaching virtual SR-IOV devices to guests, refer to the Networking Guide.
To enable PCI passthrough, follow the steps below:
- Configure nova-scheduler (Controller)
- Configure nova-api (Controller)**
- Configure a flavor (Controller)
- Enable PCI passthrough (Compute)
- Configure PCI devices in nova-compute (Compute)
Note
The PCI device with address 0000:41:00.0 is used as an
example. This will differ between environments.
Configure nova-scheduler (Controller)
- Configure
nova-scheduleras specified in Configure nova-scheduler. - Restart the
nova-schedulerservice.
Configure nova-api (Controller)
Specify the PCI alias for the device.
Configure a PCI alias
a1to request a PCI device with avendor_idof0x8086and aproduct_idof0x154d. Thevendor_idandproduct_idcorrespond the PCI device with address0000:41:00.0.Edit
/etc/nova/nova.conf:[pci] alias = { "vendor_id":"8086", "product_id":"154d", "device_type":"type-PF", "name":"a1" }For more information about the syntax of
alias, refer to/configuration/config.Restart the
nova-apiservice.
Configure a flavor (Controller)
Configure a flavor to request two PCI devices, each with
vendor_id of 0x8086 and
product_id of 0x154d:
# openstack flavor set m1.large --property "pci_passthrough:alias"="a1:2"
For more information about the syntax for
pci_passthrough:alias, refer to /admin/flavors.
Enable PCI passthrough (Compute)
Enable VT-d and IOMMU. For more information, refer to steps one and two in Create Virtual Functions.
Configure PCI devices (Compute)
Configure
nova-computeto allow the PCI device to pass through to VMs. Edit/etc/nova/nova.conf:[pci] passthrough_whitelist = { "address": "0000:41:00.0" }Alternatively specify multiple PCI devices using whitelisting:
[pci] passthrough_whitelist = { "vendor_id": "8086", "product_id": "10fb" }All PCI devices matching the
vendor_idandproduct_idare added to the pool of PCI devices available for passthrough to VMs.For more information about the syntax of
passthrough_whitelist, refer to/configuration/config.Specify the PCI alias for the device.
From the Newton release, to resize guest with PCI device, configure the PCI alias on the compute node as well.
Configure a PCI alias
a1to request a PCI device with avendor_idof0x8086and aproduct_idof0x154d. Thevendor_idandproduct_idcorrespond the PCI device with address0000:41:00.0.Edit
/etc/nova/nova.conf:[pci] alias = { "vendor_id":"8086", "product_id":"154d", "device_type":"type-PF", "name":"a1" }For more information about the syntax of
alias, refer to/configuration/config.Restart the
nova-computeservice.
Create instances with PCI passthrough devices
The nova-scheduler selects a destination host that has
PCI devices available with the specified vendor_id and
product_id that matches the alias from the
flavor.
# openstack server create --flavor m1.large --image cirros-0.3.5-x86_64-uec --wait test-pci