-
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
Since provider 6.3.0 boot_disk.initialize_params.resource_policies is available and force rebuilt #19735
Since provider 6.3.0 boot_disk.initialize_params.resource_policies is available and force rebuilt #19735
Comments
I don't think there's anything we can do on the provider side here. This is just how Terraform works. As new fields are added to Terraform they are tracked by the resource, so Terraform will start to manage them. You can add ignore_changes to prevent this for specific fields: |
Yes, terraform start to manage them, but I would like the resource not being rebuilt for a change of this field |
Adding this as an enhancement rather than a bug then |
Closed by GoogleCloudPlatform/magic-modules#11753 |
Reopening as not wanting permadiff =/= not wanting a force new |
Note from triage: Initially we thought that it's valid to have initialize_params for boot_disk force resources to be recreated when they change, as the initialize params arguments control when a resource is first made. Changing those values implies wanting to recreate a resource using new inputs. However if these values are being impacted by using snapshots with the disk we'd like the service team to investigate further. |
Hi @SarahFrench I'm currently working on closing the feature gap between the API and the provider on disks. Specifically talking about Also bringing this up as there are a few features that are blocked due to the fact that |
I've moved off the Google provider project and want to avoid getting into the weeds - @slevenick could you help here? |
Is the idea to add a new field That's possible, and we have something similar in
Sounds like we need |
Here is the
I haven't tested this because this would require a lot of logic to support and i'm in the talks with the disks API team if it does work as described (not bugged etc.). But the basic idea could be that instead of Forcing a new VM on update we could make
This is difficult to manage because of our syntax. I see 2 ways out of this. Either we normalize our fields with the API (confusing to the users) or have an external schema for initialized params that's just passed down to the main schema 3 times. Same with helper functions and so on. This field doesn't have any differences no matter the type. It can just throw different API erros on different disk types. Still the core of the issue here is that instance gets recreated when initialize_params is updated. This should only recreate the disk in question. This is the ideal scenario but then the user wouldn't be informed in a good way that the data from the disk is being ereased. That's why the ForceNew on |
Can we just expose onUpdateAction to users, default it to USE_EXISTING_DISK (which I assume is the current behavior?) and remove ForceNew: true? My expectation is that a user trying to update their initialize_params would receive an error unless they specifically set RECREATE_DISK, which seems like what we want. |
Yes this is a field in the instance JSON payload. It is supported within the Go compute packages etc. so no problem implementing it.
Yes
Yes, Initialize params will force a recreation of the disk but on the API's side and only when there is a change on initialize params. There is one problem with this. I think that the |
Community Note
We deployed since years a Cloud Function to automatically associate a snapshot schedule each time a GCE is started in our GCP organzation. Whatever the way : console or terraform.
It appears the associated schedule is setup in the resource_policies field of the GCE.
With this new feature, all our GCE are planed to be rebuilt because our existing code do not manage it (normal, it was not availabled before) and the property is not empty on all our GCEs.
Terraform Version & Provider Version(s)
Terraform v1.7.2 on x86
Affected Resource(s)
google_compute_instance
Terraform Configuration
Debug Output
Expected Behavior
The GCE should not be rebuilt with such parameter change. In particular for a snapshot schedule setting
Actual Behavior
The GCE are rebuilt
Steps to reproduce
terraform apply
Important Factoids
We deployed since year a Cloud Function to automatically associate a snapshot schedule each time a GCE is started in our GCP organzation. Whatever the way : console, gcloud or terraform.
It appears the associated schedule is setup in the resource_policies field of the GCE.
With this new feature, all our GCE are planed to be rebuilt because our existing code do not manage it (normal, it was not availabled before) and the property is not empty on all our GCEs.
References
No response
b/372018525
The text was updated successfully, but these errors were encountered: