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

fix: Allow disks to be resized/deleted on instances that have been running for > 90 days #1581

Merged

Conversation

lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Sep 17, 2024

📝 Description

This pull request resolves an issue that prevented disks from being resized and deleted on instances that have been running for more than 90 days. This is achieved by removing the booted config resolution logic from the linode_instance_disk resize logic and instead deferring it to the API during the subsequent boot.

Additionally, this PR moves the BootInstanceSync and ShutdownInstanceSync helper functions to the helper package, and adds a new WaitForInstanceNonTransientStatus helper.

✔️ How to Test

The following test steps assume you have pulled down this PR locally.

Integration Testing

make int-test PKG_NAME=linode/instance
make int-test PKG_NAME=linode/instancedisk
make int-test PKG_NAME=linode/instanceconfig

Manual Testing

  1. In a terraform-provider-linode sandbox environment (e.g. dx-devenv), apply the following configuration:
resource "linode_instance" "test" {
  label  = "test-instance"
  region = "us-mia"
  type   = "g6-nanode-1"
}

resource "linode_instance_disk" "test" {
  label     = "test"
  linode_id = linode_instance.test.id

  size  = 4000
  image = "linode/ubuntu22.04"

  root_pass = "terr4form-t3$t!!!!!!!"
}

resource "linode_instance_config" "test" {
  label     = "test"
  linode_id = linode_instance.test.id

  device {
    device_name = "sda"
    disk_id     = linode_instance_disk.test.id
  }

  root_device = "/dev/sda"
  kernel      = "linode/latest-64bit"
  booted      = true
}
  1. Ensure the apply completes successfully
  2. Change the size of the disk and re-apply the configuration.
  3. Ensure the apply completes successfully.
  4. Ensure the disk has been properly resized.

@lgarber-akamai lgarber-akamai added the bugfix for any bug fixes in the changelog. label Sep 17, 2024
@lgarber-akamai lgarber-akamai marked this pull request as ready for review September 17, 2024 20:58
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner September 17, 2024 20:58
@lgarber-akamai lgarber-akamai requested review from jriddle-linode and zliang-akamai and removed request for a team September 17, 2024 20:58
@lgarber-akamai lgarber-akamai changed the title fix: Allow disks to be resized on instances that have been running for > 90 days fix: Allow disks to be resized/deleted on instances that have been running for > 90 days Sep 19, 2024
Copy link
Member

@zliang-akamai zliang-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, all tests passed

@ykim-1 ykim-1 requested review from a team, ykim-1 and yec-akamai and removed request for a team September 24, 2024 15:18
Copy link
Contributor

@ykim-1 ykim-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, all tests passing locally

@lgarber-akamai lgarber-akamai merged commit 86e3962 into linode:dev Sep 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix for any bug fixes in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants