Add support for specifying storage pool when creating a disk. #18273
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add field
storage_pool
togoogle_compute_disk
resource to support creating disk with the storage pool in which it will reside.Instead of adding a resource for storage pool and using resourceRef to let disk reference it, we add the field as a string which will contain the URL for a storage pool. The main reason for this decision is that if we add storage pool as a resource, and in the scenario that users want to destroy a storage pool, Terraform will plan to delete all disks first and then delete the storage pool, which we definitely want to prevent from happening.
Therefore, we eventually decided to not support creating storage pool via Terraform, and only support adding the field for disks to specify existing storage pool. The management of storage pool itself will remain through GCP APIs.
Derived from GoogleCloudPlatform/magic-modules#10793