-
Notifications
You must be signed in to change notification settings - Fork 454
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
clone from template - Having more disk sub-resources defined than exist in the template results in "index out of range" #285
Comments
Hey @jason-azze, thanks for kind words! Hopefully I can clarify here: The error you are seeing is due to there not being 2 elements in the As to why we enforce this: a template - which is supposed to be an essentially finished and sealed product ready to use as made - will more than likely fail if it gets created with less disks that it contained (say in the example of a template made with LVM). Conversely, one may want to, either immediately or on a later date, add extra disks to facilitate things like extra data storage to satisfy a specific use case. This is why we allow someone to add more disks, but not less. When working with modules, things can get a little tricky here. Unfortunately sub-resources don't necessarily scale - this has been a historic issue with Terraform and not necessarily the vSphere provider itself though. We are working towards possibly having the data source being a pretty much 1-1 pass-in of options as #283 moves So in summary, to correct what you're seeing here, you will need to (for now at least) change the resource to only have one Hope this helps! |
Thanks, @vancluever. That is very helpful guidance. In general, I'm trying to discover if I'm misusing the tool or if I've made bad architectural decisions (or both). :-) Might I suggest adjusting the language in the documentation to change "at least" to "exactly"? |
Terraform Version
Terraform v0.11.1
vSphere Provider Version
Affected Resource(s)
vsphere_virtual_machine
>disk
Terraform Configuration Files
A chunk of my "called" module.
Debug Output
Expected Behavior
In the
vsphere_virtual_machine
resource documentation, under "Additional requirements and notes for cloning" it says:This suggests that I can specify more disk sub-resources than I need but not fewer.
Why would I want to do this? Because I don't know in advance how many disks a template might have.
In this case, my template has one disk, but I have "left room" for two in my module.
I want the documentation's "at least" to be true, but it seems it's not. (Or, more likely, I'm just doing something wrong.)
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
I love all the options the new provider gives me. I just have to learn how to use them. I hope this is just a case of me having to adjust my expectations, or, and easy fix. Thank you for all of your work, Chris.
References
Not really #264. I just want to prove I searched.
The text was updated successfully, but these errors were encountered: