Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 how to install ixgbevf on a Centos 7 instance?

Tags:

amazon-ec2

I'm trying to install the ixgbevf on a Amazon EC2 CentOS7 instance. The steps looks good, but everytime when I run the instance in a Enhanced Networking enabled type, such as M4.xlarge, the network seems fail(I can not connect to the instance after startup).

Here's what I did:

wget http://elrepo.org/linux/elrepo/el7/x86_64/RPMS/kmod-ixgbevf-2.16.1-1.el7.elrepo.x86_64.rpm
rpm -ivh kmod-ixgbevf-2.16.1-1.el7.elrepo.x86_64.rpm
cp -p /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
dracut -f

Then shutdown the instance, and set the sriov

ec2-modify-instance-attribute instance_id --sriov simple

That all. Whenever the type(such as T2.micro) doesn't support Enhanced Networking, the instance works fine. But if I change the type to Enhanced Networking enabled(such as M4.xlarge), the instance simply can't be accessed. Anyone have any idea about this? Did I miss something?

like image 967
khtwo Avatar asked Dec 15 '22 13:12

khtwo


1 Answers

The answer lies buried into this section of the original documentation:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enhanced-networking-linux

In a nutshell, CentOS 7 already ships with the ixgbevf module, although not with the latest version, but this is hardly a problem. What was causing my instance to be unreachable after a reboot were the "predictable network interfaces", enabled by default.

To disable them, simply visit that link, jump straight to step number 6 and type:

$ rpm -qa | grep -e '^systemd-[0-9]\+\|^udev-[0-9]\+'
$ sudo sed -i '/^GRUB\_CMDLINE\_LINUX/s/\"$/\ net\.ifnames\=0\"/' /etc/default/grub
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

After that:

  1. Stop the instance
  2. Enable the Enhanced Networking via the aws CLI
  3. Restart it

You should now be able to log in!

like image 76
Alfredo Di Napoli Avatar answered Jun 06 '23 17:06

Alfredo Di Napoli