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

Cannot use spaces in hostname with vsphere provider since #8075 #52

Closed
hashibot opened this issue Jun 13, 2017 · 2 comments
Closed

Cannot use spaces in hostname with vsphere provider since #8075 #52

hashibot opened this issue Jun 13, 2017 · 2 comments
Labels
bug Type: Bug

Comments

@hashibot
Copy link

This issue was originally opened by @Anthonie-Smit as hashicorp/terraform#8917. It was migrated here as part of the provider split. The original body of the issue is below.


Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Terraform v0.7.3.

Affected Resource(s)

Please list the resources as a list, for example:

  • vsphere provider

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Issue description

Since ticket hashicorp/terraform#8075 there is a bug in working with Virtual Machine names that contain the space character in their name. In hashicorp/terraform#8075 the datastore references have been changed, which uses a split on the space character.

Please revert to resource_vsphere_virtual_machine.go, lines 968 to 978 and review the split on a space character please.

Expected Behavior

What should have happened?
Virtual machine should have been created, with spaces in it's object name (e.g. "ams-web-01.contoso.com (Web Server)" )

Actual Behavior

What actually happened?
The virtual machine was not created, instead Terraform spit out the message "[ERROR] Failed trying to parse disk path:"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
    N/A

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
N/A

For the moment we reverted back to Terraform Terraform v0.6.16. Due to this bug we cannot update Terraform without breaking stuff in our environment.

@hashibot hashibot added the bug Type: Bug label Jun 13, 2017
@jlindsey
Copy link

I am also experiencing this in v0.10.6. In my case, it's a space in the datastore path. However, the VM was actually created and configured properly as far as I can tell. But now running plan or apply (or any other command that triggers a state refresh) will error with a message like * vsphere_virtual_machine.centos-7-test: vsphere_virtual_machine.centos-7-test: [ERROR] Failed trying to parse disk path: [3Par Production-2] CENTOS-7-TEST/CENTOS-7-TEST.vmdk.

Sample config:

resource "vsphere_folder" "terraform" {
  datacenter = "${var.vsphere_datacenter}"
  path       = "Utility/Provisioning/Terraform"
}

resource "vsphere_virtual_machine" "centos-7-test" {
  name               = "CENTOS-7-TEST"
  hostname           = "centos-7-test"
  dns_servers        = [
    "xxx",
    "xxx"
  ]
  dns_suffixes       = [
    "xxx",
    "xxx"
  ]
  folder             = "${vsphere_folder.terraform.path}"
  vcpu               = 2
  memory             = 1024
  domain             = "xxx"
  datacenter         = "VDC"
  cluster            = "VDC/VDC-Pine"
  resource_pool      = "Utility"

  disk {
    template  = "Templates/CENTOS-7"
    datastore = "3Par/3ParTestCluster/3Par Production-2"
  }

  network_interface {
    label              = "DV VLAN 19"
    ipv4_address       = "xxx"
    ipv4_prefix_length = "24"
    ipv4_gateway       = "xxx"
  }
}

@vancluever
Copy link
Contributor

Hey all, with the release of 1.0.0 and the shift of this logic to data sources, this issue is probably dated and not necessarily relevant anymore. As such, I am closing it out - if anyone is still having issues, please feel free to open a new issue.

Thanks!

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

No branches or pull requests

3 participants