Having trouble creating multipile vm with terraform

Sm0rezDev

Member
Aug 1, 2019
7
0
21
22
So I tried to store my vm in a storage I created inside my zfspool as dataset and add it as a directory storage in proxmox called vm-data, This caused an error: clone failed: can't lock file '/var/lock/pve-manager/pve-storage-vm-data' - got timeout

But doesn't happen if I use my zfspool storage , I wanted to use directory storage because of qcow2 format I wanted to use instead of raw
 
Probably you are using template? Because, when you create vm via template it locks it(atleast for me for terraform).
 
Proxmox should be enhanced to take a shared Read Lock when Cloning a VM from a Template. This would free up parallel cloning in Terraform using count loops.

Running single clones runs just fine. It's when there are more than 1 VM to be created.

ERROR
Code:
create full clone of drive ide0 (nvme-zfs:vm-1000-cloudinit)
trying to acquire lock...
 OK
create full clone of drive scsi0 (nvme-zfs:base-1000-disk-0)
trying to acquire lock...
trying to acquire lock...
 OK
TASK ERROR: clone failed: can't lock file '/var/lock/pve-manager/pve-storage-local-zfs' - got timeout



Terraform APPLY
Code:
proxmox_vm_qemu.proxmox_vm[1]: Creating...
proxmox_vm_qemu.proxmox_vm[0]: Creating...
proxmox_vm_qemu.proxmox_vm[2]: Creating...
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [10s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [10s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [10s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [20s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [20s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [20s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [30s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [30s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [30s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [40s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [40s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [40s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [50s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [50s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [50s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [1m0s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [1m0s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [1m0s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [1m10s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [1m10s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [1m10s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [1m20s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [1m20s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [1m20s elapsed]
proxmox_vm_qemu.proxmox_vm[1]: Still creating... [1m30s elapsed]
proxmox_vm_qemu.proxmox_vm[0]: Still creating... [1m30s elapsed]
proxmox_vm_qemu.proxmox_vm[2]: Still creating... [1m30s elapsed]
╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.proxmox_vm[2],
│   on main.tf line 4, in resource "proxmox_vm_qemu" "proxmox_vm":
│    4: resource "proxmox_vm_qemu" "proxmox_vm" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.proxmox_vm[1],
│   on main.tf line 4, in resource "proxmox_vm_qemu" "proxmox_vm":
│    4: resource "proxmox_vm_qemu" "proxmox_vm" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.proxmox_vm[0],
│   on main.tf line 4, in resource "proxmox_vm_qemu" "proxmox_vm":
│    4: resource "proxmox_vm_qemu" "proxmox_vm" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
 
Update: I rebooted and the lock cleared, but then was recreated, but it seems to be playing nice and I can now run Terraform creations using the count loop.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!