-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Terraform vSphere provider Windows support #5490
Comments
@phinze @supernomad I really need help on this. This isn't stated in the docs at all. Does anyone have any idea on how to make this work? Looking more into the code and vSphere API to see what I can come up with. From what I can tell the most you can do is this or the value is not picked up:
Any nested mapping will not be recognized by Terraform |
I'm attempting this with some Windows and Linux vm's as well and noticing the same thing. As long as the key doesn't have any dots in it the matching value will be populated. As soon as you add in dots the value gets dropped. Admittedly I've really only done this kind of thing with ruby, but I attempted to troubleshoot some. Inserting a debug line before Line 338 in resource_vsphere_virtual_machine.go printing out vL the values are dropped by this point. I'll be honest I don't have enough experience in Go yet to know why this is happening or to come up with a fix myself. I believe this part is related to Issue 5933. The test for custom_configuration_parameters looks to only be testing keys with no dots as well. More related to windows specifically, like @supernomad mentioned initially Windows isn't supported in this provider yet, it looks like the provider is using CustomizationLinuxPrep and doesn't have a differentiation between Windows and Linux in order to call CustomizationSysprep. This is about as far as I've gotten trying to get this to work short of passing no custom parameters since all the ones I need have dots in them. I know this doesn't solve the issue, but hopefully it helps anyone with more Go experience than I come up with a fix. |
@rossedman good catch on the guest_id, I missed that one. I'm fairly familiar with CustomizationLinuxPrep in ruby, I usually just check the doc you sent. It's pretty limited for Linux, it's well represented in provider go code actually. CustomizationSysprep is bit different in that it takes CustomizationUserData and CustomizationIdentification where your typical sysprep settings like joinDomain, can be set. |
@rossedman I'm not really sure how to implement any of what I mentioned above in Go so if there's any specific information about the vsphere api I can help with I'd be happy to. |
@pimpajr Yeah, I am trying to build Terraform using these objects but it isn't recognizing them. Do you have any good resources on learning about some of these deeper prep stuff? Would really like to solve this even if its partial. I know VMWare's guest customizations are pretty deep |
@pimpajr This look like its literally just nesting the objects that the vSphere API uses. Here is an example: Linux:
Windows:
|
@rossedman I see what you're saying now. Best I can find is https://raw.githubusercontent.com/vmware/govmomi/master/vim25/types/types.go and search for CustomizationSysprep. |
@pimpajr I got a different error running this. Made it past the spec.identity stuff so I am guessing I am on the right track just need to provide all required properties. |
I believe the dot issue is the same as #2143. |
Can I get some feedback on #6087 from interested parties? Works on my machine, want to get it ready for prime-time |
@aheeren You are a saint. This looks much better than what I was working on. I will pull yours and build and test as well |
Closed via #6087 |
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. |
So I realized a bit too late that Windows is just not supported on the current version of the vSphere provider.
However it seems like it could be with proper use of
custom_configuration_parameters
, but I can't seem to figure out what the syntax should be. I have taken a few different routes to no avail and was curious if anyone had some insight.I have tried the following:
The text was updated successfully, but these errors were encountered: