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 Set different hostname of a VM than name #14769

Closed

Conversation

ewypych
Copy link
Contributor

@ewypych ewypych commented May 23, 2017

Fixes: #14659

With this version, one can set different hostname (during the OS customization) than a VM name. If "hostname" variable isn't set, the "name" will be used in the customization process. "Hostname" is optional.

Tested on my vSphere Lab (both scenarios), everything works as expected. Of course, there is another acc test created. Output:

$ make testacc TEST=./builtin/providers/vsphere/ TESTARGS='-run=TestAccVSphereVirtualMachine_hostname'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/23 20:31:14 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/vsphere/ -v -run=TestAccVSphereVirtualMachine_hostname -timeout 120m
=== RUN   TestAccVSphereVirtualMachine_hostname
2017/05/23 20:31:25 [DEBUG] template=
resource "vsphere_virtual_machine" "foo" {
    name = "terraform-test"
    hostname = "testterraform"

%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
    }

}
--- PASS: TestAccVSphereVirtualMachine_hostname (376.23s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/vsphere        376.254s

Please review and tell me if it's anything more I should do.

@ewypych
Copy link
Contributor Author

ewypych commented Jun 3, 2017

Hello!
Could someone update me with this PR? :)

@ewypych
Copy link
Contributor Author

ewypych commented Jun 13, 2017

@ewypych ewypych closed this Jun 13, 2017
@ghost
Copy link

ghost commented Apr 9, 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 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can't set different hostname with vsphere provider
2 participants