Clone a vm fast and low

lokomass

New Member
Dec 21, 2022
22
0
1
Hi all
When I clone a vm with this command line :

qm clone $1 $ID --name \"$NAME\" --full --format qcow2 --storage local-lvm

It can take 5 seconds or 5 minutes sometimes
Whats happened ? I clone the same vm

Thanks
 
A full clone is just a "qemu-img" invocation on the backend. If you have a cheap consumer disk then when the cache is full - it will be very slow.
The age and fullness of the disk can also affect its performance. Finally, the overall CPU load can have an affect as well.
None of the above is PVE specific.

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: Kingneutron
@lokomass Depending on what you're trying to do, you might want to look at making a template out of the VM.

With a template VM, you can do a type of clone called a "linked clone" which doesn't copy the entire VM data for each clone. It has limitations though, such as the template being read only (no modifications allowed), so doesn't suit every situation. :)
 
My vm is a template, but I dont do a linked clone, just a full clone.
That I dont understand is why sometimes 5 seconds and sometimed 5 minutes. Cpu and ram are always free… I never find the reason
 
Post SMART stats of the ssd pls - and check your BIOS settings, your CPU is reading as core-i7 but only 1.10GHz, that's not right
 
Last edited:
@lokomass Cool, that model number is helpful. Looking that up, it's one of these:

https://www.crucial.com/ssd/p5-plus/ct500p5pssd8

As that's a consumer oriented product, my first guess is that the "slow" thing is happening after the drive has used all of it's "fast" pseudo-SLC cache.

I saw similar stuff happening when first trying out Proxmox in VMs on my local desktop. That was mostly using consumer grade SSDs, so the operations which didn't move much data were fine. But anything that was substantial in size (like copying a VM) would exhaust the SSD SLC cache then get really slow for a while until it had recovered.



Yep, this is one of the models which does the pseudo-SLC cache thing. It's super common for consumer NVMe drives. Check under the "Sustained Write Performance and Cache Recovery" section here:

https://www.tomshardware.com/reviews/crucial-p5-plus-m2-nvme-ssd-review/2

The behaviour you're experiencing matches your NVMe drive running out of the fast cache, then having to do the remainder of the copying using its much slower, native speed.
 
Last edited:
Yeesh, no wonder it's slow. I'm running proxmox on a Qotom "firewall appliance" with a 2.1GHz 8-core Atom processor with the most basic VGA output (and no audio), and my interactive Windows VMs are slow on that. Text-based and Linux instances are fine tho.

I'd say upgrade to a better CPU and better SSD if you want decently reliable speed out of it. The Qotom was a steal at 4x10Gbit ports and 5x2.5Gbit ports for under $400, but I have to keep it at kernel 5.x or the 10Gbit ports break due to a kernel-module issue.
 
Last edited:

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!