Archive for the ‘VMware’ Category

Had to do a bunch of SDRS migrations recently. This was in a 5.5 environment, so I’m not sure if this has been fixed in 6.0+, but when you kick off a heap of SDRS migrations in a row, vCenter doesn’t seem to factor in the impact of the already queued migrations. You can quickly find yourself with way too many VMs on a datastore or even worse, a 100% full store. I use this script to run migrations one after the other, without having to baby sit it. It also ensure you don’t overload either the source or destination stores. (more…)

Advertisements

This has been useful for a few clients to quickly show them a table of their vCPU to Logical CPU contention ratio across their clusters. The lCPU count does include hyper-threading, but you could easily adjust the script to only use physical core count if you wanted. (more…)

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…)