-
Notifications
You must be signed in to change notification settings - Fork 455
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
computed name leads to error when cloning #320
Comments
on version 0.4.2 I was using an uuid in the name of my cloned VMs and it worked well |
Hey @nvideau, this is a current limitation of how we are validating the disks, and is probably not something we will be fixing in this current minor version cycle. The reason is exactly as you mentioned it - there is a computed value there, but as we use the In 1.2.0 or 1.3.0 (time permitting) we plan on introducing a "label" field that will serve as an immutable key for a specific disk definition and deprecating I'm moving this to "bug" not necessarily to fix this, but to make sure the extra validation is there to ensure that both VM and disk name cannot be a computed value for now. The name requirement should be able to be lifted after the the aforementioned changes are made. Sorry for the inconvenience! |
@vancluever Maybe I'm misunderstanding "make sure the extra validation is there to ensure that both VM and disk name cannot be a computed value for now", but if we can't use computed names for both (to make sure the disk name matches the VM name), how do we do it? I can't hard-code 1000 VM names. :-) |
@jason-azze not all "computed" values are problematic - when I say computed, I mean the value must be known at plan-time. This generally means anything is okay in that field for interpolation except for the unknown output of a resource (ie: IDs generated from other resources, or in this case, the |
@vancluever this seems to destroy a lot of usage scenarios for this provider..? Like if we want to use computed hostnames for our vSphere machines. We just want to call them something like vsphere0-9999 or something like that. Do I misunderstand or do you have a nice way of supporting this? Thanks ;) |
To add to @maxramqvist comment; as per the process we create records in inventory/cmdb before creation of the actual VM. How do you propose we utilize this new provider for a module with terraform workspaces for example? |
Terraform Version
Terraform v0.11.1
vSphere Provider Version
provider.vsphere v1.1.0
Affected Resource(s)
vsphere_virtual_machine
Terraform Configuration Files
Expected Behavior
computed name bypassed
Actual Behavior
Error: Error refreshing state: 1 error(s) occurred:
2017/12/14 16:40:12 [ERROR] root: eval: *terraform.EvalDiff, err: disk.0: invalid disk name "" for cloning. Please rename this disk to ".vmdk"
2017/12/14 16:40:12 [ERROR] root: eval: *terraform.EvalSequence, err: disk.0: invalid disk name "" for cloning. Please rename this disk to ".vmdk"
2017/12/14 16:40:12 [TRACE] [walkRefresh] Exiting eval tree: vsphere_virtual_machine.VM
2017/12/14 16:40:12 [TRACE] dag/walk: upstream errored, not walking "provider.vsphere (close)"
2017/12/14 16:40:12 [TRACE] dag/walk: upstream errored, not walking "root"
2017/12/14 16:40:12 [DEBUG] plugin: waiting for all plugin processes to complete...
vsphere_virtual_machine.VM: 1 error(s) occurred:
vsphere_virtual_machine.VM: disk.0: invalid disk name "" for cloning. Please rename this disk to ".vmdk"
The text was updated successfully, but these errors were encountered: