注:以82574網(wǎng)卡
為例,透?jìng)鹘o虛擬機(jī),controller
節(jié)點(diǎn)是192.168.0.201
,compute
節(jié)點(diǎn)是192.168.0.202
查看
- 查看
PCI
lspci -nn
- 查看設(shè)備由什么驅(qū)動(dòng)管理使用
lspci -vv -s 04:00.0 | grep driver
- 通過(guò)
libvirt
解綁網(wǎng)卡(實(shí)際上不需要)
注:實(shí)際上不需要蜂林,因?yàn)?code>openstack啟動(dòng)使用這個(gè)網(wǎng)卡的
虛擬機(jī)
后會(huì)自動(dòng)把網(wǎng)卡的使用者轉(zhuǎn)為vfio-pci
,關(guān)閉虛擬機(jī)后會(huì)自動(dòng)轉(zhuǎn)回e1000e
- 查看
virsh nodedev-list | grep pci
- 查詢(xún)?cè)敿?xì)信息
virsh nodedev-dumpxml pci_0000_04_00_0
- 解綁
virsh nodedev-detach pci_0000_04_00_0
- 配置(
compute
節(jié)點(diǎn))
- 獲取
vendor_id
product_id
lspci -nn
或virsh nodedev-dumpxml pci_0000_04_00_0
vendor_id=8086
product_id=10d3
- 配置
vi /etc/nova/nova.conf
[pci] ... passthrough_whitelist = [{"product_id":"10d3", "vendor_id":"8086"}]
- 配置(
controller
節(jié)點(diǎn))
- 配置
nova-scheduler
vi /etc/nova/nova.conf
[DEFAULT] ... scheduler_default_filters = RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter scheduler_available_filters = nova.scheduler.filters.all_filters
配置
vi /etc/nova/nova.conf
[pci] ... alias = { "name": "a1", "product_id": "10d3", "vendor_id": "8086", "device_type": "type-PCI" }
- 重啟
systemctl restart openstack-nova-scheduler.service
systemctl restart openstack-nova-api.service
- 創(chuàng)建
flavor
和instance
- 創(chuàng)建
flavor
- 創(chuàng)建
instance
使用這個(gè)flavor
創(chuàng)建一個(gè)instance
- 驗(yàn)證
virsh dumpxml instance-0000001b
注意:請(qǐng)注意解綁
compute
節(jié)點(diǎn)的pci
設(shè)備
引用:
https://docs.openstack.org/nova/pike/admin/pci-passthrough.html
http://blog.csdn.net/hangdongzhang/article/details/77745557