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 configure a EdgeGateway which is part of DFW config using provider 3.5.0 #763

Closed
jeroenvermeulen-01 opened this issue Jan 3, 2022 · 7 comments
Assignees

Comments

@jeroenvermeulen-01
Copy link

Terraform Version
Terraform v1.1.2
on linux_amd64

Affected Resource(s)
Initializing provider plugins...

  • Finding latest version of vmware/vcd...
  • Installing vmware/vcd v3.5.0...
  • Installed vmware/vcd v3.5.0 (unauthenticated)

Terraform Configuration Files

terraform {
  required_providers {
    vcd = {
      source = "vmware/vcd"
       version = "3.5.0"
    }
  }
}
provider "vcd" {
  user                 = var.vcd_user
  password             = var.vcd_pass
  auth_type            = "integrated"
  org                  = var.vcd_org
  vdc                  = var.vcd_vdc
  url                  = var.vcd_url
  max_retry_timeout    = var.vcd_max_retry_timeout
  allow_unverified_ssl = var.vcd_allow_unverified_ssl
  logging              = true
}

data "vcd_nsxt_edgegateway" "existing" {
  org                     = var.vcd_org
  vdc                     = "111111-vdcgroup"
  name                    = "111111-Edge"
}

Debug Output

2022/01/03 08:49:35 [DEBUG] queryOrgVdcList with filter map[string]string{"name":"111111-vdcgroup", "org":"https://test.url.net/api/org/2c94e741-7707-411f-a3a1-2cf5d7eca236", "orgName":"111111"}
2022/01/03 08:49:35 --------------------------------------------------------------------------------
2022/01/03 08:49:35 Request caller: govcd.(*Org).GetVDCByName-->govcd.(*Org).queryOrgVdcByName-->govcd.queryOrgVdcList-->govcd.(*Client).QueryWithNotEncodedParams-->govcd.(*Client).cumulativeQuery-->govcd.(*Client).newRequest
2022/01/03 08:49:35 GET https://test.url.net/api/query?&type=orgVdc&filter=name==111111-vdcgroup;orgName==111111&filterEncoded=true
2022/01/03 08:49:35 --------------------------------------------------------------------------------
2022/01/03 08:49:35 Req header:
2022/01/03 08:49:35     X-Vmware-Vcloud-Access-Token: [********]
2022/01/03 08:49:35     Accept: [application/*+xml;version=33.0]
2022/01/03 08:49:35     X-Vmware-Vcloud-Token-Type: [Bearer]
2022/01/03 08:49:35     Authorization: [********]
2022/01/03 08:49:35     User-Agent: [terraform-provider-vcd/v3.4.0-18-g72daccf (linux/amd64; isProvider:false)]
2022/01/03 08:49:35 ################################################################################
2022/01/03 08:49:35 Response caller govcd.(*Org).GetVDCByName-->govcd.(*Org).queryOrgVdcByName-->govcd.queryOrgVdcList-->govcd.(*Client).QueryWithNotEncodedParams-->govcd.(*Client).cumulativeQuery-->govcd.(*Client).QueryWithNotEncodedParamsWithApiVersion-->govcd.getResult-->govcd.decodeBody
2022/01/03 08:49:35 Response status 200 OK
2022/01/03 08:49:35 ################################################################################
2022/01/03 08:49:35 Response header:
2022/01/03 08:49:35     Vary: [Accept-Encoding, User-Agent]
2022/01/03 08:49:35     Content-Type: [application/vnd.vmware.vcloud.query.records+xml;version=33.0]
2022/01/03 08:49:35     Content-Length: [1906]
2022/01/03 08:49:35     Connection: [keep-alive]
2022/01/03 08:49:35     Date: [Mon, 03 Jan 2022 07:49:35 GMT]
2022/01/03 08:49:35     X-Vmware-Vcloud-Request-Id: [b64b5fc6-889e-4191-ac6c-709cd6ac05dd]
2022/01/03 08:49:35     X-Vmware-Vcloud-Request-Execution-Time: [76]
2022/01/03 08:49:35     Cache-Control: [no-store, must-revalidate]
2022/01/03 08:49:35 Response text: [1906]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QueryResultRecords xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:ns9="http://www.vmware.com/vcloud/versions" name="orgVdc" page="1" pageSize="25" total="0" href="https://test.url.net/api/query?type=orgVdc&amp;page=1&amp;pageSize=25&amp;format=records&amp;filter=name==111111-vdcgroup;orgName==111111" type="application/vnd.vmware.vcloud.query.records+xml">
    <Link rel="alternate" href="https://test.url.net/api/query?type=orgVdc&amp;page=1&amp;pageSize=25&amp;format=references&amp;filter=name==111111-vdcgroup;orgName==111111" type="application/vnd.vmware.vcloud.query.references+xml"/>
    <Link rel="alternate" href="https://test.url.net/api/query?type=orgVdc&amp;page=1&amp;pageSize=25&amp;format=references&amp;filter=name==111111-vdcgroup;orgName==111111" type="application/vnd.vmware.vcloud.query.references+json"/>
    <Link rel="alternate" href="https://test.url.net/api/query?type=orgVdc&amp;page=1&amp;pageSize=25&amp;format=idrecords&amp;filter=name==111111-vdcgroup;orgName==111111" type="application/vnd.vmware.vcloud.query.idrecords+xml"/>
    <Link rel="alternate" href="https://test.url.net/api/query?type=orgVdc&amp;page=1&amp;pageSize=25&amp;format=idrecords&amp;filter=name==111111-vdcgroup;orgName==111111" type="application/vnd.vmware.vcloud.query.idrecords+json"/>
</QueryResultRecords>

Panic Output

Error: error retrieving Org: error retrieving VDC 111111-vdcgroup: [ENF] entity not found
│
│   with data.vcd_nsxt_edgegateway.existing,
│   on main.tf line 22, in data "vcd_nsxt_edgegateway" "existing":
│   22: data "vcd_nsxt_edgegateway" "existing" {

Expected Behavior
I would have expected that minimal one EdgeGateway was found.

Actual Behavior
No EdgeGateway is found, unless we remove the gateway from DFW (remove it from VDC group).

Steps to Reproduce
Run this with an terraform plan

User Access rights
Tried with Organization Admin and System Admin

@Didainius
Copy link
Collaborator

Hello,
This is a known issue as the provider is not yet ready to work with VDC groups. The next imminent release will introduce a resource to manage VDC groups and then our priority is to check interoperability of all resources that are capable for VDC groups.

@jeroenvermeulen-01
Copy link
Author

Hi Didanius,
I was hoping by using the build g72daccf that this was already working, i have seen some changes on the VDC groups part. But if you can confirm that the needed code for this is not yet added to the master branch then i will test it on a later moment.

@Didainius
Copy link
Collaborator

@jeroenvermeulen-01 ,
Nope. We have time constraints so at first we only added resource to manage VDC groups. And I reckon it will not give many use cases because other resources do not work properly with them, but we have got to start somewhere. This will be released as intermediate step and we will work on automated tests for interoperability.

Sorry to say that - but stay tuned :) We know this is a needed feature and a priority now.

@jeroenvermeulen-01
Copy link
Author

jeroenvermeulen-01 commented Jan 3, 2022

Thanks for the quick response.

Sorry to say that - but stay tuned :) We know this is a needed feature and a priority now.

We will, but like you mentioned, this is must have to use IAC and DFW with Cloud Director.

@storbel
Copy link

storbel commented Jan 8, 2022

same issue:

When:

Terraform plan
Code:

terraform {
required_providers {
vcd = {
source = "vmware/vcd"
version = "3.5.0"
}
}
}

provider "vcd" {
user = var.vcd_user
password = var.vcd_password
org = var.vcd_org
url = var.vcd_url
vdc = var.vcd_vdc
auth_type = "integrated"
sysorg = "System"
max_retry_timeout = 30
allow_unverified_ssl = true
logging = true

}

data "vcd_nsxt_edgegateway" "t1" {
org = "GG"
vdc = "GG_VDC"

name = "ESG_GG_1"
}

output "edge_gateway_id" {
value = data.vcd_nsxt_edgegateway.t1.id
}

debug:

2022-01-08T13:09:51.497+0100 [WARN] ValidateProviderConfig from "provider["registry.terraform.io/vmware/vcd"]" changed the config value, but that value is unused
2022-01-08T13:09:52.928+0100 [DEBUG] Resource instance state not found for node "data.vcd_nsxt_edgegateway.t1", instance data.vcd_nsxt_edgegateway.t1
2022-01-08T13:09:52.928+0100 [DEBUG] ReferenceTransformer: "data.vcd_nsxt_edgegateway.t1" references: []
2022-01-08T13:09:52.936+0100 [INFO] provider.terraform-provider-vcd_v3.5.0: 2022/01/08 13:09:52 [TRACE] NSX-T edge gateway datasource read initiated: timestamp=2022-01-08T13:09:52.936+0100
2022-01-08T13:09:53.692+0100 [ERROR] vertex "data.vcd_nsxt_edgegateway.t1" error: could not retrieve NSX-T edge gateway: [ENF] entity not found: got 0 Edge Gateways by name 'ESG_GG_1'
2022-01-08T13:09:53.692+0100 [ERROR] vertex "data.vcd_nsxt_edgegateway.t1" error: could not retrieve NSX-T edge gateway: [ENF] entity not found: got 0 Edge Gateways by name 'ESG_GG_1'
2022-01-08T13:09:53.692+0100 [ERROR] vertex "data.vcd_nsxt_edgegateway.t1 (expand)" error: could not retrieve NSX-T edge gateway: [ENF] entity not found: got 0 Edge Gateways by name 'ESG_GG_1'
2022-01-08T13:09:53.692+0100 [INFO] backend/local: plan operation completed

│ Error: could not retrieve NSX-T edge gateway: [ENF] entity not found: got 0 Edge Gateways by name 'ESG_GG_1'

│ with data.vcd_nsxt_edgegateway.t1,
│ on security_group.tf line 26, in data "vcd_nsxt_edgegateway" "t1":
│ 26: data "vcd_nsxt_edgegateway" "t1" {

Do you have any idea when this will be fixed ? is there any branch i may use ?

@Didainius
Copy link
Collaborator

@storbel,
There is no branch yet, but you should see PRs coming soon as we build things for next release.

@Didainius
Copy link
Collaborator

VDC Group support for NSX-T Edge Gateway was added by #793

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

3 participants