Archive for the ‘VMware’ Category

Howdy all. I have finally got my act together and have moved the blog over to our domain hosting at Please update any bookmarks or subscriptions you have, as over the next week or so I will be taking down this page.

Had a client who required in-guest iSCSI connections. After reviewing the physical NICs that were going to be available on each host, I created the following script to automate the creation of the virtual switch with associated uplinks and two portgroups. (more…)

I recently had to gather the VLAN ID information from a vCenter environment where some hosts had standard and distributed switching in use for their virtual machine networking. Unfortunately, the data for VLAN ID is located in different fields depending on the vSwitch type. So, here’s a simple script to gather both sets of into a CSV. (more…)

DRS is a great feature, but more and more, I’m finding clients who just need a very simple cluster setup, but only want to pay for vSphere Standard licenses. Well, the script below can be used to run a job that will randomize the list of VMs in a cluster and then balance them across all hosts in the cluster. This is purely a VMs/host type of balance, not a resource balance like DRS. But, I set this up to run once a week on a few client’s DEV clusters and it generally keeps things pretty even. Also very useful for post maintenance re-shuffles. (more…)

There have been a few posts around generating the direct console URLs for VMs and they all seem to use Perl. Based on the info from these posts, I have created this cut back PowerCLI version. Only tested with vCenter 5.0 and outputs to a CSV file for every VM in the environment. (more…)

While I like having VMs update their tools on reboot, it can cause some issues with running SRM testing and planned migrations, causing timeouts while waiting for vmtools. Rather than increase the timeout or go through the hassle of raising a change to updated the tools across an environment, I used the following script block to disable auto update for all the VMs and re-enable it once it came across to the other side. All credit goes to Damian Karlson for this one. Just reposting so I have my own copy. (more…)

Balance a Group of VMs Across Hosts

Posted: November 27, 2012 in Scripts, VMware

I had a scenario recently where a whole bunch of VDI machines were being created in the main production cluster, but there were 2 ESXi hosts outside the cluster that were going to be dedicated for VDI. I put together this little script for the VDI admins, so that they could just drop the list of all their VM names into a text file, run the script and the VMs would be be balanced across the dedicated VDI hosts. (more…)