Request from the server team to throttle the cloning of VM's. I poked around a little and didn't find anything so wrote this up quickly. It accepts the name of a template to clone from (string) and see's if there are currently any clone tasks in progress from that template. If there are, it will wait for that task to complete prior to starting the clone of the new VM. This way only 1 clone at a time from any given template can execute.
Adjust as needed.