Fix GCE instance update issue where initializeParams is sent for exis…#17972
Conversation
…ting disks (b/509846156)
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 4a2b413: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
🟢 All tests passed! View the recording VCR build log or the debug logs folder for detailed results. @mskrynnik, @shuyama1 VCR tests complete for 4a2b413! |
Fixes validation errors during
google_compute_instanceupdates for VMs usinghyperdisk-balancedboot disks.Problem Description
When performing updates on a
google_compute_instance, the provider performs a GET-modify-PUT flow. The GCE API returnsinitializeParamsin its GET responses for existing attached disks under certain conditions. When this payload is sent back duringinstances.updatePUT requests, GCE's backend validator parsesinitializeParamsas a disk creation/modification action, failing with:Provisioned IOPS cannot be specified with disk type pd-balancedSolution
This PR strips the
initializeParamsblock from all disks in the instance map (instMap) prior to sending GCEinstances.updatePUT requests. SinceinitializeParamsis input-only and cannot be updated on existing disks, removing it is safe and backward compatible.Verification
Modified
TestAccComputeInstance_hyperdiskBootDisk_provisioned_iops_throughputto include an update step (description change), and verified that it builds and passes successfully.Resolves: b/509846156
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.