Replies: 2 comments
-
Hi @Xel-Naha, There is a Proxmox API to check whether a container/VM is currently locked. However, it's not easy to implement a reliable lock management mechanism in the provider. The problem is that the lock check and clone start can't be done atomically, so there are always two separate calls: one to check if the template is locked and another, if it is not, to start the clone. Therefore, with parallel execution, there is always a chance that while one resource is moving from a successful lock check to start cloning, another resource could squeeze in and start its own clone operation. We could implement some specific error handling and retry mechanism to mitigate this situation, but to be honest, I don't see good value in this feature, as it would achieve virtually the same result as |
Beta Was this translation helpful? Give feedback.
-
hi @bpg that seems sensible and works ok for now :) |
Beta Was this translation helpful? Give feedback.
-
hi all,
before I raise this as a bug, i thought it would be good to get some views. I am currently working on a terraform plan which clones a variable number of CT containers. Cloning puts a lock on the proxmox template and only a single clone can be created at a time.
Terraform runs 10 parallel threads and as such they seem to interfere with one another and the first clone gets build, with all subsequent clones running into errors due to the lock. Is this expected behaviour or would we consider this is a bug? there is a workaround with invoking terraform apply -parralellism=1?
thoughts?
Beta Was this translation helpful? Give feedback.
All reactions