-
Notifications
You must be signed in to change notification settings - Fork 114
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
Using user_data on resource.nutanix_virtual_machine yields immediate diff after initial apply #69
Comments
Also, let me know if the initial diff/resize CDROM problems should be split into separate issues. |
Good morning,
You can give a try to my fork on: Maybe is not the best option but as we're not using cdrom drives at all, using this little patch is a good option for us. |
We've just hit the same problem, I've @rxacevedo workaround but that does feel very dirty and I feel it shouldn't be necessary. |
We just updated to 5.11.2.1 and since then, the workaround above no longer works for us. When creating an new VM, the following error shows up.
Before we updated, we were at least able to create a VM, but since then, we can no longer perform the change. I'm assuming that something has changed in the pre-checks for creating a VM. |
I did find a work around for this, but it required me to clone the current Nutanix provider from Hashicorp and then take the file modified in the branch https://github.com/Jorge-Holgado/terraform-provider-nutanix/tree/ignore_cdromide and recompile it. My Terrafrom config and deployment uses Docker images, so it's a real pain to have to clone and compile the provider now, but it does get my production environment back up and running. |
@nutanix @JonKohler please fix this, our production environment is impacted by this. |
Hey @phthano - thanks for reaching out. I pinged the internal folks who overseen terraform things these days, as I haven't been a maintainer on this for quite a while. Happy to make that connection tho to get their eyes on this. |
What is the future of this provider? This issue has been open for almost a year. The provider's last release was Sept 2019. The README states it is still a technology preview and is very light on examples and documentation. We are evaluating moving from VSphere to AHV and we rely heavily on Terraform for our automation. This bug and other nuances on how this provider works has me questioning if this platform (AHV) is ready for automation via terraform. |
Hey @piontekdd - Thank you for reaching out - I've poked the internal team that oversees our various thirdparty integrations with some hot pokers to see whats up. If you'd like, ping me [email protected] and I can get you connected directly with the PM in this area to talk through your use case and give you the g2 you need |
Hey all, this issue was fixed on #111 , it is now on master and it will be added to the next release. |
Describe the bug
When using
guest_customization_cloud_init_user_data
to bootstrap a virtual machine, a subsequent plan after apply yields a diff because a CDROM device is attached to the virtual machine as a means of supplying user_data to the host. This causes a few issues.Expected behavior
user_data
is provisioned onto the virtual machine in such a way that it does not create a diff on the plan.Logs
Plan/diff:
This might be fine normally, except two things:
adapter_type
cannot be removed while the VM is powered on (I got this from the Prism Central UI).resourceVirtualMachineUpdate
callschangePowerState
indiscriminately on any VM attribute update (beginning and end of function declaration), even something such as changing the hostname on an existing VM.Now, here's where things start to get weird - let's say I have the following
disk_list
:And I then add two more disks (so, index 0 and 1 are in my config, Nutanix (server) has added a CDROM device (implicitly) to my VM to inject user_data, and this device is located at index 3). So my new
disk_list
looks like:This yields the following plan:
This breaks because Nutanix tries to resize the CDROM device:
Furthermore, this actually prevents subsequent
plan
s from succeeding, returning the same error. This is because:You either have to destroy the VM (
terraform destroy -refresh=false
) or clear the error state on the object in the API by posting a new spec (I have not tried this).Versions (please complete the following information):
master
/ 5fd531b)Additional context
I can trick the provider and match what the API returns so that I don't get a diff in the plan:
But this feels dirty, and requires that the user understand the implementation details of how
user_data
is injected into the VM. I'm not sure how many users would do this before just submitting a support ticket.The text was updated successfully, but these errors were encountered: