Skip to content

[Workloads] Add support for multiple additional disks to the VM module - #28

Merged
HiranAdikari merged 1 commit into
wso2:mainfrom
HiranAdikari:feature/multi-disk-support-vm
Apr 2, 2026
Merged

[Workloads] Add support for multiple additional disks to the VM module#28
HiranAdikari merged 1 commit into
wso2:mainfrom
HiranAdikari:feature/multi-disk-support-vm

Conversation

@HiranAdikari

@HiranAdikari HiranAdikari commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Purpose

The current workloads/vm module only supports a single root disk. This PR enables attaching multiple additional disks to the virtual machine.

Goals

  • Add support for multiple additional disks via a new additional_disks variable.
  • Use a dynamic disk block in the harvester_virtualmachine resource.

Approach

  • Introduced additional_disks variable as a list of objects.
  • Implemented a dynamic disk block that iterates through additional_disks.
  • Maintained backward compatibility for the root disk.

User stories

As a developer, I want to attach additional data disks to a Harvester VM so that I can separate OS and data storage.

Release note

Enables the attachment of multiple additional disks to virtual machines in the workloads/vm module.

Automation tests

  • Verified with terraform validate in a consumer project.

Summary by CodeRabbit

Release Notes

  • New Features
    • Virtual machine module now supports attaching additional disks with customizable properties including name, size, image source, and auto-deletion settings.

@HiranAdikari
HiranAdikari force-pushed the feature/multi-disk-support-vm branch from 1e6009a to 9f7b2bf Compare April 2, 2026 07:34
@wso2 wso2 deleted a comment from coderabbitai Bot Apr 2, 2026
@HiranAdikari
HiranAdikari merged commit dccbd51 into wso2:main Apr 2, 2026
3 checks passed
@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad726ec6-8349-4c4d-aa77-f5bc46040cad

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae2a82 and 9f7b2bf.

📒 Files selected for processing (2)
  • modules/workloads/vm/main.tf
  • modules/workloads/vm/variables.tf

Walkthrough

The changes introduce support for attaching additional disks to Harvester virtual machines. A new input variable additional_disks accepts a list of disk configurations, and a corresponding dynamic disk block in the VM resource provisions supplemental storage while preserving the existing root disk.

Changes

Cohort / File(s) Summary
Additional Disks Support
modules/workloads/vm/variables.tf, modules/workloads/vm/main.tf
Added additional_disks input variable with optional image and auto_delete fields (defaults to empty list). Implemented dynamic disk block in the VM resource that iterates over additional_disks configurations to attach supplemental disks with virtio bus type. Root disk block remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit's ode to storage growth,
More disks now dance in dynamic cloth,
With virtio speed and names so grand,
The VM spreads across the land! 🌾

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants