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

Can't manage netbox_virtual_machine #4

Closed
felipeneuwald opened this issue Sep 23, 2020 · 2 comments
Closed

Can't manage netbox_virtual_machine #4

felipeneuwald opened this issue Sep 23, 2020 · 2 comments

Comments

@felipeneuwald
Copy link

Hey guys, any idea why this is happening?

Terraform Version

$ terraform version
Terraform v0.13.3

  • provider registry.terraform.io/e-breuninger/netbox v0.0.3
  • provider registry.terraform.io/terraform-provider-openstack/openstack v1.32.0

Affected Resource(s)

  • netbox_virtual_machine

Terraform Configuration Files

terraform {
  backend "http" {
  }
  required_providers {
    openstack = {
      source = "terraform-provider-openstack/openstack"
      required_version = ">= 0.13"
    }
    netbox = {
      source = "e-breuninger/netbox"
      required_version = ">= 0.13"
      version = "0.0.3"
    }
  }
}

provider "openstack" {
  user_name   = "***"
  tenant_name = "***"
  password    = "***"
  auth_url    = "***"
  region      = "***"
}

provider "netbox" {
  server_url = "***"
  api_token  = "***"
}

resource "netbox_virtual_machine" "testvm" {
  name         = "my-test-vm"
  comments     = "my-test-comment"
  memory_mb    = 1024
  vcpus        = 4
  disk_size_gb = 512
  cluster_id   = 4
  # tenant_id    = netbox_tenant.testtenant.id
  # platform_id  = netbox_platform.testplatform.id
  # role_id      = netbox_device_role.testdevicerole.id
}

Debug Output

https://gist.github.com/felipeneuwald/6374449273ce2b345f29da03254e405c

Panic Output

Expected Behavior

Apply the changes

Actual Behavior

Error

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@fbreckle
Copy link
Collaborator

fbreckle commented Nov 5, 2020

I just released a new version that is compatible with netbox 2.9.8. While I do not think your issue is caused by the wrong netbox version, the new provider version also comes with vastly improved error handling and should now propagate the actual API error correctly instead of giving you err: unknown error (status 400).

If I had to guess in your case, I'd say your error is a Virtual machine with this Cluster, Tenant and Name already exists..

@fbreckle
Copy link
Collaborator

Closed due to inactivity and very old provider version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants