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

provider/vsphere: Standardizing datastore references to use builtin Path func #8075

Merged
merged 1 commit into from Aug 16, 2016

Conversation

dkalleg
Copy link
Contributor

@dkalleg dkalleg commented Aug 9, 2016

This is a fix to standardizes the way datastore paths are build. This will also allow use of datastores that are part of a datastore cluster using the syntax <datastore cluster name>/<datastore name>

@dagnello
Copy link
Contributor

dagnello commented Aug 10, 2016

LGTM

@dkalleg dkalleg changed the title Standardizing datastore references to use builtin Path func provider/vsphere: Standardizing datastore references to use builtin Path func Aug 12, 2016
@dkalleg
Copy link
Contributor Author

dkalleg commented Aug 12, 2016

@stack72 After I built I got the change in internal_plugin_list.go. Looks like it just moved an entry to the top of that struct. Do you have ideas on why? I figured I'd leave it since the build consistently did this.

@stack72
Copy link
Contributor

stack72 commented Aug 14, 2016

Hey @dkalleg

Ignore that change, that is because i merged a new provider - i will take care of that. Please can you drop in the test run output for reference and then i can merge :)

Thanks!

P.

@stack72 stack72 self-assigned this Aug 14, 2016
@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Aug 14, 2016
This is a fix to allow use of datastores that are part of a datastore
cluster using the syntax  <datastore cluster name>/<datastore name>
@dkalleg
Copy link
Contributor Author

dkalleg commented Aug 15, 2016

@stack72 Realized that the disk update test was failing in a multi datastore scenario so I had to update it. Results:

VirtualDisk tests

$ make testacc TEST=./builtin/providers/vsphere TESTARGS="-run TestAccVSphereVirtualDisk"
==> Checking that code complies with gofmt requirements...
/home/dkalleg/goworkspace/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/15 15:37:26 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/vsphere -v -run TestAccVSphereVirtualDisk -timeout 120m
=== RUN   TestAccVSphereVirtualDisk_basic
2016/08/15 15:37:55 [WARN] Invalid log level: "all". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
--- PASS: TestAccVSphereVirtualDisk_basic (5.29s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/vsphere    5.328s

cdrom test

$ make testacc TEST=./builtin/providers/vsphere TESTARGS="-run TestAccVSphereVirtualMachine_createWithCdrom"
==> Checking that code complies with gofmt requirements...
/home/dkalleg/goworkspace/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/15 15:40:09 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/vsphere -v -run TestAccVSphereVirtualMachine_createWithCdrom -timeout 120m
=== RUN   TestAccVSphereVirtualMachine_createWithCdrom
2016/08/15 15:40:34 [DEBUG] template=
resource "vsphere_virtual_machine" "with_cdrom" {
    name = "terraform-test-with-cdrom"
    cdrom {
        datastore = "%s"
        path = "%s"
    }
2016/08/15 15:40:34 [DEBUG] template config=
resource "vsphere_virtual_machine" "with_cdrom" {
    name = "terraform-test-with-cdrom"
    cdrom {
        datastore = "san1"
        path = "dan/cidata.iso"
    }

    datacenter = "FTC"
    resource_pool = "Cluster1"

  vcpu = 2
  memory = 1024
  network_interface {
    label = "VM Private"
  }
  disk {
        datastore = "san1"

    template = "DansTfTest/danTestTemplate"
  }
}
2016/08/15 15:40:34 [WARN] Invalid log level: "all". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
--- PASS: TestAccVSphereVirtualMachine_createWithCdrom (142.30s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/vsphere    142.334s

Disk update test

make testacc TEST=./builtin/providers/vsphere TESTARGS="-run TestAccVSphereVirtualMachine_updateDisks"
==> Checking that code complies with gofmt requirements...
/home/dkalleg/goworkspace/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/15 16:10:22 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/vsphere -v -run TestAccVSphereVirtualMachine_updateDisks -timeout 120m
=== RUN   TestAccVSphereVirtualMachine_updateDisks
2016/08/15 16:10:50 [DEBUG] template=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"

%s
    vcpu = 2
    memory = 1024
    network_interface {
        label = "%s"
        ipv4_address = "%s"
        ipv4_prefix_length = %s
        ipv4_gateway = "%s"
    }
     disk {
%s
        template = "%s"
        iops = 500
    }

    disk {
        size = 1
        iops = 500
    name = "one"
    }
}
2016/08/15 16:10:50 [DEBUG] template config=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"

    datacenter = "FTC"
    resource_pool = "Cluster1"

    vcpu = 2
    memory = 1024
    network_interface {
        label = "VM Private"
        ipv4_address = ""
        ipv4_prefix_length = 24
        ipv4_gateway = ""
    }
     disk {
        datastore = "san1"

        template = "DansTfTest/danTestTemplate"
        iops = 500
    }

    disk {
        size = 1
        iops = 500
    name = "one"
    }
}
2016/08/15 16:10:50 [DEBUG] template=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"

%s
    vcpu = 2
    memory = 1024
    network_interface {
        label = "%s"
        ipv4_address = "%s"
        ipv4_prefix_length = %s
        ipv4_gateway = "%s"
    }
     disk {
%s
        template = "%s"
        iops = 500
    }

    disk {
        size = 1
        iops = 500
    name = "one"
    }
}
2016/08/15 16:10:50 [DEBUG] template config=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"

    datacenter = "FTC"
    resource_pool = "Cluster1"

    vcpu = 2
    memory = 1024
    network_interface {
        label = "VM Private"
        ipv4_address = ""
        ipv4_prefix_length = 24
        ipv4_gateway = ""
    }
     disk {
        datastore = "san1"

        template = "DansTfTest/danTestTemplate"
        iops = 500
    }

    disk {
        size = 1
        iops = 500
    name = "one"
        datastore = "san1"

    }
    disk {
        size = 1
        iops = 500
    name = "two"
        datastore = "san1"

    }
    disk {
        size = 1
        iops = 500
    name = "three"
        datastore = "san1"

    }
}
2016/08/15 16:10:50 [DEBUG] template=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"

%s
    vcpu = 2
    memory = 1024
    network_interface {
        label = "%s"
        ipv4_address = "%s"
        ipv4_prefix_length = %s
        ipv4_gateway = "%s"
    }
     disk {
%s
        template = "%s"
        iops = 500
    }

}
2016/08/15 16:10:50 [DEBUG] template config=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"

    datacenter = "FTC"
    resource_pool = "Cluster1"

    vcpu = 2
    memory = 1024
    network_interface {
        label = "VM Private"
        ipv4_address = ""
        ipv4_prefix_length = 24
        ipv4_gateway = ""
    }
     disk {
        datastore = "san1"

        template = "DansTfTest/danTestTemplate"
        iops = 500
    }

}
2016/08/15 16:10:50 [WARN] Invalid log level: "all". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
--- PASS: TestAccVSphereVirtualMachine_updateDisks (140.83s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/vsphere    140.868s

@stack72
Copy link
Contributor

stack72 commented Aug 16, 2016

Thanks for this @dkalleg :) Glad to see that the test results help find a potential issue!

P.

@stack72 stack72 merged commit 70589ff into hashicorp:master Aug 16, 2016
kwilczynski pushed a commit to kwilczynski/terraform that referenced this pull request Aug 18, 2016
…rp#8075)

This is a fix to allow use of datastores that are part of a datastore
cluster using the syntax  <datastore cluster name>/<datastore name>
@ghost
Copy link

ghost commented Apr 21, 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.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/vsphere waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants