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

vcd 3.3.0 Error: error finding catalog name: [ENF] entity not found #689

Closed
ghost opened this issue Jul 1, 2021 · 9 comments · Fixed by #691
Closed

vcd 3.3.0 Error: error finding catalog name: [ENF] entity not found #689

ghost opened this issue Jul 1, 2021 · 9 comments · Fixed by #691

Comments

@ghost
Copy link

ghost commented Jul 1, 2021

Hi there,

After updating the provider to version 3.3.0, I cannot create vcd_vm. I get:
Error: error finding catalog k8s-spb: [ENF] entity not found
Although on version 3.2.0 it works fine.

Version

Terraform: v1.0.1
Vcd: 3.3.0
VMware Cloud Director version: 10.2.1.17444397 Mon Jan 11 04:48:56 UTC 2021

Terraform Configuration Files

resource "vcd_vm" "test-vm" {
  name                 = "test-vm"
  catalog_name         = "k8s-spb"
  template_name        = "centos-7.9.2009-kernel-5-x86_64"
  memory               = 2048
  cpus                 = 2
  storage_profile      = "SSD1"
}

data "vcd_org" "my-org" {
  name   = var.VCD_ORG
}

data "vcd_org_vdc" "my-org-vdc" {
  org     = var.VCD_ORG
  name    = var.VCD_VDC
}

Debug Output

https://raw.githubusercontent.com/xor222xor/vcd-test/main/api.log
https://raw.githubusercontent.com/xor222xor/vcd-test/main/terraform.log

@ghost
Copy link
Author

ghost commented Jul 1, 2021

I tried on 3 different sites, the error is repeated

@Didainius
Copy link
Collaborator

Didainius commented Jul 1, 2021

@xor222xor ,
Thanks for reporting this!
Are all your VCDs at the same version?
Can you elaborate a bit on access level your user has? What role does it have? Is it a customized role or the one that VCD provides?

The catalog is owned by your org, correct? Does it have any sharing settings?

I could not yet replicate this with org admin. (As well as none of our tests failed pre-release).

@dataclouder
Copy link
Contributor

I have tried to reproduce this issue, without much success. I can only assume that it's a matter of privileges. Using a reduced privileges user (such as "vApp Author") I can see that the catalog is not retrieved.
In 3.3.0 we had to change the way we retrieve catalogs and VDCs, because recent versions of VCD API don't include such information in the Org structure, and we need to run an explicit query. This change is affected more than before by the user permissions. Therefore, it's important to know which role the user is acting with.
If the role is a non-standard one, a good way of showing its permissions is by using the new vcd_role data source:

data "vcd_role" "my-role" {
  org      = "my-org"
  name     = "ROLE_NAME"
}

output "role" {
  value = data.vcd_role.my-role
}

@ghost
Copy link
Author

ghost commented Jul 2, 2021

Hello @Didainius ,
Yes, all VMware Cloud Director version: 10.2.1.17444397 Mon Jan 11 04:48:56 UTC 2021
I run it under the role Organization Administrator, the type local.
Catalogs shared between organizations in vcloud.
I have tried different catalogs but also with no success.

@Didainius
Copy link
Collaborator

Didainius commented Jul 2, 2021

Thanks!

I run it under the role Organization Administrator, the type local.

Is it the built-in default Organization Administrator role?

Catalogs shared between organizations in vcloud.

Do these shared catalogs come from different Organizations?

Maybe you have a scenario how to replicate it from scratch using UI?

@ghost
Copy link
Author

ghost commented Jul 2, 2021

@dataclouder
VM is created in UI and vcd-provider 3.2.0
Here's a description of the output role:
https://raw.githubusercontent.com/xor222xor/vcd-test/main/vcd_role.txt

@Didainius
Copy link
Collaborator

@xor222xor ,
We suspect that the issue is you are using a shared catalog coming from another org and this was broken in 3.3.0.
Given that my assumption is correct - I have made a fix pull request, but would like you to validate it. Would you be able to build code from this branch? https://github.com/Didainius/terraform-provider-vcd/tree/v2.12.0_regression_fix

Given you have Go it should be as simple as make install after checking out that branch. Otherwise I could build a binary for you and share.

@ghost
Copy link
Author

ghost commented Jul 3, 2021

@Didainius
Copy link
Collaborator

@xor222xor ,
v3.3.1 is released with this fix.

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