0

I'm having a very strange problem with server instance, which I'm trying to upgrade from PV to HVM.

I've got through the migration process, and created an AMI.

If I launch an instance from this AMI as a T2 type, of any size, it works fine.

However, if I try to launch as M4 or C4, it fails.

I'm seeing very odd errors in the system log...

Apr 24 08:49:19 cloud-init[1619]: util.py[WARNING]: Route info failed: Unexpected error while running command.
Command: ['netstat', '-rn']
Exit code: 1
Reason: -
Stdout: 'Kernel IP routing table\nDestination     Gateway         Genmask         Flags   MSS Window  irtt Iface\n'
Stderr: ''
ci-info: ++++++++++++++++Net device info+++++++++++++++++
ci-info:  Device   Up    Address      Mask    Hw-Address 
ci-info:    lo    True  127.0.0.1  255.0.0.0      .      
ci-info: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Route info failed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Apr 24 08:49:19 cloud-init[1619]: url_helper.py[WARNING]: Calling 'http://169.254.169.254/latest/meta-data/instance-id' failed [0/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /latest/meta-data/instance-id (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffa7da7e310>: Failed to establish a new connection: [Errno 101] Network is unreachable',))]

Can anyone suggest a reason why this would consistently fail with the M4 and C4 types, but consistently work with T2?

I've never encountered an issue like this previously, even though I've migrated many other instances using the same process.

user1751825
  • 313
  • 5
  • 13
  • That smells like a network driver issue; the kernel isn't setting up the network port, so the check against the AWS metadata service doesn't have anywhere to go. You might try running this against an m3 type, as that can have different network configs. – sysadmin1138 Apr 23 '19 at 23:50
  • Thanks @sysadmin1138. I've confirmed it also works with the M3 type. Any idea what I might need to do to upgrade an Amazon Linux instance to work with the M4 and C4 types? One of the main reasons for the PV to HVM migration was to be able to use the newer/faster instance types. – user1751825 Apr 24 '19 at 00:23

1 Answers1

2

The most likely reason that your instance would be failing to fetch metadata is that its kernel lacks drivers for the network interface.

Most newer EC2 instance types use the Elastic Network Adapter, with the driver name ena. This driver is present in a vanilla kernel; the relevant configuration flags are:

PCI_MSI=y
NET_VENDOR_AMAZON=y
CONFIG_ENA_ETHERNET=y