Reputation: 8187
I am trying to shrink the root volume of an AMI (ami-0a6b7e0cc0b1f464f) in us-east-1 region. The shrinking itself is successful i.e. I have created a smaller snapshot which works correctly. But when I create an AMI from this snapshot, the instances of that AMI does not have ENA (Enhanced Networking with the Elastic Network Adapter) enabled in it.
Below are the high level steps I performed.
As per AWS Docs
Amazon Linux 2 and the latest versions of the Amazon Linux AMI have the module required for enhanced networking installed and have the required enaSupport attribute set. Therefore, if you launch an instance with an HVM version of Amazon Linux on a supported instance type, enhanced networking is already enabled for your instance.
So if I am using Amazon Linux 2, and I am taking a snapshot of a volume that has all files copied from its previous volume, why is ENA not enabled? Probably networking components are applied some other way so simple copy does not work?
Upvotes: 1
Views: 5752
Reputation: 6605
So if I am using Amazon Linux 2, and I am taking a snapshot of a volume that has all files copied from its previous volume, why is ENA not enabled? Probably networking components are applied some other way so simple copy does not work?
You can consider AMI as a definition file which includes information about ENA. Snapshots do not know about AMI, they are 'storage'. Yes, they may include a file system, OS, drivers etc but that's not necessarily including the information AWS need to give you what you want == ENA enabled networking. The solution is actually simple. When you are creating an AMI, you tell AWS to enable ENA. As an example if you are using AWS cli to register an image, simply add --ena-support as in
aws ec2 register-image --ena-support ...
Now, AWS does say that if you create an AMI from an instance has ENA enabled, they will automatically infer this information from running instance. However, that's different than using a snapshot to create the image. It worked for you finally b/c you had a running instance with ENA drivers installed and AWS was able to detect it.
Upvotes: 1
Reputation: 8187
I still don't know the logical reasoning behind this, but the way I successfully produced an AMI which has ENA enabled is by:
Upvotes: 1