diff --git a/builtin/providers/vsphere/config.go b/builtin/providers/vsphere/config.go index 1f6af7ffd..06deedaeb 100644 --- a/builtin/providers/vsphere/config.go +++ b/builtin/providers/vsphere/config.go @@ -16,12 +16,12 @@ const ( type Config struct { User string Password string - VCenterServer string + VSphereServer string } // Client() returns a new client for accessing VMWare vSphere. func (c *Config) Client() (*govmomi.Client, error) { - u, err := url.Parse("https://" + c.VCenterServer + "/sdk") + u, err := url.Parse("https://" + c.VSphereServer + "/sdk") if err != nil { return nil, fmt.Errorf("Error parse url: %s", err) } diff --git a/builtin/providers/vsphere/provider.go b/builtin/providers/vsphere/provider.go index 4dce81a9d..9a749a127 100644 --- a/builtin/providers/vsphere/provider.go +++ b/builtin/providers/vsphere/provider.go @@ -23,11 +23,11 @@ func Provider() terraform.ResourceProvider { Description: "The user password for vSphere API operations.", }, - "vcenter_server": &schema.Schema{ + "vsphere_server": &schema.Schema{ Type: schema.TypeString, Required: true, - DefaultFunc: schema.EnvDefaultFunc("VSPHERE_VCENTER", nil), - Description: "The vCenter Server name for vSphere API operations.", + DefaultFunc: schema.EnvDefaultFunc("VSPHERE_SERVER", nil), + Description: "The vSphere Server name for vSphere API operations.", }, }, @@ -43,7 +43,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { config := Config{ User: d.Get("user").(string), Password: d.Get("password").(string), - VCenterServer: d.Get("vcenter_server").(string), + VSphereServer: d.Get("vsphere_server").(string), } return config.Client() diff --git a/builtin/providers/vsphere/provider_test.go b/builtin/providers/vsphere/provider_test.go index bb8e4dc55..ee6995ed8 100644 --- a/builtin/providers/vsphere/provider_test.go +++ b/builtin/providers/vsphere/provider_test.go @@ -37,7 +37,7 @@ func testAccPreCheck(t *testing.T) { t.Fatal("VSPHERE_PASSWORD must be set for acceptance tests") } - if v := os.Getenv("VSPHERE_VCENTER"); v == "" { - t.Fatal("VSPHERE_VCENTER must be set for acceptance tests") + if v := os.Getenv("VSPHERE_SERVER"); v == "" { + t.Fatal("VSPHERE_SERVER must be set for acceptance tests") } } diff --git a/website/source/docs/providers/vsphere/index.html.markdown b/website/source/docs/providers/vsphere/index.html.markdown index 17448b024..7c410ae85 100644 --- a/website/source/docs/providers/vsphere/index.html.markdown +++ b/website/source/docs/providers/vsphere/index.html.markdown @@ -25,7 +25,7 @@ therefore may undergo significant changes as the community improves it. provider "vsphere" { user = "${var.vsphere_user}" password = "${var.vsphere_password}" - vcenter_server = "${var.vsphere_vcenter_server}" + vsphere_server = "${var.vsphere_server}" } # Create a virtual machine @@ -53,7 +53,7 @@ The following arguments are used to configure the vSphere Provider: be specified with the `VSPHERE_USER` environment variable. * `password` - (Required) This is the password for vSphere API operations. Can also be specified with the `VSPHERE_PASSWORD` environment variable. -* `vcenter_server` - (Required) This is the vCenter server name for vSphere API - operations. Can also be specified with the `VSPHERE_VCENTER` environment +* `vsphere_server` - (Required) This is the vCenter server name for vSphere API + operations. Can also be specified with the `VSPHERE_SERVER` environment variable.