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

Terraform ignores EBS volume size #10232

Closed
unacceptable opened this issue Sep 24, 2019 · 2 comments
Closed

Terraform ignores EBS volume size #10232

unacceptable opened this issue Sep 24, 2019 · 2 comments
Labels
service/autoscaling Issues and PRs that pertain to the autoscaling service.

Comments

@unacceptable
Copy link
Contributor

unacceptable commented Sep 24, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

> $ terraform -v
Terraform v0.12.9
+ provider.aws v2.29.0
+ provider.local v1.3.0
+ provider.random v2.2.0
+ provider.tls v2.1.0

Affected Resource(s)

  • aws_launch_configuration
  • aws_autoscaling_group

Terraform Configuration Files

resource "aws_launch_configuration" "ecs" {
    ...
    root_block_device {
        volume_type = "gp2"
        volume_size = 20
        encrypted   = true
    }
}

resource "aws_autoscaling_group" "ecs" {
   ...
}

Debug Output

N/A - I don't believe that it would add anything of note for this specific issue, but would be happy to provide it if others feel that it would.

Panic Output

N/A

Expected Behavior

I would expect an EC2 instance with an EBS volume with a max size of 30GB and a min size of whatever is specified in the root_block_device block to be used, vice always a 30GB

Actual Behavior

Terraform creates a snapshot with a larger than needed EBS volume:

aws_autoscaling_group.ecs: Still creating... [9m50s elapsed]
aws_autoscaling_group.ecs: Still creating... [10m0s elapsed]

Error: "project-environment-webservices-cluster": Waiting up to 10m0s: Need at least 4 healthy instances in ASG, have 0. Most recent activity: {
  ActivityId: "db95b594-d7be-ab7c-ee18-d55d87b8a2f4",
  AutoScalingGroupName: "project-environment-webservices-cluster",
  Cause: "At 2019-09-24T21:38:14Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 4.",
  Description: "Launching a new EC2 instance.  Status Reason: Volume of size 20GB is smaller than  snapshot 'snap-095a59a84a4452968', expect size >= 30GB. Launching EC2 instance failed.",
  Details: "{\"Subnet ID\":\"subnet-0f171eddb85de550f\",\"Availability Zone\":\"us-west-2c\"}",
  EndTime: 2019-09-24 21:38:16 +0000 UTC,
  Progress: 100,
  StartTime: 2019-09-24 21:38:16.618 +0000 UTC,
  StatusCode: "Failed",
  StatusMessage: "Volume of size 20GB is smaller than  snapshot 'snap-095a59a84a4452968', expect size >= 30GB. Launching EC2 instance failed."
}

  on Terraform/ec2.tf line 27, in resource "aws_autoscaling_group" "ecs":
  27: resource "aws_autoscaling_group" "ecs" {


script returned exit code 1

Steps to Reproduce

  1. terraform apply

Important Factoids

None

@ghost ghost added the service/autoscaling Issues and PRs that pertain to the autoscaling service. label Sep 24, 2019
@gdavison
Copy link
Contributor

gdavison commented Apr 7, 2020

Hi @unacceptable. This is a limitation on the AWS side. EBS volumes cannot be created from a snapshot larger than the volume. See Step 8 at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-restoring-volume.html#ebs-create-volume-from-snapshot

@gdavison gdavison closed this as completed Apr 7, 2020
@ghost
Copy link

ghost commented May 8, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/autoscaling Issues and PRs that pertain to the autoscaling service.
Projects
None yet
Development

No branches or pull requests

2 participants