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

hostpci always gets updated to same value if set (if more than 4) #1541

Closed
aamkye opened this issue Sep 18, 2024 · 2 comments · Fixed by #1543
Closed

hostpci always gets updated to same value if set (if more than 4) #1541

aamkye opened this issue Sep 18, 2024 · 2 comments · Fixed by #1543
Labels
acknowledged 🐛 bug Something isn't working

Comments

@aamkye
Copy link

aamkye commented Sep 18, 2024

Describe the bug
A clear and concise description of what the bug is.
While having more than hostpci blocks in proxmox_virtual_environment_vm resource, anything above 4 blocks tries to update even if the same and already set (observed even on import).

To Reproduce
Steps to reproduce the behavior:

  1. Import/create VM with more than 4 hostpci blocks in proxmox_virtual_environment_vm resource.
resource "proxmox_virtual_environment_vm" "test" {
  vm_id     = 100
  node_name = "test"
  name      = "test.test"

  hostpci {
    device  = "hostpci0"
    ...
  }

  hostpci {
    device  = "hostpci1"
    ...
  }

  hostpci {
    device  = "hostpci2"
    ...
  }

  hostpci {
    device  = "hostpci3"
    ...
  }

  hostpci {
    device  = "hostpci4"
    ...
  }

  hostpci {
    device  = "hostpci5"
    ...
  }

  hostpci {
    device  = "hostpci6"
    ...
  }

  hostpci {
    device  = "hostpci7"
    ...
  }

  hostpci {
    device  = "hostpci8"
    ...
  }
}

Expected behavior
Everything applies as expected and the state is updated to corespondent state.

Screenshots
CleanShot 2024-09-18 at 23 25 51

Additional context
Add any other context about the problem here.

  • Single or clustered Proxmox: Single
  • Proxmox version: 8.2.4
  • Provider version (ideally it should be the latest version): bpg/proxmox v0.64.0
  • Terraform/OpenTofu version:
  • OS (where you run Terraform/OpenTofu from): TF 1.8.5
  • Debug logs (TF_LOG=DEBUG terraform apply):
Toggle me!

CleanShot 2024-09-18 at 23 38 18

https://pastebin.com/09jXN4R0
@aamkye aamkye added the 🐛 bug Something isn't working label Sep 18, 2024
@bpg
Copy link
Owner

bpg commented Sep 19, 2024

Hey @aamkye! 👋🏼

Thanks for the report. Should be relatively easy to fix.

@bpg
Copy link
Owner

bpg commented Sep 20, 2024

Based on /usr/share/perl5/PVE/QemuServer/PCI.pm, the maximum number of hostpci devices is 16, so it will be better to fix this properly, rather than hardcoding 16 fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged 🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants