Migrate VM to AWS

 

 


Linux

 

# Checking NIC

modinfo ena

modinfo: ERROR: Module ena not found.

OR

filename:       /lib/modules/3.10.0-1127.19.1.el7.x86_64/
                kernel/drivers/net/ethernet/amazon/ena/ena.ko.xz
version:        2.0.3K
...

# OS Support

# Ubuntu

# Ubuntu 16.04 and 18.04 ship with the Ubuntu custom kernel (linux-aws kernel package)

# The latest Ubuntu HVM AMIs include the module required for enhanced networking with ENA installed and have ENA support enabled.

apt-get update

apt-get upgrade linux-aws

# CentOS

RHEL 7.4 and later AMIs come preinstalled with the module needed for enhanced networking with ENA.

 


General distribution(Centos 6)

 

------------------

yum groupinstall -y "Development Tools"

yum install kernel-devel-$(uname -r)       # yum install kernel-devel

cd /usr/src

git clone https://github.com/amzn/amzn-drivers        # 4.6M

cd amzn-drivers/kernel/linux/ena

make

cp ena.ko to /lib/modules/$(uname -r)/

echo ena > /etc/modules-load.d/ena.conf

depmod

insmod ena.ko           # loading driver

dracut -f -v               # Update initramfs

------------------

# Disable predictable network interface names

/etc/default/grub

GRUB_CMDLINE_LINUX='... net.ifnames=0'

grub2-mkconfig -o /boot/grub2/grub.cfg

------------------

# If your instance operating system contains an /etc/udev/rules.d/70-persistent-net.rules file,
# you must delete it before creating the AMI.
# This file contains the MAC address for the Ethernet adapter of the original instance.
# If another instance boots with this file, the operating system will be unable to find the device and
# eth0 might fail, causing boot issues.
# This file is regenerated at the next boot cycle,
# and any instances launched from the AMI create their own version of the file.

------------------

Configure the Dynamic Kernel Module Support (DKMS) program to make sure that the driver is included during future kernel upgrades

yum install dkms -y

...