-
Notifications
You must be signed in to change notification settings - Fork 532
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
error creating LXC container - can't lock file - got timeout #1069
Comments
If i try setting parallelism to 1 with terraform apply
It says the ct already exists, but only because the apply created it. It does not exist before terraform applies. |
Same here. Happens with both count and for_each loops. If you specify vmid=0, excess containers are spawned. When you split the loop into multiple tf files for each vm, it works even with parallel execution. |
I'm getting the same error using:
resource "proxmox_lxc" "test1" {
target_node = "pve"
hostname = "test1.home.arpa"
ostemplate = "isos-ct-templates:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst"
password = var.password
cores = "4"
memory = "4096"
unprivileged = true
tags = "servers"
start = true
onboot = true
rootfs {
storage = "vm-ct-drives"
size = "8G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "192.168.60.3/24"
gw = "192.168.60.1"
tag = "60"
firewall = true
}
nameserver = "192.168.60.1"
}
resource "proxmox_lxc" "test2" {
target_node = "pve"
hostname = "test2.home.arpa"
ostemplate = "isos-ct-templates:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst"
password = var.password
cores = "4"
memory = "4096"
unprivileged = true
tags = "servers"
start = true
onboot = true
rootfs {
storage = "vm-ct-drives"
size = "8G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "192.168.60.4/24"
gw = "192.168.60.1"
tag = "60"
firewall = true
}
nameserver = "192.168.60.1"
} |
This cloud be the result of too fast consequent requests. Terraform sends an API request to get next VMID for create/clone operations. Since this request is made in parallel (or one immediately after the other), you'll get the same VMID for more than one VM/PCT requests, and then cannot create/start the second one. That VMID is already used for another VM at that point. |
I got it working by configuring the |
This makes things a bit tricky when using Example:
When you have different projects that utilize the same module, one would need to keep track of all the currently assigned |
Full error here:
According to the error, the lock file can't be locked. The container spins up just fine and is available if I access it via the console. Note, the above error happens after the ct is created:
module.worker_vms.proxmox_lxc.container[0]: Creation complete after 24s [id=hv01/lxc/1000]
(it's called VM, but it's actually a ct)The text was updated successfully, but these errors were encountered: