Skip to content

enhance cloudstack_disk_offering resource with QoS, provisioning, and scope support - #313

Open
poddm wants to merge 8 commits into
apache:mainfrom
poddm:mp/disk_offering
Open

enhance cloudstack_disk_offering resource with QoS, provisioning, and scope support#313
poddm wants to merge 8 commits into
apache:mainfrom
poddm:mp/disk_offering

Conversation

@poddm

@poddm poddm commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Expand cloudstack_disk_offering with QoS, IOPS, and placement controls

Summary

Extends the cloudstack_disk_offering resource to cover the full createDiskOffering/updateDiskOffering API surface — storage/hypervisor QoS, IOPS throttling, domain/zone restriction, and size strictness — plus a rework of the CRUD logic and expanded test coverage.

New schema fields

  • IOPS throttling: iops_read_rate, iops_read_rate_max, iops_read_rate_max_length, iops_write_rate, iops_write_rate_max, iops_write_rate_max_length
  • Hypervisor byte QoS (nested block): hypervisor { bytes_read_rate, bytes_read_rate_max, bytes_read_rate_max_length, bytes_write_rate, bytes_write_rate_max, bytes_write_rate_max_length }
  • Storage IOPS QoS (nested block): storage { min_iops, max_iops, customized_iops, hypervisor_snapshot_reserve }
  • Placement / options: domain_id (list), zone_id (list), cache_mode, disk_offering_strictness

Behavior changes

  • Removed customized — it's now inferred from disk_size (size set ⇒ fixed offering; size omitted ⇒ customizable). The two are inversely coupled in CloudStack, so exposing both only allowed contradictory config.
  • provisioning_type / storage_type changed from Default to Computed (kept ForceNew + validation) so the API-selected value doesn't cause drift.
  • cache_mode marked Computed for the same reason.
  • zone_id semantics: empty = available in all zones; setting IDs restricts the offering. The internal "all" sentinel used on update to clear a restriction is abstracted away from users.
  • Read now handles 404s (removed offerings clear state), and domain_id/zone_id are correctly split from the comma-separated API strings.

Bug fixes (from the original branch)

  • Fixed write-rate and hypervisor QoS setters that were all pointing at the read-rate setters.
  • Update now actually calls UpdateDiskOffering (previously built params and discarded them) and no longer panics on domain_id/zone_id.

Tests

Acceptance tests: _basic, _customized, _update (expanded to cover cache_mode/display_offering), and new _qos, _options, _domain, _zone.

@poddm poddm changed the title Mp/disk offering enhance cloudstack_disk_offering Aug 12, 2026
@poddm poddm changed the title enhance cloudstack_disk_offering enhance cloudstack_disk_offering resource with QoS, provisioning, and scope support Sep 9, 2026
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.

1 participant