Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Bug ] Make EBS boot volume configurable #164

Open
gwright99 opened this issue Dec 13, 2024 · 2 comments · Fixed by #166
Open

[ Bug ] Make EBS boot volume configurable #164

gwright99 opened this issue Dec 13, 2024 · 2 comments · Fixed by #166

Comments

@gwright99
Copy link
Collaborator

gwright99 commented Dec 13, 2024

It has been discovered that ~October 2024, AWS changed the size of the default EBS boot disk on some of the AMI families used by the installer. This can impact new deployments. Example:

  • al2023-ami-minimal-2023.6.20241212.0-kernel-6.1-x86_64 : 2 GB boot disk
  • al2023-ami-minimal-2023.6.20241121.0-kernel-6.1-x86_64 : 2 GB boot disk
  • al2023-ami-minimal-2023.6.20241031.0-kernel-6.1-x86_64 : 8 GB boot disk

2 GB is not a big enough disk to load all the packages and images required to stand up the application. Example of error thrown when trying to execute the Ansible step to install docker:

TASK [Install docker.] *********************************************************
│ fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to download packages: docker-24.0.5-1.amzn2023.0.3.x86_64: Download failed: Curl error (23): Failed writing received data to disk/application for
│ https://al2023-repos-us-east-1-de612dc2.s3.dualstack.us-east-1.amazonaws.com/blobstore/49746f6395778a7b7cad2f658e39bc12195e9813a9b1523557a72e68241faa1f/docker-24.0.5-1.amzn2023.0.3.x86_64.rpm [Failure writing output to destination]", "results": []}

Solution

Add an additional configuration value to explicitly set the boot disk size of the instantiated EC2 instance.

@gwright99 gwright99 linked a pull request Dec 14, 2024 that will close this issue
@gwright99
Copy link
Collaborator Author

Added additional configuration value ec2_root_volume_size to resolve problem (number-type, specifying size in GiB).

@gwright99
Copy link
Collaborator Author

This solution is not fully baked yet. Just ran into the following error while deploying another test.

Error: creating EC2 Instance: InvalidBlockDeviceMapping: Volume of size 8GB is smaller than snapshot 'snap-06607f95734ac1141', expect size>= 30GB
│       status code: 400, request id: dd11f79d-a09d-47a8-a124-b9526617dfed
│ 
│   with aws_instance.ec2,
│   on 006_ec2.tf line 101, in resource "aws_instance" "ec2":
│  101: resource "aws_instance" "ec2" {

Suspicions

The most recent AMI search settled on ami-020273a2215ae54dd. This is an al2024-ami-ec2-neuron-type image with a base block storage snapshot of 30GiB. Prior to the recent change that explicitly set the boot disk, this would have been fine as we'd accept the block device by default. Now we are encountering conflicts due to the desired bootsize being smaller than the EBS snapshot.

image

Proposed Solution

  1. Keep EBS boot disk size configurable, but force it to be larger than 30 GiB.
  2. Make the AMI retrieval logic more strict (e.g. Amazon Linux 2023 minimal images only).

My preference is #2. This means we need to only work about a single family type and can better stay on-top of changes to that family (e.g. like the change that occurred in Oct 2024). The downside is that security patches to the VM made me slightly slower due to us not being able to take advantage of updated cousin images that are released earlier.

@schaluva for awareness and a chance to opine re: what approach she thinks makes more sense (or if there are others I've neglected to note).

gwright99 added a commit that referenced this issue Feb 4, 2025
…_family

[#164] Narrow AMI filter to AL2023-minimal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant