-
Notifications
You must be signed in to change notification settings - Fork 116
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
nutanix_virtual_machine resource won't allow setting power_state #98
Comments
HI @mgrubb - This is an issue with Nutanix Terraform Provider and we have found a solution from our end. I'm in a discussion with the internal engineering team who deals with the provider. I shall update you as soon as we plan on how to release the fix. |
Hello @mgrubb and @Sn0d3n, we used to support this value but when we get the Hashi review we had to remove it because of the immutable philosophy behind Terraform, once you create a resource you shouldn't be able to modify the running state, you can take a look to other providers, for example, AWS and there isn't an option to change the instance state even when you can stop/pause/run via API. See: https://www.hashicorp.com/resources/what-is-mutable-vs-immutable-infrastructure |
Here is a comment over vsphere provider from Hashicorp Engineer, please take a look: hashicorp/terraform-provider-vsphere#327 (comment) |
Well, I'd still like to be able to set the state at time of creation, and then have it ignored later. I don't like that I am forced to have those resources be turned on by default. |
Hello @mgrubb , I was reading about that, could you tell me how is the user case for that to make it happen? I mean, when you want to have turned it off if you can't turn it on or something like that? to understand better |
I'm not sure how much more detail you want. I don't agree with the assertion that the terraform infrastructure should be immutable, things change all the time, like we need more memory or CPU, etc. Why should I have to destroy and recreate the VM for that change? But I guess I can live with that restriction, but it would still be nice to at least create the resources in a known given state, regardless if changing that attribute after creation has no effect. |
We'll work regarding all the attributes (such as CPU, Memory, etc..) that need to hotplug and add it to the resource logic with this we won't need to manually turn off or turn on the VM. Going to close this ticket until we get any update from Hashicorp to support manually start/stop. |
Not sure if I understood the discussion here correctly. Do I understand it correctly that |
Describe the bug
When adding the power_state = "OFF" setting to a nutanix_virtual_machine resource, the error "Error: "power_state": this field cannot be set" is given when trying to apply.
Expected behavior
The expected behavior would be one of:
If power_state is present, force that power_state on the VM
If power_state is not present, when creating the VM set power_state to OFF, when not creating, leave the power_state at it's current value.
Logs
Here is the snippet from the trace log:
2020/03/10 14:38:15 [WARN] : eval: *terraform.EvalValidateResource, non-fatal err: "power_state": this field cannot be set
2020/03/10 14:38:15 [ERROR] : eval: *terraform.EvalSequence, err: "power_state": this field cannot be set
Versions (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: