Clone-List Function

Version 3

    If you've been managing a virtual environment for any period of time you've probably received an email requesting that you clone a long list of VMs prior to an upgrade.  I have received this request a variety of times and decided this needed to be automated.


    The function performs the following tasks:

    • Clones each VM with suffix "clone-"
    • Places the cloned VM in the same folder as the original to maintain permissions for application owners.
    • Assigns clone to random host within the cluster. This was done in case the clones needed to be started up on a cluster where DRS is not enabled or available.
    • Sets clone to Thin provisioned disks
    • Works for live and cold clones
    • Runs Asynchronously so it will initiate multiple clones simultaneously
    • Ability to set parameters if you wish to target the clones to a different folder, datastore, or Thick disk.


    I've used this function several times and has saved me a ton of time.  Hope it helps you as well.

    Thanks

    Josh

    http://www.vtesseract.com/post/16447807254/clone-list-powercli-function