-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_compute_resource_policy Scheduler Destroys all VMs #9981
Comments
@Ariestattoo can you detail the steps to repro the issue? What is excepted and what is the actual result? |
Hi @edwardmedia I have updated the initial comment with more details |
I see there are two POST request available addResourcePolicies and removeResourcePolicies |
Also facing this issue.
Still, I would argue that this is not ideal behaviour and I can't immediately see why the provider would need to behave like this, considering that in-place modification is obviously possible via the API. I will try and test if just removing
Edit: Yeah, that was a dumb idea :). There is no actual code to check for a change and call the API. |
I have this working locally now with a small patch. Can I submit a PR or is there any procedure I need to follow? |
I opened a PR with the changes I made locally. I hope that's ok. If I need to follow any additional steps, please let me know. |
Thanks for your time on this @hanneshayashi and @edwardmedia. My understandng that Hashicorp is short staffed right now and not working through community pull requests. Hopefully soon. |
As far as I understand, that only applies to the main Terraform repo and not the providers:
Although I guess everyone at HashiCorp is pretty busy in general. If there is anything I can do to help get this merged, please let me know @edwardmedia |
@ndmckinley Since my PR was merged, should this issue be closed? |
Ah, yes, thank you! This will be released in the next release of these providers, October 4th. |
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. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v1.0.5
on linux_amd64
Affected Resource(s)
Terraform Configuration Files
Attached to instance declaration
Debug Output
Panic Output
Expected Behavior
Schedules changes and attachments to instance should update and attach
Actual Behavior
When modifying or adding an instance schedule to an instance the instance requires destruction and rebuild. Even if you use the gcloud command which does not destroy the instance
gcloud compute instances add-resource-policies VM_NAME
--resource-policies=SCHEDULE_NAME
[--zone=ZONE]
Terraform will try and incorporate the change into its state and destroy and rebuild the instance. Additionally, if you change the schedule it will also destroy and rebuild the instance.
Steps to Reproduce
Plan will destroy the instance to attach the schedule.
- resource_policies = [
- "https://www.googleapis.com/compute/beta/projects/xxxxxxx/regions/us-central1/resourcePolicies/vm-machine-state",
] -> null # forces replacement
Important Factoids
References
The text was updated successfully, but these errors were encountered: