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

cloud_admin role not working #1401

Closed
SteveTheP opened this issue Oct 6, 2024 · 14 comments · Fixed by #1412
Closed

cloud_admin role not working #1401

SteveTheP opened this issue Oct 6, 2024 · 14 comments · Fixed by #1412
Labels
bug Bug

Comments

@SteveTheP
Copy link

Describe the bug

I am trying to add tags to a vm resource in NSX. I am using the cloud admin account. However it gives me an error:

Planning failed. Terraform encountered an error while generating this plan.

│ Error: Error while reading Virtual Machine 501a5765-af42-eebe-89f6-de249f4f5128: com.vmware.vapi.std.errors.not_found

│ with data.nsxt_policy_vm.test_vm,
│ on main.tf line 1, in data "nsxt_policy_vm" "test_vm":
│ 1: data "nsxt_policy_vm" "test_vm" {

It is strange as the VM exist .. I can also do a curl with the cloud_admin user and password to retrieve the data

stefan@Acrs-PF4LJDT7:~/testnsx1$ curl -k -u 'cloud_admin:PASSSWORD'
'https://nsxmanager.sddc-X-X-X-X.vmwarevmc.com/policy/api/v1/search?query=501a5765-af42-eebe-89f6-de249f4f5128'

logging in with the cloud_admin account locally via the gui works and I can create and add tags to the vm .

Reproduction steps

My steps:

  1. I wrote some terraform:

terraform {
required_providers {
nsxt = {
source = "vmware/nsxt"
version = ">= 3.0.0"
}
}
}
provider "nsxt" {
username = "cloud_admin"
password = "mypassword"
host = "nsxmanager.sddc-X-X-X-X.vmwarevmc.com"
}

resource "nsxt_policy_vm_tags" "vm1_tags" {
instance_id = "501a5765-af42-eebe-89f6-de249f4f5128"
tag {
scope = "color"
tag = "blue"
}
tag {
scope = "env"
tag = "test"
}

}

Expected behavior

Tags are added. The VM does exist..

Additional context

why is this not working with terraform? any idea? Do I need to use another account? Also retrieving data does not work via terraform

@SteveTheP SteveTheP added the bug Bug label Oct 6, 2024
@SteveTheP
Copy link
Author

SteveTheP commented Oct 7, 2024

this is my code:

`data "vsphere_datacenter" "datacenter" {

name = "SDDC-Datacenter"
}

data "vsphere_virtual_machine" "template" {

name = "backstage-app"
datacenter_id = data.vsphere_datacenter.datacenter.id
}

output "name" {
value = data.vsphere_virtual_machine.template.id
}

resource "nsxt_policy_vm_tags" "vm1_tags" {
instance_id = data.vsphere_virtual_machine.template.id
tag {
scope = "color"
tag = "blue"
}
tag {
scope = "env"
tag = "test"
}

}`

and this is the outcome running a plan:

data.vsphere_datacenter.datacenter: Reading...
data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-3]
data.vsphere_virtual_machine.template: Reading...
data.vsphere_virtual_machine.template: Still reading... [10s elapsed]
data.vsphere_virtual_machine.template: Read complete after 13s [id=421ae9e2-d140-9ce2-fd61-39d0fc584378]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

nsxt_policy_vm_tags.vm1_tags will be created

  • resource "nsxt_policy_vm_tags" "vm1_tags" {
    • id = (known after apply)

    • instance_id = "421ae9e2-d140-9ce2-fd61-39d0fc584378"

    • tag {

      • scope = "color"
      • tag = "blue"
        }
    • tag {

      • scope = "env"
      • tag = "test"
        }
        }

Plan: 1 to add, 0 to change, 0 to destroy.

Changes to Outputs:

  • name = "421ae9e2-d140-9ce2-fd61-39d0fc584378"

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

nsxt_policy_vm_tags.vm1_tags: Creating...

│ Error: Cannot find VM with ID 421ae9e2-d140-9ce2-fd61-39d0fc584378

│ with nsxt_policy_vm_tags.vm1_tags,
│ on main.tf line 18, in resource "nsxt_policy_vm_tags" "vm1_tags":
│ 18: resource "nsxt_policy_vm_tags" "vm1_tags" {

@annakhm
Copy link
Collaborator

annakhm commented Oct 7, 2024

Hi @SteveTheP, what is your provider version? We have fixed a similar issue in 3.6.1 release

@SteveTheP
Copy link
Author

Hi @annakhm thanks for checking .. The issue looks similar .. I upgraded my version but still same error see:

`stefan@:~/testnsx1$ terraform init -upgrade

Initializing the backend...

Initializing provider plugins...

  • Finding vmware/nsxt versions matching "3.6.1"...
  • Finding hashicorp/vsphere versions matching ">= 2.0.0"...
  • Installing vmware/nsxt v3.6.1...
  • Installed vmware/nsxt v3.6.1 (signed by a HashiCorp partner, key ID 6B6B0F38607A2264)
  • Using previously-installed hashicorp/vsphere v2.9.2

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
stefan@Acrs:~/testnsx1$ terraform plan -lock=false
data.vsphere_datacenter.datacenter: Reading...
data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-3]
data.vsphere_virtual_machine.template: Reading...
data.vsphere_virtual_machine.template: Still reading... [10s elapsed]
data.vsphere_virtual_machine.template: Read complete after 14s [id=421ae9e2-d140-9ce2-fd61-39d0fc584378]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

nsxt_policy_vm_tags.vm1_tags will be created

  • resource "nsxt_policy_vm_tags" "vm1_tags" {
    • id = (known after apply)

    • instance_id = "421ae9e2-d140-9ce2-fd61-39d0fc584378"

    • tag {

      • scope = "color"
      • tag = "blue"
        }
    • tag {

      • scope = "env"
      • tag = "test"
        }
        }

Plan: 1 to add, 0 to change, 0 to destroy.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
stefan@Acrs-PF4LJDT7:~/testnsx1$ terraform apply -lock=false
data.vsphere_datacenter.datacenter: Reading...
data.vsphere_datacenter.datacenter: Read complete after 1s [id=datacenter-3]
data.vsphere_virtual_machine.template: Reading...
data.vsphere_virtual_machine.template: Still reading... [10s elapsed]
data.vsphere_virtual_machine.template: Read complete after 11s [id=421ae9e2-d140-9ce2-fd61-39d0fc584378]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

nsxt_policy_vm_tags.vm1_tags will be created

  • resource "nsxt_policy_vm_tags" "vm1_tags" {
    • id = (known after apply)

    • instance_id = "421ae9e2-d140-9ce2-fd61-39d0fc584378"

    • tag {

      • scope = "color"
      • tag = "blue"
        }
    • tag {

      • scope = "env"
      • tag = "test"
        }
        }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

nsxt_policy_vm_tags.vm1_tags: Creating...

│ Error: Cannot find VM with ID 421ae9e2-d140-9ce2-fd61-39d0fc584378

│ with nsxt_policy_vm_tags.vm1_tags,
│ on main.tf line 18, in resource "nsxt_policy_vm_tags" "vm1_tags":
│ 18: resource "nsxt_policy_vm_tags" "vm1_tags" {

@SteveTheP
Copy link
Author

with the user cloud_admin in the gui I am able to create and add tags to virtual resources ...

@alagoutte
Copy link
Contributor

What NSX release ?

@annakhm
Copy link
Collaborator

annakhm commented Oct 8, 2024

Thanks @SteveTheP,
It would be very helpful if you could post debug output with
TF_LOG=debug
TF_LOG_PROVIDER_NSX_HTTP=debug

@SteveTheP
Copy link
Author

Hi @annakhm thank you - see here below. The vm exists (see jpg)

stefan@Acrs-PF4LJDT7:~/testnsx1$ terraform apply -lock=false
2024-10-09T09:24:03.598+0200 [INFO] Terraform version: 1.8.5
2024-10-09T09:24:03.598+0200 [DEBUG] using github.com/hashicorp/go-tfe v1.51.0
2024-10-09T09:24:03.598+0200 [DEBUG] using github.com/hashicorp/hcl/v2 v2.20.0
2024-10-09T09:24:03.598+0200 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-10-09T09:24:03.598+0200 [DEBUG] using github.com/zclconf/go-cty v1.14.3
2024-10-09T09:24:03.598+0200 [INFO] Go runtime version: go1.22.1
2024-10-09T09:24:03.598+0200 [INFO] CLI args: []string{"terraform", "apply", "-lock=false"}
2024-10-09T09:24:03.598+0200 [DEBUG] Attempting to open CLI config file: /home/stefan/.terraformrc
2024-10-09T09:24:03.598+0200 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-10-09T09:24:03.598+0200 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2024-10-09T09:24:03.598+0200 [DEBUG] ignoring non-existing provider search directory /home/stefan/.terraform.d/plugins
2024-10-09T09:24:03.598+0200 [DEBUG] ignoring non-existing provider search directory /home/stefan/.local/share/terraform/plugins
2024-10-09T09:24:03.598+0200 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2024-10-09T09:24:03.598+0200 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2024-10-09T09:24:03.598+0200 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins
2024-10-09T09:24:03.598+0200 [INFO] CLI command args: []string{"apply", "-lock=false"}
2024-10-09T09:24:03.599+0200 [DEBUG] New state was assigned lineage "07918f10-2871-ff02-22c6-5b3b5724d347"
2024-10-09T09:24:03.645+0200 [DEBUG] checking for provisioner in "."
2024-10-09T09:24:03.647+0200 [DEBUG] checking for provisioner in "/usr/bin"
2024-10-09T09:24:03.648+0200 [INFO] backend/local: starting Apply operation
2024-10-09T09:24:03.649+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:03.649+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:03.653+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5"]
2024-10-09T09:24:03.654+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=20814
2024-10-09T09:24:03.654+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5
2024-10-09T09:24:03.660+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: configuring server automatic mTLS: timestamp="2024-10-09T09:24:03.659+0200"
2024-10-09T09:24:03.670+0200 [DEBUG] provider.terraform-provider-vsphere_v2.9.3_x5: plugin address: network=unix address=/tmp/plugin881784190 timestamp="2024-10-09T09:24:03.669+0200"
2024-10-09T09:24:03.670+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:03.685+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:03.686+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=20814
2024-10-09T09:24:03.686+0200 [DEBUG] provider: plugin exited
2024-10-09T09:24:03.686+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:03.686+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:03.689+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 args=[".terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1"]
2024-10-09T09:24:03.689+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=20831
2024-10-09T09:24:03.689+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1
2024-10-09T09:24:03.697+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: configuring server automatic mTLS: timestamp="2024-10-09T09:24:03.697+0200"
2024-10-09T09:24:03.709+0200 [DEBUG] provider.terraform-provider-nsxt_v3.6.1: plugin address: network=unix address=/tmp/plugin4293760425 timestamp="2024-10-09T09:24:03.709+0200"
2024-10-09T09:24:03.709+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:03.742+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:03.743+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=20831
2024-10-09T09:24:03.743+0200 [DEBUG] provider: plugin exited
2024-10-09T09:24:03.743+0200 [DEBUG] Building and walking validate graph
2024-10-09T09:24:03.743+0200 [DEBUG] ProviderTransformer: "nsxt_policy_vm_tags.vm1_tags" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/vmware/nsxt"]
2024-10-09T09:24:03.743+0200 [DEBUG] ProviderTransformer: "data.vsphere_datacenter.datacenter" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:03.743+0200 [DEBUG] ProviderTransformer: "data.vsphere_virtual_machine.template" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:03.744+0200 [DEBUG] ReferenceTransformer: "data.vsphere_datacenter.datacenter" references: []
2024-10-09T09:24:03.744+0200 [DEBUG] ReferenceTransformer: "data.vsphere_virtual_machine.template" references: [data.vsphere_datacenter.datacenter]
2024-10-09T09:24:03.744+0200 [DEBUG] ReferenceTransformer: "output.name (expand)" references: [data.vsphere_virtual_machine.template]
2024-10-09T09:24:03.744+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/hashicorp/vsphere"]" references: []
2024-10-09T09:24:03.744+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/vmware/nsxt"]" references: []
2024-10-09T09:24:03.744+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags" references: [data.vsphere_virtual_machine.template]
2024-10-09T09:24:03.744+0200 [DEBUG] Starting graph walk: walkValidate
2024-10-09T09:24:03.744+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:03.744+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:03.747+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 args=[".terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1"]
2024-10-09T09:24:03.747+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=20846
2024-10-09T09:24:03.747+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1
2024-10-09T09:24:03.754+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: configuring server automatic mTLS: timestamp="2024-10-09T09:24:03.753+0200"
2024-10-09T09:24:03.766+0200 [DEBUG] provider.terraform-provider-nsxt_v3.6.1: plugin address: address=/tmp/plugin411570747 network=unix timestamp="2024-10-09T09:24:03.766+0200"
2024-10-09T09:24:03.766+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:03.772+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:03.772+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:03.776+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5"]
2024-10-09T09:24:03.776+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=20859
2024-10-09T09:24:03.776+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5
2024-10-09T09:24:03.783+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: configuring server automatic mTLS: timestamp="2024-10-09T09:24:03.783+0200"
2024-10-09T09:24:03.791+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:03.791+0200 [DEBUG] provider.terraform-provider-vsphere_v2.9.3_x5: plugin address: address=/tmp/plugin3142173736 network=unix timestamp="2024-10-09T09:24:03.791+0200"
2024-10-09T09:24:03.805+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:03.806+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=20859
2024-10-09T09:24:03.806+0200 [DEBUG] provider: plugin exited
2024-10-09T09:24:03.806+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:03.807+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=20846
2024-10-09T09:24:03.807+0200 [DEBUG] provider: plugin exited
2024-10-09T09:24:03.808+0200 [INFO] backend/local: apply calling Plan
2024-10-09T09:24:03.808+0200 [DEBUG] Building and walking plan graph for NormalMode
2024-10-09T09:24:03.808+0200 [DEBUG] ProviderTransformer: "nsxt_policy_vm_tags.vm1_tags (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/vmware/nsxt"]
2024-10-09T09:24:03.808+0200 [DEBUG] ProviderTransformer: "data.vsphere_datacenter.datacenter (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:03.808+0200 [DEBUG] ProviderTransformer: "data.vsphere_virtual_machine.template (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:03.808+0200 [DEBUG] ReferenceTransformer: "output.name (expand)" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:03.808+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/hashicorp/vsphere"]" references: []
2024-10-09T09:24:03.808+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/vmware/nsxt"]" references: []
2024-10-09T09:24:03.808+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags (expand)" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:03.808+0200 [DEBUG] ReferenceTransformer: "data.vsphere_datacenter.datacenter (expand)" references: []
2024-10-09T09:24:03.808+0200 [DEBUG] ReferenceTransformer: "data.vsphere_virtual_machine.template (expand)" references: [data.vsphere_datacenter.datacenter (expand)]
2024-10-09T09:24:03.808+0200 [DEBUG] Starting graph walk: walkPlan
2024-10-09T09:24:03.809+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:03.809+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:03.811+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5"]
2024-10-09T09:24:03.811+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=20872
2024-10-09T09:24:03.811+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5
2024-10-09T09:24:03.819+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: configuring server automatic mTLS: timestamp="2024-10-09T09:24:03.819+0200"
2024-10-09T09:24:03.828+0200 [DEBUG] provider.terraform-provider-vsphere_v2.9.3_x5: plugin address: address=/tmp/plugin2992495292 network=unix timestamp="2024-10-09T09:24:03.827+0200"
2024-10-09T09:24:03.828+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:03.837+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:03.838+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:03.841+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 args=[".terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1"]
2024-10-09T09:24:03.841+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=20885
2024-10-09T09:24:03.841+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1
2024-10-09T09:24:03.841+0200 [WARN] ValidateProviderConfig from "provider["registry.terraform.io/hashicorp/vsphere"]" changed the config value, but that value is unused
2024-10-09T09:24:03.851+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: configuring server automatic mTLS: timestamp="2024-10-09T09:24:03.851+0200"
2024-10-09T09:24:03.865+0200 [DEBUG] provider.terraform-provider-nsxt_v3.6.1: plugin address: address=/tmp/plugin466665310 network=unix timestamp="2024-10-09T09:24:03.865+0200"
2024-10-09T09:24:03.865+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:03.872+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:03 [DEBUG] Cached SOAP client session data not valid or persistence not enabled, new session necessary: timestamp="2024-10-09T09:24:03.872+0200"
2024-10-09T09:24:03.872+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:03 [DEBUG] Creating new SOAP API session on endpoint vcenter.sddc-52-89-73-135.vmwarevmc.com: timestamp="2024-10-09T09:24:03.872+0200"
2024-10-09T09:24:03.875+0200 [WARN] ValidateProviderConfig from "provider["registry.terraform.io/vmware/nsxt"]" changed the config value, but that value is unused
2024-10-09T09:24:04.699+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:04 [INFO]: Session headers configured for policy objects: timestamp="2024-10-09T09:24:04.699+0200"
2024-10-09T09:24:04.699+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:04 [INFO]: Session headers configured for policy objects: timestamp="2024-10-09T09:24:04.699+0200"
2024-10-09T09:24:04.699+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:04 SecurityContext schemeID is: %!(EXTRA *string=0xc000595200): timestamp="2024-10-09T09:24:04.699+0200"
2024-10-09T09:24:04.699+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:04 Invoking action: "GET" and url: "https://nsxmanager.sddc-52-89-73-135.vmwarevmc.com/api/v1/node/version": timestamp="2024-10-09T09:24:04.699+0200"
2024-10-09T09:24:04.700+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:04 Issuing request towards NSX:
GET /api/v1/node/version HTTP/1.1
Host: nsxmanager.sddc-X-X-X-X.vmwarevmc.com
User-Agent: vAPI/0.7.0 Go/go1.19.13 (linux; amd64)
Content-Length: 2

Content-Type: application/json
Cookie: JSESSIONID=EB58E0A73AAB5629B4D5C3CEF37A7EB6;
Vapi-Ctx-Opid: b0041c22-ab29-4411-a9c8-335fb765c757
X-Xsrf-Token: 1b83c7d6-feed-4b3b-b448-be9515c6c07c
Accept-Encoding: gzip

{}: timestamp="2024-10-09T09:24:04.699+0200"
2024-10-09T09:24:04.884+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:04 [DEBUG] SOAP API session creation successful: timestamp="2024-10-09T09:24:04.884+0200"
2024-10-09T09:24:04.885+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:04 [DEBUG] VMWare vSphere Client configured for URL: vcenter.sddc-52-89-73-135.vmwarevmc.com: timestamp="2024-10-09T09:24:04.884+0200"
2024-10-09T09:24:04.885+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:04 [DEBUG] Setting up REST client: timestamp="2024-10-09T09:24:04.884+0200"
2024-10-09T09:24:05.709+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:05 Received NSX response:
HTTP/1.1 200 OK
Content-Length: 85
Content-Type: application/json
Date: Wed, 09 Oct 2024 11:36:18 GMT
Server: envoy
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vmw-Task-Id: d73e4d56-aaea-7b78-0ecf-3df174decb23_6ec829ec-f95f-4341-8151-02c7f15817d7
X-Envoy-Upstream-Service-Time: 228
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

{
"node_version": "4.1.0.7.0.23517629",
"product_version": "4.1.0.7.0.23517625"
}: timestamp="2024-10-09T09:24:05.709+0200"
2024-10-09T09:24:05.709+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:05 [DEBUG] NSX version is 4.1.0.7.0.23517629: timestamp="2024-10-09T09:24:05.709+0200"
2024-10-09T09:24:05.800+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:05 [DEBUG] CIS REST client configuration successful: timestamp="2024-10-09T09:24:05.800+0200"
2024-10-09T09:24:05.962+0200 [DEBUG] ReferenceTransformer: "data.vsphere_datacenter.datacenter" references: []
data.vsphere_datacenter.datacenter: Reading...
data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-3]
2024-10-09T09:24:06.272+0200 [DEBUG] ReferenceTransformer: "data.vsphere_virtual_machine.template" references: []
data.vsphere_virtual_machine.template: Reading...
2024-10-09T09:24:06.276+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:06 [DEBUG] Looking for VM or template by name/path "backstage-app": timestamp="2024-10-09T09:24:06.276+0200"
2024-10-09T09:24:06.433+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:06 [DEBUG] Datacenter for VM/template search: /SDDC-Datacenter: timestamp="2024-10-09T09:24:06.433+0200"
data.vsphere_virtual_machine.template: Still reading... [10s elapsed]
2024-10-09T09:24:17.627+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:17 [DEBUG] Fetching properties for VM "/SDDC-Datacenter/vm/backstage-app": timestamp="2024-10-09T09:24:17.627+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadSCSIBusType: SCSI controller layout for first 1 controllers: pvscsi-1000: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadSCSIBusSharing: SCSI controller layout for first 1 controllers: pvscsi-1000: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadDiskAttrsForDataSource: Fetching select attributes for disks: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] DiskRefreshOperation: Found controller "controller-1000" for device "disk-1000-0": timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadDiskAttrsForDataSource: Disk devices located: disk-1000-0: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadDiskAttrsForDataSource: Disk devices order after sort: disk-1000-0: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadDiskAttrsForDataSource: Attributes returned: [map[eagerly_scrub:false label:Hard disk 1 size:150 thin_provisioned:true unit_number:0xc0007e52b8]]: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaceTypes: Fetching interface types: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaceTypes: Network devices located: ethernet-0: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaceTypes: Network devices order after sort: ethernet-0: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaceTypes: Network types returned: [vmxnet3]: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaces: Fetching network interfaces: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterface: Network devices located: ethernet-0: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaceTypes: Network devices order after sort: ethernet-0: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] ReadNetworkInterfaces: Network interfaces returned: [map[adapter_type:vmxnet3 bandwidth_limit:0xc0007e5bd0 bandwidth_reservation:0xc0007e5b70 bandwidth_share_count:50 bandwidth_share_level:normal mac_address:00:50:56:9a:4b:b8 network_id:dvportgroup-1014]]: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] vsphere_virtual_machine (ID = 421ae9e2-d140-9ce2-fd61-39d0fc584378): Checking guest networking state: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] vsphere_virtual_machine (ID = 421ae9e2-d140-9ce2-fd61-39d0fc584378): Primary IP address: 10.225.32.15: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] vsphere_virtual_machine (ID = 421ae9e2-d140-9ce2-fd61-39d0fc584378): All IP addresses: 10.225.32.15: timestamp="2024-10-09T09:24:18.097+0200"
2024-10-09T09:24:18.097+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:18 [DEBUG] VM search for "backstage-app" completed successfully (UUID "421ae9e2-d140-9ce2-fd61-39d0fc584378"): timestamp="2024-10-09T09:24:18.097+0200"
data.vsphere_virtual_machine.template: Read complete after 12s [id=421ae9e2-d140-9ce2-fd61-39d0fc584378]
2024-10-09T09:24:18.098+0200 [DEBUG] Resource instance state not found for node "nsxt_policy_vm_tags.vm1_tags", instance nsxt_policy_vm_tags.vm1_tags
2024-10-09T09:24:18.098+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags" references: []
2024-10-09T09:24:18.099+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:18.099+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=20872
2024-10-09T09:24:18.099+0200 [DEBUG] provider: plugin exited
2024-10-09T09:24:18.099+0200 [DEBUG] refresh: nsxt_policy_vm_tags.vm1_tags: no state, so not refreshing
2024-10-09T09:24:18.102+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:18.103+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=20885
2024-10-09T09:24:18.103+0200 [DEBUG] provider: plugin exited
2024-10-09T09:24:18.103+0200 [DEBUG] building apply graph to check for errors
2024-10-09T09:24:18.103+0200 [DEBUG] Resource state not found for node "nsxt_policy_vm_tags.vm1_tags", instance nsxt_policy_vm_tags.vm1_tags
2024-10-09T09:24:18.104+0200 [DEBUG] ProviderTransformer: "nsxt_policy_vm_tags.vm1_tags" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/vmware/nsxt"]
2024-10-09T09:24:18.104+0200 [DEBUG] ProviderTransformer: "nsxt_policy_vm_tags.vm1_tags (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/vmware/nsxt"]
2024-10-09T09:24:18.104+0200 [DEBUG] ProviderTransformer: "data.vsphere_datacenter.datacenter (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:18.104+0200 [DEBUG] ProviderTransformer: "data.vsphere_virtual_machine.template (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/hashicorp/vsphere"]" references: []
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/vmware/nsxt"]" references: []
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags (expand)" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "data.vsphere_datacenter.datacenter (expand)" references: []
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "data.vsphere_virtual_machine.template (expand)" references: [data.vsphere_datacenter.datacenter (expand)]
2024-10-09T09:24:18.104+0200 [DEBUG] ReferenceTransformer: "output.name (expand)" references: [data.vsphere_virtual_machine.template (expand)]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

nsxt_policy_vm_tags.vm1_tags will be created

  • resource "nsxt_policy_vm_tags" "vm1_tags" {
    • id = (known after apply)

    • instance_id = "421ae9e2-d140-9ce2-fd61-39d0fc584378"

    • tag {

      • scope = "color"
      • tag = "blue"
        }
    • tag {

      • scope = "env"
      • tag = "test"
        }
        }

Plan: 1 to add, 0 to change, 0 to destroy.
2024-10-09T09:24:18.106+0200 [DEBUG] command: asking for input: "\nDo you want to perform these actions?"

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

2024-10-09T09:24:20.885+0200 [INFO] backend/local: apply calling Apply
2024-10-09T09:24:20.885+0200 [DEBUG] Building and walking apply graph for NormalMode plan
2024-10-09T09:24:20.885+0200 [DEBUG] Resource state not found for node "nsxt_policy_vm_tags.vm1_tags", instance nsxt_policy_vm_tags.vm1_tags
2024-10-09T09:24:20.885+0200 [DEBUG] ProviderTransformer: "data.vsphere_virtual_machine.template (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:20.885+0200 [DEBUG] ProviderTransformer: "nsxt_policy_vm_tags.vm1_tags" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/vmware/nsxt"]
2024-10-09T09:24:20.885+0200 [DEBUG] ProviderTransformer: "nsxt_policy_vm_tags.vm1_tags (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/vmware/nsxt"]
2024-10-09T09:24:20.886+0200 [DEBUG] ProviderTransformer: "data.vsphere_datacenter.datacenter (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/vsphere"]
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "data.vsphere_virtual_machine.template (expand)" references: [data.vsphere_datacenter.datacenter (expand)]
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "output.name (expand)" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/hashicorp/vsphere"]" references: []
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/vmware/nsxt"]" references: []
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "nsxt_policy_vm_tags.vm1_tags (expand)" references: [data.vsphere_virtual_machine.template (expand)]
2024-10-09T09:24:20.886+0200 [DEBUG] ReferenceTransformer: "data.vsphere_datacenter.datacenter (expand)" references: []
2024-10-09T09:24:20.886+0200 [DEBUG] Starting graph walk: walkApply
2024-10-09T09:24:20.887+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:20.887+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:20.890+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5"]
2024-10-09T09:24:20.890+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=21024
2024-10-09T09:24:20.890+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5
2024-10-09T09:24:20.903+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: configuring server automatic mTLS: timestamp="2024-10-09T09:24:20.903+0200"
2024-10-09T09:24:20.915+0200 [DEBUG] provider.terraform-provider-vsphere_v2.9.3_x5: plugin address: address=/tmp/plugin1058964369 network=unix timestamp="2024-10-09T09:24:20.915+0200"
2024-10-09T09:24:20.915+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:20.921+0200 [DEBUG] created provider logger: level=debug
2024-10-09T09:24:20.921+0200 [INFO] provider: configuring client automatic mTLS
2024-10-09T09:24:20.922+0200 [WARN] ValidateProviderConfig from "provider["registry.terraform.io/hashicorp/vsphere"]" changed the config value, but that value is unused
2024-10-09T09:24:20.923+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 args=[".terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1"]
2024-10-09T09:24:20.923+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=21033
2024-10-09T09:24:20.923+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1
2024-10-09T09:24:20.932+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: configuring server automatic mTLS: timestamp="2024-10-09T09:24:20.932+0200"
2024-10-09T09:24:20.947+0200 [DEBUG] provider.terraform-provider-nsxt_v3.6.1: plugin address: address=/tmp/plugin1533020868 network=unix timestamp="2024-10-09T09:24:20.946+0200"
2024-10-09T09:24:20.947+0200 [DEBUG] provider: using plugin: version=5
2024-10-09T09:24:20.954+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:20 [DEBUG] Cached SOAP client session data not valid or persistence not enabled, new session necessary: timestamp="2024-10-09T09:24:20.954+0200"
2024-10-09T09:24:20.954+0200 [WARN] ValidateProviderConfig from "provider["registry.terraform.io/vmware/nsxt"]" changed the config value, but that value is unused
2024-10-09T09:24:20.954+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:20 [DEBUG] Creating new SOAP API session on endpoint vcenter.sddc-52-89-73-135.vmwarevmc.com: timestamp="2024-10-09T09:24:20.954+0200"
2024-10-09T09:24:21.756+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:21 [INFO]: Session headers configured for policy objects: timestamp="2024-10-09T09:24:21.756+0200"
2024-10-09T09:24:21.757+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:21 [INFO]: Session headers configured for policy objects: timestamp="2024-10-09T09:24:21.756+0200"
2024-10-09T09:24:21.757+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:21 SecurityContext schemeID is: %!(EXTRA *string=0xc000b00510): timestamp="2024-10-09T09:24:21.756+0200"
2024-10-09T09:24:21.757+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:21 Invoking action: "GET" and url: "https://nsxmanager.sddc-52-89-73-135.vmwarevmc.com/api/v1/node/version": timestamp="2024-10-09T09:24:21.756+0200"
2024-10-09T09:24:21.757+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:21 Issuing request towards NSX:
GET /api/v1/node/version HTTP/1.1
Host: nsxmanager.sddc-X-X-X-X.vmwarevmc.com
User-Agent: vAPI/0.7.0 Go/go1.19.13 (linux; amd64)
Content-Length: 2

Content-Type: application/json
Cookie: JSESSIONID=C98F6819C45EF0AB630E7027D8C3EA8D;
Vapi-Ctx-Opid: 6147ffab-ead9-4769-9531-61bb0ca5ffcc
X-Xsrf-Token: 22ff6aff-12b6-4182-b784-45261d91351d
Accept-Encoding: gzip

{}: timestamp="2024-10-09T09:24:21.757+0200"
2024-10-09T09:24:21.933+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:21 [DEBUG] SOAP API session creation successful: timestamp="2024-10-09T09:24:21.933+0200"
2024-10-09T09:24:21.933+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:21 [DEBUG] VMWare vSphere Client configured for URL: vcenter.sddc-52-89-73-135.vmwarevmc.com: timestamp="2024-10-09T09:24:21.933+0200"
2024-10-09T09:24:21.933+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:21 [DEBUG] Setting up REST client: timestamp="2024-10-09T09:24:21.933+0200"
2024-10-09T09:24:22.797+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:22 Received NSX response:
HTTP/1.1 200 OK
Content-Length: 85
Content-Type: application/json
Date: Wed, 09 Oct 2024 11:36:35 GMT
Server: envoy
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vmw-Task-Id: d73e4d56-aaea-7b78-0ecf-3df174decb23_07f8690c-c222-4c65-8423-fc29c08b5a94
X-Envoy-Upstream-Service-Time: 247
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

{
"node_version": "4.1.0.7.0.23517629",
"product_version": "4.1.0.7.0.23517625"
}: timestamp="2024-10-09T09:24:22.797+0200"
2024-10-09T09:24:22.797+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:22 [DEBUG] NSX version is 4.1.0.7.0.23517629: timestamp="2024-10-09T09:24:22.797+0200"
2024-10-09T09:24:22.831+0200 [INFO] provider.terraform-provider-vsphere_v2.9.3_x5: 2024/10/09 09:24:22 [DEBUG] CIS REST client configuration successful: timestamp="2024-10-09T09:24:22.831+0200"
2024-10-09T09:24:22.988+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:22.991+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.3/linux_amd64/terraform-provider-vsphere_v2.9.3_x5 pid=21024
2024-10-09T09:24:22.991+0200 [DEBUG] provider: plugin exited
nsxt_policy_vm_tags.vm1_tags: Creating...
2024-10-09T09:24:22.999+0200 [INFO] Starting apply for nsxt_policy_vm_tags.vm1_tags
2024-10-09T09:24:23.001+0200 [DEBUG] nsxt_policy_vm_tags.vm1_tags: applying the planned Create change
2024-10-09T09:24:23.004+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:23 [INFO]: Session headers configured for policy objects: timestamp="2024-10-09T09:24:23.004+0200"
2024-10-09T09:24:23.005+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:23 SecurityContext schemeID is: %!(EXTRA *string=0xc000b947c0): timestamp="2024-10-09T09:24:23.004+0200"
2024-10-09T09:24:23.005+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:23 Invoking action: "GET" and url: "https://nsxmanager.sddc-X-X-X-X.vmwarevmc.com/policy/api/v1/infra/realized-state/virtual-machines?include_mark_for_delete_objects=false&sort_ascending=false&sort_by=external_id": timestamp="2024-10-09T09:24:23.005+0200"
2024-10-09T09:24:23.007+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:23 Issuing request towards NSX:
GET /policy/api/v1/infra/realized-state/virtual-machines?include_mark_for_delete_objects=false&sort_ascending=false&sort_by=external_id HTTP/1.1
Host: nsxmanager.sddc-X-X-X-X.vmwarevmc.com
User-Agent: vAPI/0.7.0 Go/go1.19.13 (linux; amd64)
Content-Length: 2

Content-Type: application/json
Cookie: JSESSIONID=C98F6819C45EF0AB630E7027D8C3EA8D;
Vapi-Ctx-Opid: fa2e1a4a-1c9a-41ad-9e45-ffacfddf3a6c
X-Xsrf-Token: 22ff6aff-12b6-4182-b784-45261d91351d
Accept-Encoding: gzip

{}: timestamp="2024-10-09T09:24:23.006+0200"
2024-10-09T09:24:23.166+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:23 Received NSX response:
HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Wed, 09 Oct 2024 11:36:35 GMT
Expires: 0
Pragma: no-cache
Server: envoy
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 3
X-Frame-Options: SAMEORIGIN
X-Nsx-Requestid: 1be31da4-ced4-4173-b714-eb3558223ad4
X-Xss-Protection: 1; mode=block

f4
{
"httpStatus" : "NOT_FOUND",
"error_code" : 600,
"module_name" : "common-services",
"error_message" : "The requested object : /infra/sites/default/enforcement-points/default could not be found. Object identifiers are case sensitive."
}
0
: timestamp="2024-10-09T09:24:23.165+0200"
2024-10-09T09:24:23.166+0200 [INFO] provider.terraform-provider-nsxt_v3.6.1: 2024/10/09 09:24:23 [INFO] Error reading Virtual Machines when looking for ID: 421ae9e2-d140-9ce2-fd61-39d0fc584378: timestamp="2024-10-09T09:24:23.165+0200"
2024-10-09T09:24:23.166+0200 [ERROR] provider.terraform-provider-nsxt_v3.6.1: Response contains error diagnostic: diagnostic_summary="Cannot find VM with ID 421ae9e2-d140-9ce2-fd61-39d0fc584378" tf_provider_addr=provider tf_req_id=45f777bc-a64f-269f-45d2-7b1f2a55099a tf_resource_type=nsxt_policy_vm_tags tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_severity=ERROR tf_proto_version=5.4 diagnostic_detail="" timestamp="2024-10-09T09:24:23.166+0200"
2024-10-09T09:24:23.187+0200 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2024-10-09T09:24:23.187+0200 [ERROR] vertex "nsxt_policy_vm_tags.vm1_tags" error: Cannot find VM with ID 421ae9e2-d140-9ce2-fd61-39d0fc584378

│ Error: Cannot find VM with ID vm

│ with nsxt_policy_vm_tags.vm1_tags,
│ on main.tf line 18, in resource "nsxt_policy_vm_tags" "vm1_tags":
│ 18: resource "nsxt_policy_vm_tags" "vm1_tags" {


2024-10-09T09:24:23.198+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-09T09:24:23.201+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/vmware/nsxt/3.6.1/linux_amd64/terraform-provider-nsxt_v3.6.1 pid=21033
2024-10-09T09:24:23.201+0200 [DEBUG] provider: plugin exited

@SteveTheP
Copy link
Author

btw it is vmware cloud running on AWS

@annakhm annakhm linked a pull request Oct 10, 2024 that will close this issue
@annakhm
Copy link
Collaborator

annakhm commented Oct 10, 2024

Thank you for the logs @SteveTheP, this is helpful. We're working on the fix.

@SteveTheP
Copy link
Author

Great! Thank you as we want to proceed with NSX-T automation and this is a showstopper.

@SteveTheP
Copy link
Author

Hey @annakhm do you know when you will have a fix ?

@annakhm
Copy link
Collaborator

annakhm commented Oct 16, 2024

PR with the fix is in review, we expect to release 3.7.1 with the fix within several weeks.

@SteveTheP
Copy link
Author

How can I test this @annakhm ?

@annakhm
Copy link
Collaborator

annakhm commented Oct 22, 2024

You can compile the provider from master branch and rewire your environment to use the compiled executable as described here https://github.com/vmware/terraform-provider-nsxt/blob/master/README.md#building-and-installing-the-provider

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

Successfully merging a pull request may close this issue.

3 participants