Friday, February 10, 2012

Use GUI interface to create error free CSV file for automated VM build

There are many automated VM build scripts that uses CSV file.  I've been doing many of these automated deployments at work.  Have you ever had failed automation because you mispelled templates, host name, datastores, clusters, vlan, and etc?  I have.  It is huge time sink and cleanup can be painful too.  I did a little tinkering with Primalforms to create GUI interface that pulls information directly from the vSphere and writes on to the CSV file. There is no possible way to make spelling error other than the VM name it self.  No more 2nd guessing on your CSV file integrity.

Once the CSV file is created, 2nd script builds the VM off the CSV and generates audit file after it completes the build.  Also, it is huge waste of datastore space when you keep different versions of templates just because you have different CPU, RAM, or disk sizes.  The script will resize CPU, RAM, Disk1 and Disk2 (or create new), puts it in to a folder or default folder, and puts the VM in to resource pool if you choose to do so.  Enough talking and more screenshots.

Download the CSV Build GUI script HERE
Download the CSV Automated VM build script HERE









 


At the end of the build, it generates audit for VMs that were built by the script.  I canceled the VM build that was on the screenshot...  Screenshot below is from another test build that I ran.


10 comments:

  1. The form looks very nice. What do you use to build the PowerShell GUI - Windows Form ?

    Ken.

    ReplyDelete
  2. I am impressed with the amount of time you must have put into the GUI. I assume the CSV also enables you to deploy multiple servers from a loop. However, could multiple deployments work by sending the command string directly to VCenter using your GUI (altered with an additional "Deploy" button plus code - skipping the CSV)? Would that work ? Or would it force the user to wait for each single build to complete before you could start the next new VM ? Thanks.

    ReplyDelete
  3. Worked like a charm! Thanks! Is there anyway to add Static IP, Subnet Mask, and Default Gateway entries for static IPs?

    ReplyDelete
    Replies
    1. Hi Steven,
      Thanks for visiting my blog. With new job I have, I haven't had the chance to do much update. Adding static IP is no problem from the automation perspective. I do need to go back and tweak the .NET GUI to have IP field added. I can't promise when but I will add this it to my "to do list."

      Delete
  4. Is there a way to mass deploy or more than one vm at a time?

    ReplyDelete
  5. Hi David,

    I tried running this form however after logging to the vCenter it is not fecthing the cluster / ESXi ...

    Any idea on this ???

    Thanks
    Mahesh

    ReplyDelete