[SOLVED] Parallel cloning

jan.svoboda

Member
Jun 11, 2020
32
1
13
Hello,

is there any way for parallel cloning of VMs on the same storage? Unfortunately, it seems that cloning a VM locks whole storage and it is impossible to clone another VM at the same time due to the lock.
I have Proxmox 6.2 nodes with shared storage (GlusterFS).

Thank you.
 
Hi,
no this is not possible. Locking is needed to ensure that the base volume is not deleted and that there is no naming conflict for the new volume.
 
Is there at least any possibility to check whether the storage is locked via REST API? In REST API documentation I can't see request to locks.
 
Not via the REST API, but you can check whether the directory storage-<storeid> exists in /etc/pve/priv/lock/. You should see it, while there is a clone operation running.
 
Sorry to asking again, but is there any way for parallel cloning on a shared GlusterFS storage? It would be really helpful for me.
Couldn't be a way for parallel cloning to mount a GlusterFS storage on each node via fstab instead of PVE daemon?
 
When creating full clones we actually already allow doing multiple ones in parallel. We only lock during allocating the image, not during copying. With linked clones we lock during the whole operation, but normally those should be finished quickly (since not much should need to be copied). How long does a linked clone operation take for you? How big and what format are the disks involved?
 
we do parallel full clones of same or different template from "nfs volume1" to target storage is "nfs volume 2" .
no of parallel : 20 to 30 clones at a time.
we got below error
create full clone of drive scsi0 (proxmox-images:777/base-777-disk-0.qcow2)
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
trying to acquire cfs lock 'storage-proxmox-images' ...
TASK ERROR: clone failed: cfs-lock 'storage-proxmox-images' error: got lock request timeout
 
Hi @sesaravanan,
if you're doing this many clones in parallel, the lock might be too heavily contended for every task to get the chance to get it. That said, there was a proposed patch to improve the situation. It's not applied yet, and it still couldn't really be guaranteed that every task will get it with that many tasks at the same time.