2019年8月9日 星期五

Import VMware VM to EC2 and support T3/M5/C5 ENA and Nitro Hypervisor

If you need to update an CentOS AMI to support AWS new generation instance type such as T3/T3a/C5/M5, Enhanced Networking Adaptor (ENA) or EBS Optimized disk. You will need to include drivers into initramfs, otherwise instance will boot fail.

The first thing is enable and install enhanced networking driver. You can refer document: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-ena.html#enhanced-networking-ena-linux

However, after rebuild initramfs via dracut and reboot, your instance might boot fail. Because of the new instance type supports ENA usually will also need to support EBS optimized volume. 

To troubleshoot I will suggest turn on console logging for your AMI first, so that you can troubleshoot via Get Instance Screenshot.
You need to update grub.cfg remove "rhgb quiet" and add "console=tty0" into /etc/default/grub and then install it via grub2-mkconfig -o /boot/grub2/grub.cfg

The second thing is to make initramfs support nvme drive (EBS Optimized disk).
You might check this document for general check points https://aws.amazon.com/premiumsupport/knowledge-center/boot-error-linux-m5-c5/
But there is still one thing missed. By default in CentOS 7, the dracut will auto detect and include necessary drivers into initramfs. But if you want your AMI to support both legacy and modern hypervisor such as Nitro, ENA, nvme. You need to built-in more generic drivers via dracut -f -v -N. The -N indicates dracut should disable host-only mode. 


By doing so, you can connect everything together and make your AMI support all HVM instance types in AWS.

BTW, before publish AMI, check this document to clean up your instance is also suggested:


沒有留言:

張貼留言