PATCHED Virtual Clone Drive 18.104.22.168 ^NEW^
datastores are usually not fast and they are usually very large. no matter the access method, you have to copy the data from one volume to another. this could be hard disks, sas disks, network shares or iso files. this issue is true for both ends of the copy operation, from the storage to the vm, and from the vm to the host.
PATCHED Virtual Clone Drive 22.214.171.124
so, what about all this copy work? we are going to leverage the fact that the vhd being copied is already being accessed by the vm and we can use i/o throttling to make the copy operation run faster. for example, the datastore has a read i/o rate of 1,000,000 blocks per second and a write i/o rate of 1,000,000 blocks per second. the vhd is shared with 30 vms.
if we turn off the shared datastore for vms and enable the throttling, then the i/o rates of the vm are restricted to the read and write i/o rate of the datastore. for the example above, if we restrict the vhd to the datastore's read and write i/o rate, then the vhd won't be able to copy at 1,000,000 blocks per second; instead, it will be throttled to the datastore's read and write i/o rate. as a result, 30 copies of a 1gb file would take 60,000 seconds. that's not very fast.
however, there is a much faster way to perform the same operation and it involves leveraging hyper-v's support for virtual scsi adapters. since the whole operation is now performed within the hyper-v stack, i/o rate throttling will work just fine.
if we create a virtual scsi disk controller on the host, and give it the same i/o rates as the datastore, then the datastore operation is implicitly slowed down and the scsi disks themselves will perform the actual copy operation. that's a huge benefit, since the faster scsi disks transfer data at higher speeds.