Unfortunately, we did not have access to any type of Storage Area Network (SAN) or iSCSI network which is commonly found in an enterprise VMware environment to allow for high available through features such as vMotion. Using a SAN or iSCSI would mean virtual machines are stored not on the ESXi server, but on some type of network storage.
Because we did not have access to these technologies, we are unable to test how out script would work if these types of storage were used. With that being said, we can only support that this script works for imaging virtual machines off of storage local to the ESXi server. Meaning the virtual machines are stored on hard drives directly attached to the ESXi server.