Strangely enough, it is necessary for the clean-up function that follows. For some reason, after we make a template from VM, its disks are still occupied for another while. Before we can delete the temporary VM, we need to wait for the disks to become unoccupied. I have decided to place the wait in this function, but it can be moved to the clean-up function, if necessary.