Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

IPAddress return is empty with latest release of vRealize Automation #16

Closed
hobovirtual opened this issue Jun 20, 2019 · 28 comments
Closed
Assignees
Labels

Comments

@hobovirtual
Copy link

hobovirtual commented Jun 20, 2019

vRA 7.x version
vRealize Automation 7.6.0

Terraform version
Terraform v0.11.13

terraform-provider-vra7 plugin version
provider.vra7 v0.2.0

Describe the bug
Following issue #136

After some investigation following an upgrade from vRealize 7.4 to 7.6 me and one of my customer, we realized that the ip_address data is no longer populated in the resourceViews only if the user who made the request has the Tenant Administrator role in vRealize Automation.

Looking into resourceViews, seems that the NETWORK_LIST data map, always contains the IP no matter who made the request or it's role(s)

"NETWORK_LIST": [
  {
    "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",
    "componentId": null,
    "classId": "dynamicops.api.model.NetworkViewModel",
    "typeFilter": null,
    "data": {
      "NETWORK_ADDRESS": "10.10.10.102",
      "NETWORK_MAC_ADDRESS": "00:50:56:a6:30:fa",
      "NETWORK_NAME": "vxw-dvs-24-universalwire-1-sid-10000-mgmt-10.10.10.0-24",
      "NETWORK_NETWORK_NAME": "mgmt",
      "NETWORK_PROFILE": "mgmt"
    }
  }
]

Should we change the IPAddress or add a new NetworkAddress resource in the vra7_sdk.go to reflect this behavior change in the latest vRA version?

To Reproduce
Steps to reproduce the behavior:

  1. Create a user with Tenant Administrator in vRA

  2. Launch deployment via terraform config file

    Add the IPAddress output

    output "vm1 IP Address" {
       value = "${vra7_deployment.deployment1.resource_configuration.vm1.ip_address}"
    }
    

    2.1 You should get the following output
    vm1 IP Address =

  3. Repeat the same steps with a user that doesn't have the Tenant Administor role
    3.1 You should get the following output
    vm1 IP Address = 10.10.10.X

Desktop (please complete the following information):

  • OS: centOS 7.5
@diogoferreirasky
Copy link

+1

@bhalter
Copy link

bhalter commented Jul 16, 2019

This sounds like an issue related to vRA, please file a Support Request through vmware.com

@diogoferreirasky
Copy link

@bhalter I don't think so. I am able to deploy one Catalog Item with IP Address using a powershell script and using the exactly same user to deploy that machine with terraform I cannot get the IP address of the VM. I think the latest provider version doesn't support/works well with vRealize 7.6.0.

vRA 7.x version
vRealize Automation 7.6.0

Terraform version
terraform v0.11.13/v0.12

terraform-provider-vra7 plugin version
latest

@bhalter
Copy link

bhalter commented Jul 17, 2019

That's a bit more interesting, @markpeek did some investigation around changes in TF 0.12 yesterday and it looks like it could be related to that as well.

Did you run into this issue with both versions or 0.12 only?

@diogoferreirasky
Copy link

@bhalter both versions.
Before the lastest commit to support terraform version 0.12, I was not able to get the IP address either.
I think this provider functionality of returning the IP address has never worked for vRealize 7.6.0.

Note: This provider is able to return the machine name. However, this is not enough for me since the name takes time to spread to the DNS and because of that I am not able to remote connect to the VMs.

@hobovirtual
Copy link
Author

Hi @diogoferreirasky

Have you tried with a user that doesn't have the tenant administrator role assigned?
My test are showing that for user with tenant administrator role it doesn't work but for the rest it's ok.

I would like to know if it's the same in your case.
Thanks!

@diogoferreirasky
Copy link

@hobovirtual my user is not tenant administrator.

@hobovirtual
Copy link
Author

FYI, this issue seems to be isolated to vRA 7.6.0, here's a test grid i did

grid

Please check if your situation applies to any of these scenarios and let us know?

Thanks!

@GMZwinge
Copy link

GMZwinge commented Aug 30, 2019

It seems to be also happening with vRA 7.5.0, right after CHG074547 HF hot fix update for the VRA7.5SDE environment was applied (Build: 10053500). I tried for two different users: the user with less privileges doesn't have this problem. The user with more privileges does have this problem. I don't know the exact privileges of both users at this time, nor whether one is a tenant administrator, while the other is not like @hobovirtual reported.

@GMZwinge
Copy link

In our case, the IP address not available at the deployment level, but it is available at the VM level within the deployment, on the network tab. The Dell people at our site are asking if the vRealize provider could get the IP address from the VM instead of from the deployment?

@GMZwinge
Copy link

@hobovirtual I have one more case for vRA 7.5.0 with CHG074547 for your table. But I believe our cases are only for the Business Group Role(s) columns. I was told that permissions are not given to individual user. "User role" and "Shared access role" don't see this problem. "Support role" do see this problem.

@GMZwinge
Copy link

One comment about our case: we don't have those problem from the vRealize UI, only from Terraform.

@GMZwinge
Copy link

@hobovirtual I'm a little confused about the above table. Should the right most columns be labelled something like "IP address?" instead of "Role(s)"?

Also, I was told the above three users in our case have neither Manager nor Tenant Administrator role.

@hobovirtual
Copy link
Author

Hi @GMZwinge

Yes you're right, i guess some fields got miscopied from my table, here's an image capture instead

image

@soumik612
Copy link

Hi All,
Has this issue been resolved ?
I am unable to retrieve the Primary ip address from Linux VMs. On the VRA UI, I can see the ips, but even after issuing the "terraform refresh" command I am unable to retreive the address.

vRA 7.4 version
vRealize Automation 6.7.0

Terraform version
Terraform v0.12.13

terraform-provider-vra7 plugin version
latest

image
image

OUTPUT of terraform show:

vra7_deployment.Linux_machine_02[0]:

resource "vra7_deployment" "Linux_machine_02" {
catalog_item_id = "f5d0dbb3-55f0-42b4-87db-a8f7d3649054"
catalog_item_name = "IAAS-RHEL-7.2-x86_64_CF"
id = "ceb03da2-aa44-4d61-94a4-5610e60342e1"
request_status = "SUCCESSFUL"
resource_configuration = {
"LINUX.VirtualMachine.Network.ip_address" = ""
"LINUX.VirtualMachine.Network.primary_ip_address" = ""

@Prativa20
Copy link
Contributor

@soumik612 Since you are using vRA 7.4, you might just access ip_address as part of the VM properties.
For instance, <vm_name>.ip_address

Please let me know if that works for you.

Thanks,
Prativa

@soumik612
Copy link

@Prativa20, In my case, the VMs have multiple NICs which are named as
LINUX.VirtualMachine.Network0.Name / LINUX.VirtualMachine.Network1.Name .. and so on.
Once the VM is provisioned, on VRA UI I can see the primary address and ips assigned to each interfaces.
If I use <vm_name>.ip_address , I get an error from VRA

@Prativa20
Copy link
Contributor

@soumik612 Let me reproduce this issue and get back to you.

Thanks,
Prativa

@GMZwinge
Copy link

@hobovirtual and others: We have a ticket with VMware regarding this issue. They ask:

Could someone at the customer site be able to hit the resourceViews API that is mentioned in the GitHub issue, and send us the output? One output with the user in the support role, and one with the user not in the support role, demonstrating the inconsistency? Perhaps something in there could provide a clue as to why the ip_address property is missing.

I don't know which resourceViews APIs are being hit, nor have sample code to hit those API. Can someone provide such sample code (shell or Python script for example)?

@Prativa20
Copy link
Contributor

@hobovirtual @GMZwinge Can we get on a call to reproduce this issue?

@hobovirtual
Copy link
Author

Hi @GMZwinge

Working with @Prativa20 and engineering on this, hopefully we can provide some feedback soon.

Thanks!

@soumik612
Copy link

Hi @Prativa20 , @hobovirtual ,

Have you been able to find a fix for this issue yet ?

@hobovirtual
Copy link
Author

Hi @soumik612
some was done before the holidays, but not sure if @Prativa20 made progress since?

@soumik612
Copy link

@Prativa20 ,

Have you received any feedback from Vmware yet ?

@Prativa20
Copy link
Contributor

@soumik612 This issues is reproduced only if we set ip_address in main.tf while requesting a catalog item from terraform as in this example
https://github.com/terraform-providers/terraform-provider-vra7/blob/master/example/remote-execute/main.tf

The issue is that some extraneous custom properties are added to machine deployments when you create a deployment via Terraform. Those custom properties only get created if the user has a certain role (support user, business group admin, and other admins).

One of those extra custom properties is named "ip_address", which conflicts with the "ip_address" metadata that is returned by vRA when Terraform queries for machine information. That custom property value overwrites the real IP address value.

So, adding ip_address isn't the right way to do it. This issue is resolved in the PR #40.
But this PR also addresses some more issues which requires a small change the resource_configuration schema. Please go through the comment in the PR and binaries are attached to try it out.

Thanks,
Prativa

@soumik612
Copy link

Thanks @Prativa20 ,

I am able to fetch the ips now using the custom plugin. Any idea when this code will be pushed to official TF provider ?

@Prativa20
Copy link
Contributor

@soumik612 Great! I am working on merging it with proper documentation and examples. Will update soon.

@Prativa20 Prativa20 self-assigned this Apr 5, 2020
@Prativa20 Prativa20 added the bug label Apr 5, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 7, 2020
Prativa20 referenced this issue Apr 7, 2020
Prativa20 referenced this issue Apr 8, 2020
markpeek referenced this issue Apr 8, 2020
@Prativa20
Copy link
Contributor

@hobovirtual @diogoferreirasky @GMZwinge @soumik612 This issue is fixed in the latest version, v1.0.0. IP address is returned once the deployment is successful. ip_address is also added in the resource_configuration schema for its easy access. Refer to the documentation, examples and README for more detail and migrate to this version.
https://github.com/terraform-providers/terraform-provider-vra7/blob/master/website/docs/r/deployment.html.markdown

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

No branches or pull requests

6 participants