SR-IOV特性:能减少宿主机的CPU使用率,需要物理网卡支持该功能,并且有的主板需要开启VT-d功能,有的主板有单独的开启开关,如下图Dell R630
文章目录
基础环境准备:物理网卡:intel I350 ,系统环境:centos7.5
基础环境验证,是否支持SR-IOV
查看物理网卡是否支持SR-IOV(单根虚拟化),说明支持SR-IOV (lspci -vv 查看更为明细的内容,关注网卡方面的即可)
[root@localhost ~]# lspci -v| grep SR-IOV
Capabilities: [160] Single Root I/O Virtualization (SR-IOV)
Capabilities: [160] Single Root I/O Virtualization (SR-IOV)
查看当前内核
[root@localhost ~]# uname -r
3.10.0-862.el7.x86_64
实施SR-IOV
#第一:开启IOMMUO功能,添加 intel_iommu=on
[root@localhost ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on"
GRUB_DISABLE_RECOVERY="true"
#第二:确认驱动类型(igb),创建该文件,并指定虚拟vf的数量为4
#先确定是那种类型的驱动(igb,e100e,ixgb)
[root@localhost ~]# ethtool -i enp3s0f1
driver: igb
version: 5.4.0-k
firmware-version: 1.63, 0x800009fa
expansion-rom-version:
bus-info: 0000:03:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
#您可以查看某个物理网卡支持多少VF "lspci -vv" 这个命令可以看
[root@localhost ~]# cat /etc/modprobe.d/igb.conf
options igb max_vfs=4
#第三:重新生成grub
/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
#第四:升级内核
yum update kernel -y
#第五:重载igb驱动,并重启系统
modprobe -r igb && reboot
#第六:验证是否生效,下图表示网卡vf已经生效
centos6如何实现SR-IOV
#第一:在grub文件里的kernel行里增加“intel_iommu=on”
[root@localhost ~]# cat /boot/grub/grub.conf | grep intel_iommu=on
kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet intel_iommu=on
#第二:指定需要创建的vf数量(该文件需要主动创建)
[root@localhost ~]# cat /etc/modprobe.d/igb.conf
options igb max_vfs=4
#第三:重启系统
#第四:验证,说明已经创建成功
[root@localhost ~]# lspci | grep Et
03:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
03:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
03:10.0 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:10.1 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:10.4 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:10.5 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:11.0 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:11.1 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:11.4 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
03:11.5 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
诺基亚项目中NFV的配置参考_NOKIA_20VSR安装配置手册_v1.0_2020160605
如果文章对你有帮助,欢迎点击上方按钮打赏作者
暂无评论