Persistent Disk Storage Pool Support for vm-instance#5984
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the vm-instance module by adding support for Google Cloud Persistent Disk Storage Pools. These changes allow users to provision both boot and secondary disks within specific storage pools, providing greater flexibility and control over disk resource management in Google Cloud environments. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for storage pools in the vm-instance module, introducing a disk_storage_pool variable for the boot disk and a storage_pool attribute for additional persistent disks. The review feedback recommends using the google-beta provider for the additional disks resource to avoid schema validation errors on older google provider versions, and suggests adding lifecycle preconditions to ensure storage pools are only used with compatible Hyperdisk types. Additionally, the feedback advises updating the variable descriptions to document this Hyperdisk requirement clearly.
…isk precondition validation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring storage pools on both boot disks and additional persistent disks within the vm-instance module, updating the module to use the google-beta provider for additional disks. The feedback recommends adding a lifecycle precondition to the google_compute_instance.compute_vm resource to ensure that disk_storage_pool is only specified when the boot disk is a Hyperdisk type, ensuring consistent validation across all disk configurations.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for storage pools on boot disks and additional persistent disks in the vm-instance module, restricting their use to Hyperdisk types via Terraform preconditions. The feedback identifies an issue where the precondition for additional disks would fail if a storage pool is specified but the disk count is zero, and suggests a fix to only enforce the validation when disks are actually being provisioned.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring storage pools on both the boot disk and additional persistent disks within the VM instance module, ensuring that storage pools are only used with Hyperdisk types via new Terraform preconditions. The review feedback suggests using try() blocks when referencing attributes of additional_persistent_disks in the disk resource and preconditions to safely handle cases where the variable is explicitly set to null, preventing potential plan-time crashes.
Currently, the vm-instance module provisions standard standalone persistent disks. This PR introduces support for Google Cloud PD Storage Pools to vm-instances
Changes:
Submission Checklist
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.