Skip to content

Error: error updating VM: received an HTTP 500 response - Reason: can't lock file '/var/lock/qemu-server/lock-101.conf' - got timeout #995

@CultureLinux

Description

@CultureLinux

Hello,

First of all, thanks for your amazing provider 👍

Describe the bug
When cloning multiple vm, the execution get a 500 error to acquire lock even with all timeout_* set to 600
Using the same main.tf always works with only one vm(<20sec).

Tested on last versions of Opentofu/Terraform/Proxmox/bpg provider

To Reproduce
Steps to reproduce the behavior:

  1. Create a resource : (see below)
  2. Run : tofu init && tofu plan && tofu apply
  3. See error
resource "proxmox_virtual_environment_vm" "debian_vm" {
  for_each = {
    for index,vm in var.all_vm_config:
    vm.name => vm
  }

  # Warning default timeout seems to be around 20sec
  timeout_clone = 600
  timeout_create = 600
  timeout_start_vm = 600
  timeout_shutdown_vm = 600
  timeout_stop_vm = 600
  timeout_reboot = 600

  name        = each.value.name
  description = "Managed by opentofu"
  tags        = ["opentofu", each.value.name]
  node_name = var.target_node
  clone {
    vm_id = each.value.vmid2clone
  }

  cpu {
    cores = each.value.cpu
    type = "host"
    numa = true
  }
  memory {
    dedicated = each.value.ram
  }
  network_device {
    bridge = "vmbr0"
    model = "virtio"
  }

  efi_disk {
    datastore_id = "ssd-front"
    file_format = "raw"
    type    = "4m"
  }

  disk {
    datastore_id = "ssd-front"
    file_format = "raw"
    interface = "scsi0"
    size = each.value.size
  }


  operating_system {
    type = "l26"
  }
  machine = "q35"
  agent {
    enabled = false
  }

  initialization {
    ip_config {
      ipv4 {
        #address = "192.168.1.180/24"
        address = format("%s%s%s","192.168.1.",180 + tonumber(each.value.idx), "/24")
        gateway = "192.168.1.1"
      }
    }
    user_account {
      keys     = [var.ssh_key]
      password = "tofu"
      username = each.value.name
    }
  }
}

Expected behavior
The apply part should stop after 600 secs and not 20 secs

Screenshots
Screenshot from 2024-01-31 14-17-25

Additional context

  • Single or clustered Proxmox: single instance 8.1.4
  • Provider version (ideally it should be the latest version): bpg/proxmox v0.46.1 (signed, key ID DAA1958557A27403)
  • Terraform version: terraform version Terraform v1.7.1 on linux_amd64
  • OpenTofu version : tofu version OpenTofu v1.6.1 on linux_amd64
  • OS (where you run Terraform from): rocky9 amd64
  • Debug logs (TF_LOG=DEBUG terraform apply):

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions