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

Update Linode resize to differentiate between warm and cold migrations #1728

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ezilber-akamai
Copy link
Contributor

@ezilber-akamai ezilber-akamai commented Jan 16, 2025

📝 Description

Add a check for migration type before resizing instance to allow for both warm and cold migration types.

✔️ How to Test

The following steps assume you have pulled down and checked out this PR locally.

Integration Testing

make PKG_NAME=linode/instance int-test

NOTE: This test will take a long time to run and may have intermittent failures.

Manual Testing

Run the following TF scripts in a sandbox environment (i.e. dx-devenv).

Cold Migration

  1. Create a simple instance
resource "linode_instance" "foobar" {
    label = "test-tf"
    type = "g6-standard-1"
    region = "us-east"
    image = "linode/ubuntu22.04"
    firewall_id = <YOUR FIREWALL ID>
} 
  1. Ensure instance is created and running in Cloud Manager.
  2. Update the instance to a different type (g6-standard-1 to g6-standard-2). You do not need to specify migration_type, as it defaults to cold.
resource "linode_instance" "foobar" {
    label = "test-tf"
    type = "g6-standard-2"
    region = "us-east"
    image = "linode/ubuntu22.04"
    firewall_id = <YOUR FIREWALL ID>
} 
  1. Once the process completes, look at the events in Cloud Manager. Note that the instance was shut down prior to being resized (as is expected for a cold migration). Ensure that the instance is running.
  2. Clean up the resources generated in this test.

Warm Migration

  1. Create a simple instance
resource "linode_instance" "foobar" {
    label = "test-tf"
    type = "g6-standard-1"
    region = "us-east"
    image = "linode/ubuntu22.04"
    firewall_id = <YOUR FIREWALL ID>
} 
  1. Ensure instance is created and running in Cloud Manager.
  2. Update the instance to a different type (g6-standard-1 to g6-standard-2). You do need to specify migration_type, as we want it to be warm instead of the default of cold.
resource "linode_instance" "foobar" {
    label = "test-tf"
    type = "g6-standard-2"
    region = "us-east"
    image = "linode/ubuntu22.04"
    firewall_id = <YOUR FIREWALL ID>
    migration_type = "warm"
} 
  1. Once the process completes, look at the events in Cloud Manager. Note that the instance was not shut down prior to being resized (as is expected for a warm migration). Ensure that the instance is running.
  2. Clean up the resources generated in this test.

@ezilber-akamai ezilber-akamai added the bugfix for any bug fixes in the changelog. label Jan 16, 2025
@ezilber-akamai ezilber-akamai force-pushed the TPT-3462-fix-instance-resize branch from 7554aaa to 90f1bd6 Compare January 16, 2025 19:52
@ezilber-akamai ezilber-akamai marked this pull request as ready for review January 16, 2025 20:08
@ezilber-akamai ezilber-akamai requested a review from a team as a code owner January 16, 2025 20:08
@ezilber-akamai ezilber-akamai requested review from jriddle-linode and ykim-akamai and removed request for a team January 16, 2025 20:08
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.

1 participant