displague / deprecated-terraform-provider-linode

[OLD] Terraform provider plugin for Linode Cloud resources.. See
https://github.com/terraform-providers/terraform-provider-linode
Mozilla Public License 2.0
15 stars 5 forks source link

Unable to locate Linode Volume #33

Closed programingnotes closed 5 years ago

programingnotes commented 5 years ago

Hello,

Although Linode Dashboard does show that the my volume exists, is attached to linode instance, and has a file system path, I am unable to locate saids linode volume by its file system path in my terminal.

Terraform Version

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

provider "linode" {
  token = "${var.v4_api_token}"
}

resource "linode_instance" "test" {
  group           = "${var.group}"
  label           = "${var.group}-${var.label}"
  image           = "${var.image}"
  region          = "${var.region}"
  type            = "${var.type}"
  authorized_keys = "${chomp(file(var.root_ssh_keys))}"
  root_pass       = "${var.root_user_password}"
  swap_size = 1024 
}

resource "linode_volume" "docker" {
  size  = 20  
  label = "${linode_instance.test.label}-${var.docker_vol}"
  region = "${linode_instance.test.region}"

  linode_id = "${linode_instance.test.id}"
}

Debug Output

Log Output

Panic Output

Terraform does not produced a panic

Given

resource "linode_instance" "test" {
  group           = "${var.group}"
  label           = "${var.group}-${var.label}"
  image           = "${var.image}"
  region          = "${var.region}"
  type            = "${var.type}"
  authorized_keys = "${chomp(file(var.root_ssh_keys))}"
  root_pass       = "${var.root_user_password}"
  swap_size = 1024 
}

resource "linode_volume" "docker" {
  size  = 20  
  label = "${linode_instance.test.label}-${var.docker_vol}"
  region = "${linode_instance.test.region}"

  linode_id = "${linode_instance.test.id}"
}

Expected Behavior

Actual Behavior

Kernel:

root@localhost:~# uname -a
Linux localhost 4.18.8-x86_64-linode117 #1 SMP PREEMPT Tue Sep 18 18:48:25 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Given the above tf file
provider "linode" {
  token = "${var.v4_api_token}"
}

resource "linode_instance" "test" {
  group           = "${var.group}"
  label           = "${var.group}-${var.label}"
  image           = "${var.image}"
  region          = "${var.region}"
  type            = "${var.type}"
  authorized_keys = "${chomp(file(var.root_ssh_keys))}"
  root_pass       = "${var.root_user_password}"
  swap_size = 1024 
}

resource "linode_volume" "docker" {
  size  = 20  
  label = "${linode_instance.test.label}-${var.docker_vol}"
  region = "${linode_instance.test.region}"

  linode_id = "${linode_instance.test.id}"
}
  1. run terraform init && terraform apply
  2. log into linode
  3. run ls -la /dev/disk/by-id

Important Factoids

There isn't anything atypical about my account.

References

No references that I have found thus far

programingnotes commented 5 years ago

with help from @displague, I was able to figure out that (at the time of this issue) the order of resource creation matters. There are 2 ways to explicity link volumes:

The method I used (above):