Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk bandwidth in VM resource #1771

Open
zaval1976 opened this issue Feb 13, 2025 · 2 comments
Open

Disk bandwidth in VM resource #1771

zaval1976 opened this issue Feb 13, 2025 · 2 comments
Labels
🐛 bug Something isn't working ⌛ pending author's response Requested additional information from the reporter

Comments

@zaval1976
Copy link

Describe the bug
After first applied some variables in block speed in block disk, not possible add or change other/added variables.

To Reproduce
Steps to reproduce the behavior:

  1. Add in exist VM the speed variable - iops_read for example:
   ---
vm-test-vzaval-2222:
- hostname: "vm-test-vzaval-2222"
  node_name: "pmx-test2"
  cpu_cores: "2"
  memory_dedicated: "2"

  initialization:
  - ip_config:
    - ipv4:
      - address: "10.60.50.31/22"
        gateway: "10.60.50.1"

  network_device:
  - bridge: vmbr0

  disk:
  - interface: "virtio0"
    size: "3"
    speed:
    - iops_read: 10

  serial_device:
  - device: socket
  1. terragrunt run-all plan - is good
   09:08:32.682 STDOUT terraform:       ~ disk {
   09:08:32.682 STDOUT terraform:             # (14 unchanged attributes hidden)
   09:08:32.682 STDOUT terraform:           + speed {
   09:08:32.682 STDOUT terraform:               + iops_read            = 10
  1. After apply
Image
  1. Change iops_read:
     speed:
     - iops_read: 100
  1. terragrunt run-all plan
Image

Please also provide a minimal Terraform configuration that reproduces the issue.

resource "proxmox_virtual_environment_vm" "this" {
  for_each = merge([
    for vms in local.data: {
      for vm in vms: vm.hostname => vm
    }
  ]...)

----------------

  dynamic "disk" {
    for_each = each.value.disk

    dynamic "speed" {
        for_each = try({
          for speed_key, speed_value in disk.value.speed : speed_key => speed_value
          if speed_value != []
          }, []
        )

        content {
          iops_read            = lookup(speed.value, "iops_read", null)
          iops_read_burstable  = lookup(speed.value, "iops_read_burstable", null)
          iops_write           = lookup(speed.value, "iops_write", null)
          iops_write_burstable = lookup(speed.value, "iops_write_burstable", null)
          read                 = lookup(speed.value, "read", null)
          read_burstable       = lookup(speed.value, "read_burstable", null)
          write                = lookup(speed.value, "write", null)
          write_burstable      = lookup(speed.value, "write_burstable", null)
        }
      }

Expected behavior
I'm expect changing the iops_read variable

  • Single or clustered Proxmox: clustered
  • Proxmox version: 8.3.3
  • Provider version (ideally it should be the latest version): 0.70.0
  • Terraform/OpenTofu version: TF - 1.9.8 Terragrunt - 0.69.1
  • OS (where you run Terraform/OpenTofu from): Alpine 3.20.3
  • Debug logs (TF_LOG=DEBUG terraform apply):
@zaval1976
Copy link
Author

Workaround

Delete ALL speed variables and add needed valiables with needed values.
But this not a good.

@bpg
Copy link
Owner

bpg commented Feb 15, 2025

Hey @zaval1976 👋🏼

It’s not quite clear from the examples — when you mention the "existing VM," was it created using the provider or imported? If it was created, was it built from scratch with a new disk from an image, or cloned from a template?

@bpg bpg added the ⌛ pending author's response Requested additional information from the reporter label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ⌛ pending author's response Requested additional information from the reporter
Projects
Status: 📥 Inbox
Development

No branches or pull requests

2 participants