Skip to content

demos/terraform: Improve MicroCloud resource naming - #1428

Merged
roosterfish merged 4 commits into
canonical:mainfrom
mseralessandri:microcloud_resource_naming
Jul 3, 2026
Merged

demos/terraform: Improve MicroCloud resource naming#1428
roosterfish merged 4 commits into
canonical:mainfrom
mseralessandri:microcloud_resource_naming

Conversation

@mseralessandri

Copy link
Copy Markdown
Contributor

This PR avoids hardcoding the bridge variable name to microbr0, so deployments can use different network names such as microbr1 when 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

@mseralessandri mseralessandri changed the title Improved MicroCloud resource naming demos/terraform: Improve MicroCloud resource naming Jun 25, 2026
@roosterfish
roosterfish requested a review from Copilot June 26, 2026 07:20
Comment thread demos/terraform/variables.tf

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_start to support offset-based disk numbering.
  • Refactored locals/resources to carry disk_number through to LXD volume names and storage-related outputs.
  • Renamed the lxd_network Terraform resource label to avoid hardcoding microbr0.

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.

Comment thread demos/terraform/variables.tf
Comment thread demos/terraform/outputs.tf
Comment thread demos/terraform/main.tf
Comment thread demos/terraform/main.tf
@mseralessandri
mseralessandri force-pushed the microcloud_resource_naming branch 2 times, most recently from 648bfde to baf97a3 Compare July 2, 2026 10:05
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
mseralessandri force-pushed the microcloud_resource_naming branch from baf97a3 to 7eca354 Compare July 3, 2026 07:26
@mseralessandri
mseralessandri marked this pull request as ready for review July 3, 2026 11:41

@roosterfish roosterfish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I like that we don't anymore carry a vm_count as this is implied already by vm_names.

@roosterfish
roosterfish merged commit 8b22013 into canonical:main Jul 3, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants