-
Notifications
You must be signed in to change notification settings - Fork 84
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
Comments
this is my code: `data "vsphere_datacenter" "datacenter" { name = "SDDC-Datacenter" data "vsphere_virtual_machine" "template" { name = "backstage-app" output "name" { resource "nsxt_policy_vm_tags" "vm1_tags" { }` and this is the outcome running a plan: data.vsphere_datacenter.datacenter: Reading... Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions: nsxt_policy_vm_tags.vm1_tags will be created
Plan: 1 to add, 0 to change, 0 to destroy. Changes to Outputs:
Do you want to perform these actions? Enter a value: yes nsxt_policy_vm_tags.vm1_tags: Creating... |
Hi @SteveTheP, what is your provider version? We have fixed a similar issue in 3.6.1 release |
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...
Partner and community providers are signed by their developers. Terraform has made some changes to the provider dependency selections recorded Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see If you ever set or change modules or backend configuration for Terraform, Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions: nsxt_policy_vm_tags.vm1_tags will be created
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. Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions: nsxt_policy_vm_tags.vm1_tags will be created
Plan: 1 to add, 0 to change, 0 to destroy. Do you want to perform these actions? Enter a value: yes nsxt_policy_vm_tags.vm1_tags: Creating... |
with the user cloud_admin in the gui I am able to create and add tags to virtual resources ... |
What NSX release ? |
Thanks @SteveTheP, |
Hi @annakhm thank you - see here below. The vm exists (see jpg) stefan@Acrs-PF4LJDT7:~/testnsx1$ terraform apply -lock=false {}: timestamp="2024-10-09T09:24:04.699+0200" { Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions: nsxt_policy_vm_tags.vm1_tags will be created
Plan: 1 to add, 0 to change, 0 to destroy. Do you want to perform these actions? Enter a value: yes 2024-10-09T09:24:20.885+0200 [INFO] backend/local: apply calling Apply {}: timestamp="2024-10-09T09:24:21.757+0200" { {}: timestamp="2024-10-09T09:24:23.006+0200" f4 |
btw it is vmware cloud running on AWS |
Thank you for the logs @SteveTheP, this is helpful. We're working on the fix. |
Great! Thank you as we want to proceed with NSX-T automation and this is a showstopper. |
Hey @annakhm do you know when you will have a fix ? |
PR with the fix is in review, we expect to release 3.7.1 with the fix within several weeks. |
How can I test this @annakhm ? |
You can compile the provider from |
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:
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
The text was updated successfully, but these errors were encountered: