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

Changing root volume size does not register as a change. #3941

Closed
CorbanR opened this issue Nov 16, 2015 · 9 comments · Fixed by #11619
Closed

Changing root volume size does not register as a change. #3941

CorbanR opened this issue Nov 16, 2015 · 9 comments · Fixed by #11619

Comments

@CorbanR
Copy link

CorbanR commented Nov 16, 2015

OS: Ubuntu 15.10
Terraform v0.6.6

I create an instance with the following configuration

resource "aws_instance" "app1" {
  instance_type     = "m3.xlarge"
  ami               = "${var.trusty-ami}"
  security_groups   = ["${aws_security_group.ap.id}"]
  subnet_id = "${element(split(",",module.metadata.region_public_subnets), 0)}"
  user_data         = "${template_file.cloudinit.rendered}"
  associate_public_ip_address = "true"
  key_name          = "${var.key-name}"
  tags {
    Name        = "blah"
  }
}

The above configuration created an instance with an 8gig root volume.
After the instance was created I updated the configuration to

resource "aws_instance" "app1" {
  instance_type     = "m3.xlarge"
  ami               = "${var.trusty-ami}"
  security_groups   = ["${aws_security_group.app.id}"]
  subnet_id = "${element(split(",",module.metadata.region_public_subnets), 0)}"
  user_data         = "${template_file.cloudinit.rendered}"
  associate_public_ip_address = "true"
  key_name          = "${var.key-name}"
  tags {
    Name        = "blah"
  }
  root_block_device {
    volume_type = "gp2"
    volume_size = "16"
  }
}

I then ran terraform plan and terraform apply and terraform did NOT register any changes. I would have expected terraform to require a new instance. Is this expected behavior?

@robertfirek
Copy link

OS: Mac
Terraform v0.6.11

I've noticed that changing any parameter of block devices doesn't trigger any changes in plan. According to plan nothing has been changed.

@fazy
Copy link

fazy commented Feb 20, 2016

Seeing the same issue:

    ebs_block_device {
        device_name = "/dev/xvdb"
        volume_type = "gp2"
        volume_size = "${var.app_volume_size}"
    }

I changed the value of var.app_volume_size and no change was registered.

Worked around by commenting out the volume, applying, uncommenting and then applying again.

(Edit: also using Terraform 0.6.11, this time on Linux).

@alashh
Copy link

alashh commented Feb 25, 2016

Also seeing this
Terraform v0.6.11
Linux version 4.1.10-17.31.amzn1.x86_64

resource "aws_instance" "ec2_instance" {
    ami = "${var.instmod_ami_id}"
    count = "${var.instmod_number_of_instances}"
    subnet_id = "${var.instmod_subnet_id}"
    instance_type = "${var.instmod_instance_type}"
    user_data = "${file(var.instmod_user_data)}"
    vpc_security_group_ids = [ "${var.instmod_vpc_security_group_ids}" ]
    key_name = "${var.instmod_key_name}"
    root_block_device {
      volume_size = "10"
    }
    tags {
        Name                 = "${var.instmod_instance_name}-${count.index}"
    }
}

The server will spin with its initial 10 however changing the number gives nothing, commenting out, get/plan/apply and re-adding in the root_block_device (and another get/plan/apply) code block makes no change it seems for the root device.

@jonhatalla
Copy link

With Terraform 0.6.13 also seeing this.

Using taint to recreate the instance

philandstuff added a commit to openregister/deployment that referenced this issue Jul 4, 2016
In 63502ce, we switched to the minimal AMI image. This had the
unintended side effect of reducing the root volume size everywhere to
2Gb, because when you don't specify the root volume size it seems to
default to the size of the AMI (or at least this is my theory).

As a result, we ended up unable to deploy the indexer because the root
filesystem was full.

Explicitly setting the root volume size fixes this.

Note that due to hashicorp/terraform#3941, this won't automatically
cause the instance to be reprovisioned.

Also note that this commit only changes the indexer instance, but all
instances are affected.
@mengesb
Copy link
Contributor

mengesb commented Oct 17, 2016

Does this issue persist with terraform v0.7.5 ?

@Jwpe
Copy link

Jwpe commented Nov 7, 2016

Seeing this behaviour with Terraform v0.7.6 @mengesb

@Hashfyre
Copy link

Seeing this behavior in Terraform v0.7.10 too.

@ghost
Copy link

ghost commented Feb 1, 2017

Seeing this behavior in Terraform v0.8.4 too. If affects not only aws_instance resource, but also aws_launch_configuration.

@ghost
Copy link

ghost commented Apr 17, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants