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:
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
Great function Josh, thanks for sharing.
Hi,
The script is really good. I'm planning to automate the process of deleting the clones as well. Could you please let me know a complete script which will delete the previous clones once the fresh clone is created. Appreciate your help in advance.
Cheers,
M
Hi Josh,
I am beginner in power CLI, I ran the scripts and it did not show any output likely because i need to supply a list of VMs which will be cloned. please let me know how to import of csv file as input. Please add that as part of script and share.
Thanks a bunch !
You'll note that the example provided on vTesseract.com is done by getting a list from a text file. You could do similar with a CSV
Import-CSV <csvfile.csv> | Select <server-name-field> | Clone-List
I wasn't able to test this at the moment but something along these lines should work.
Sorry for the delayed response. All of the clones get a prefix of "clone-" you could potentially use that to have a list for deleting.