-
Notifications
You must be signed in to change notification settings - Fork 452
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
r/virtual_machine: Re-written resource, adding several features and data sources #244
Conversation
255.255.255.0). | ||
* `ipv6_address` - (Optional) The IPv6 address assigned to this network adapter. If left | ||
blank or not included, auto-configuration is used. | ||
* `ipv4_netmask` - (Optional) The IPv6 subnet mask, in bits (example: `32`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't that be ipv6_netmask
?
Thanks @mjrider - corrected now! |
helo @vancluever it looks like a very big change, and the upgrading is ust like importing without the import, and the warnings on importing and the confusing diffs for disks, it might be usefull to add an extra document which walks thru the upgrade with examples of diffs plan wil give, and the important parts to look for highlighted. with what i read just now, i would not upgrade or delay that as long as possible. which is counter productive because it fixes so many issues and cornercases. |
Hey @mjrider, sorry that this is seeming unworkable for you. Hopefully I can address some of your concerns:
Lastly, hopefully this is the last major fundamental change to how the resource operates for the most part - this means that future schema upgrades will be much less drastic and we will be able to carry settings over in state much easier. I really don't think that this kind of drastic change was avoidable, with the coupling of of a good majority of the resource to a single workflow (cloning and customization), the large amount of issues associated with the current implementation of resoruce - as you mentioned - and the high degree of "choose your own adventure", if you will, with virtual machine management in VMware as it is. I hope that you will at least give it a shot! If anything, you can spin up a lab stack from your old configuration and just give upgrading a try. You can also version lock some of your current configurations to 0.4.2 and just use 1.0.0 going forward for new work. Thanks to how we version providers now, there's nothing forcing you to upgrade - unless you need the new features, of course - but you could even connect the two using remote state. Hope this helps! |
@mjrider - just an update here, I've re-visited moving disks to lists again and have had success. The implementation is the same as far as the user is concerned, however the much more important effect is that the diff UX is much better now, only showing fields that have changed (so that if you have just changed the size, all you will see is the size), with no confusing hashes or empty left/right side values. I have also added defaults to the import and state migration functions, which removes those from the next diff, unless you are modifying settings, of course. I'm working to try and target a situation where an import or state migration causes an apply that only amounts to a update of settings in Terraform state - hopefully, just a move of the We will see if we can get there - I will be pushing the updates soon. |
@vancluever that sounds great, i we are currently on 0.2.2 (iirc) and i hold back updating to 0.4 because of the amount of issues reported here. With all the restructuring, i guess i have to update to keep getting new great features. But i will be delaying that for a while for production, which we start phasing in next tuesday . PS: for my wishlist (S)DRS rule support to keep multiple identical machines on different hosts. :) |
do you still need to update the documentation for the change in how disks work? |
Q1) is there support in this change to set the diskMode when creating a disk to "persistent" , "independent_persistent" etc ? |
@vancluever - no need to respond - I did look at your commits - looks like the diskMode capability is added to this release . Thanks |
This helps with making the API safer - there will never be a nil ResourceData or ResourceDiff object now. This change has also allowed us to allow SetRestart to be used properly in diff customization scenarios.
Didn't need that silly type switch ;P
Still applying PR recommendations.
I don't think there is anything sensitive here, but just to be safe, moving this to false.
Just to be consistent. There has been situations where tainting a resource has caused issues with zero-value defaults, but we have them in lots of places here, so if we want to not have inferred zero-value defaults anymore, we should probably do this as a larger refactoring effort.
And hence don't have an intersection set. Removed the comment implying that.
From the number of SCSI controllers that actually exist.
Hey @tombuildsstuff and @mbfrahry, thanks for the reviews. I've answered all comments inline and applied recommendations where necessary. Re: the For the part of this PR - the one place there were I want to say though that I value the feedback, and really appreciate the two of you bearing with me through all of this, given the scale of this PR. It's been a time, but I think the provider is in a much better place for the effort. Thank you VERY much! 👍 🎉 🌮 ❤️ I am just running the test suite on this (we have also added another import test to test the SCSI controller count inference that passed) and then I will be merging!!! |
You can't hot-add RAM past 3 GB if you are under 3. In the future I want to validate this limitation in CutomizeDiff, but for now we will just adjust the tests.
@vancluever Awesome work! I'm trying to wrap my head around some of the changes. Would you consider some limited office hours in the hashicorp-terraform Gitter? Or, where is the best place to ask questions about the new features where everyone can benefit from the answers? |
@jason-azze for sure! I am around on the Gitter now - feel free to @ me or DM with your questions! |
This is a very large PR that comprises all of the work necessary as part of the
vsphere_virtual_machine
rewrite.There are several new features and bug fixes in this resource. The major highlights include:
VM resource highlights
network_interface
coupling, which was a large source of crashes.New data sources
New data sources have been created as part of this work to support the new resource. These include the
vsphere_resource_pool
,vsphere_datastore
, andvsphere_virtual_machine
resource, the latter fetching information from an existing VM or template to be used as data during clone operations, mainly.The documentation has been completely re-written and contains a lot more detail about the new options and what working with the new resource looks like, so if you are looking for details, please see the file located here.
Also as part of this, TF has been re-vendored at version v0.11.0 to allow us to take advantage of the new diff customization features, that we use to help normalize sub-resource options, and validate configuration in ways that can't be done in the traditional validation and the refresh/plan phases.