Speeding up vCenter Template Cloning

networkingperformancevmware-esxivmware-vsphere

My VM templates are <4GB in size, and when I finish cloning them into a Virtual Machine, they are still <4GB in size:

The template:
enter image description here

The VM created from that template:
enter image description here

My ESXi machine is attached to a NAS with a 1Gbps link, the vCenter machine is running on bare metal, also attached via 1Gbps to the ESXi and NAS. If I initiate cloning the template to a VM and pop onto the NAS to check its network usage with vnstat -l, I see the 1Gbps pipe being fully used:

root@nas:~# vnstat -l
Monitoring eth0...    (press CTRL-C to stop)

   rx:     5.71 Mbit/s  7085 p/s          tx:   958.14 Mbit/s 81384 p/s

Despite this, cloning takes around 6-8 minutes:

enter image description here

Without doing too heavy of math, it would appear that this should be significantly shorter. Like < 1 minute.

What could I be doing better to speed up this provisioning time?

Best Answer

Sorry I didn't see this one when you logged it the other day, it's actually quite simple.

There's really only two modes for cloning - clone-by-host and clone-by-array.

Clone-by-host is when the host reads the template blocks and writes them back out to the new VM files. The time taken for this is heavily reliant on the speed of the network between host and array - in this case it's quite slow at 1Gbps and iSCSI adds its own overhead, obviously moving to 10/25/40Gbps would significantly increase this speed - though of course you could be limited at that level by the actual array size.

Clone-by-array is kind of simpler, the host sends some commands to the array to simply close a list of blocks, the array then gets on with the job itself. This is obviously a lot faster and reduces the impact of slower links between host and array BUT it is utterly reliant on the array supporting this kind of load. Specifically the array needs to support VMware's 'VAAI' protocols to do this. You can check for this support on VMware's Hardware Compatibility website but if your array doesn't support it then you're out of luck sorry, well unless a newer version of the software it runs suddenly starts supporting it anyway.

I hope this helps.