Skip to content

cpu.limit should support decimal numbers like the PVE Web GUI #2343

@silenium-dev

Description

@silenium-dev

Describe the bug
proxmox_virtual_environment_vm.cpu.limit currently only allows integer values from 0 to 128. The PVE Web GUI allows decimal numbers as well to account for partial core limits.

To Reproduce
Steps to reproduce the behavior:

  1. Create a VM with a decimal value in cpu.limit
  2. Run 'terraform apply'
  3. See error Attribute must be a whole number, got 1.5

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

resource "proxmox_virtual_environment_vm" "reproducer" {
  node_name = "node"
  cpu {
    cores = 2
    limit = 1.5 # <--- Does not work
  }
}

and the output of terraform|tofu apply.

Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Attribute must be a whole number, got 1.5
│ 
│   with proxmox_virtual_environment_vm.reproducer,
│   on main.tf line 5, in resource "proxmox_virtual_environment_vm" "reproducer":
│   5:     limit = 1.5
│ 
╵

Expected behavior

The provider allows decimal values like the Web GUI.

Additional context

  • Single or clustered Proxmox: Single
  • Proxmox version: 9.0.11
  • Provider version (ideally it should be the latest version): v0.84.1
  • Terraform version: v1.13.4
  • OS (where you run Terraform/OpenTofu from): NixOS unstable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Enhancements

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions