|
|
(24 intermediate revisions by 6 users not shown) |
Line 1: |
Line 1: |
− | PCI passthrough support enables assigning a PCI device to an instance in openstack.
| + | '''Please refer to the [http://docs.openstack.org/admin-guide/compute-pci-passthrough.html documentation] for the latest information.''' |
| | | |
− | == Where to get the code: ==
| + | '''Please check https://wiki.openstack.org/wiki/SR-IOV-Passthrough-For-Networking for SR-IOV NIC pass-through''' |
− | | |
− | Currently all the core functionality is merged into nova upstream. With this support, it's ok to create instances with devices assignment.
| |
− | | |
− | However, the API support is still not pushed out, because of time reason. Draft patches for both nova-client and nova is available at https://github.com/yjiang5/pci_api.git .
| |
− | | |
− | We will submit the patch once the tree is open again.
| |
− | | |
− | == How to prepare the environment ==
| |
− | | |
− | 1. Configure the nova
| |
− | Compute node:
| |
− | pci_passthrough_whitelist: White list of PCI devices available to VMs.
| |
− | | |
− | For example:
| |
− | pci_passthrough_whitelist=[{ "vendor_id":"8086","product_id":"1520"}] defines all PCI devices in the platform with vendor_id as 0x8086 and product_id as 0x1520 will be assignable to the instances.
| |
− | | |
− | Controller node:
| |
− | pci_alias: An alias for a PCI passthrough device requirement.
| |
− | For example:
| |
− | pci_alias={"vendor_id":"8086", "product_id":"1520", "name":"a1"} defines pci alias 'a1' to present a request for PCI devices with vendor_id as 0x8086 and product_id as 0x1520.
| |
− | | |
− | 2. Create a flavor
| |
− | Configure a flavor that request pci devices. For example:
| |
− | nova flavor-key m1.large set "pci_passthrough:alias"="a1:2"
| |
− | | |
− | update a flavor that requires two PCI devices, each with vendor_id as '0x8086' and product_id as '0x1520'.
| |
− | | |
− | | |
− | 3. create a VM
| |
− | nova boot --image new1 --key_name test --flavor m1.large 123
| |
− | | |
− | the image is the image contains the driver to the assigned devices, the 'test' is the key pair.
| |
− | | |
− | 4. 'nova show 123' to check VM status till it's become active.
| |
− | | |
− | 5. nova ssh --private 123 -i test.pem to login into the guest, 'lspci' will show you all the devices.
| |
− | | |
− | | |
− | == How to check PCI status with PCI api paches ===
| |
− | nova pci-list node_id will show all PCI devices on a compute node with node_id as the id. Use 'nova hypervisor-list' to get all compue_node in the system.
| |
− | | |
− | nova list will get the pci assignment to a instance, the 'os-pci:pci' contains the id of the PCI device.
| |
− | | |
− | nova pci-show id shows the details of a PCI device.
| |