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

Vsphere: Terraform forces new resource everytime I run plan #7066

Closed
Shruti29 opened this issue Jun 8, 2016 · 4 comments
Closed

Vsphere: Terraform forces new resource everytime I run plan #7066

Shruti29 opened this issue Jun 8, 2016 · 4 comments

Comments

@Shruti29
Copy link

Shruti29 commented Jun 8, 2016

I have tested the below with terraform versions 0.6.13, 0.6.15, 0.6.16 and the dev build (0.7.0)
I am trying to create a resource on vcenter with the following template file.

resource "vsphere_virtual_machine" "test" {
    folder = "myfolder"
    name   = "test-vm"
    datacenter    = "dc-1"
    cluster       = "cluster-1"
    vcpu   = "4"
    memory = "16384"
    gateway = "10.10.10.1"
    domain = "test.domain.com"

    network_interface {
        label = "vDC/INT-TEST"
        ipv4_address = "10.10.10.18"
        ipv4_prefix_length = "24"
    }
    disk {
        template = "centos-base"
        datastore = "datstore-test"
        type = "thin"
    }

The terraform resource gets created fine. But when I run terraform show command, the network label is not saved as expected.

network_interface.label = INT-TEST

The label should be saved as vDC/INT-TEST instead.
Every time I run terraform plan, it forces a new resource creation because of change in label name.

@ricardclau
Copy link
Contributor

Just confirming we are seeing the exact same issue in our stack.
Apparently, when the network interfaces are within a "folder" the terraform state gets a bit confused

Will try to have a look at both the code and the vsphere api responses

@chrislovecnm
Copy link
Contributor

chrislovecnm commented Jun 11, 2016

@ricardclau this may be a duplicate issue. We are using a wild card to lookup up networks. We are not handling folder names on networks correctly. Let me know if you are able to assist! PRs are appreciated.

@Shruti29
Copy link
Author

@chrislovecnm My bad! I have created a duplicate of #5843 :)
@ricardclau I have provide my comments in #5843.

@ghost
Copy link

ghost commented Apr 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants