demos/terraform: Improve MicroCloud resource naming - #1428
Merged
roosterfish merged 4 commits intoJul 3, 2026
Conversation
roosterfish
requested changes
Jun 26, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the Terraform demo to make network and disk resource naming more configurable, aiming to support non-default bridge names and custom starting indices for VM/disk numbering so the demo can be reused across multiple deployments on the same host.
Changes:
- Added
disk_number_startto support offset-based disk numbering. - Refactored locals/resources to carry
disk_numberthrough to LXD volume names and storage-related outputs. - Renamed the
lxd_networkTerraform resource label to avoid hardcodingmicrobr0.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
demos/terraform/variables.tf |
Adds disk_number_start (recommended to validate as a positive integer). |
demos/terraform/terraform.tfvars.example |
Documents the new disk_number_start variable in example inputs. |
demos/terraform/outputs.tf |
Updates storage_layout output to include disk numbers in by-id paths (currently inconsistent with preseed inputs). |
demos/terraform/main.tf |
Adds per-system disk_number, updates LXD resource naming, and refactors Ceph disk selection logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mseralessandri
force-pushed
the
microcloud_resource_naming
branch
2 times, most recently
from
July 2, 2026 10:05
648bfde to
baf97a3
Compare
Signed-off-by: Maria Seralessandri <maria.seralessandri@canonical.com>
Signed-off-by: Maria Seralessandri <maria.seralessandri@canonical.com>
Signed-off-by: Maria Seralessandri <maria.seralessandri@canonical.com>
Signed-off-by: Maria Seralessandri <maria.seralessandri@canonical.com>
mseralessandri
force-pushed
the
microcloud_resource_naming
branch
from
July 3, 2026 07:26
baf97a3 to
7eca354
Compare
mseralessandri
marked this pull request as ready for review
July 3, 2026 11:41
roosterfish
approved these changes
Jul 3, 2026
roosterfish
left a comment
Contributor
There was a problem hiding this comment.
Thanks. I like that we don't anymore carry a vm_count as this is implied already by vm_names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR avoids hardcoding the bridge variable name to
microbr0, so deployments can use different network names such asmicrobr1when needed.It also supports custom VM numbering (for example
micro5,micro6,micro7,micro8) with matching disk naming (i.e.local7,remote7...), making the demo reusable in environments where lower indexes are already occupied for multiple MicroCloud deployments on the same host.Checklist