I’m moving scripts to GitHub
Mainly because it’s cool, but the formatting of scripts in wordpress is horrible, and I need to revisit most as I found mistakes in some, what’s in GitHub has been recently tested
Many of us divide services or customers using blue folders, typically in a multi service enviroment
The following are scripts that can be run against all vms in a folder
List information for virtual machine harddisk, harddisk number, size, scsi id, and raw canonical name
This can be run against a single vm or all vms in a blue folder (use get-folder to list folder names…)
List virtual machine datastores for all vms in a blue folder
This is a really useful piece of code to extract vCenter roles and permissions to an xml file. The gain is that with the help of an xml reader it is a simple task to filter and drill down into the xml file and see how roles, users and permissions are assigned.
After a unexpected host reboot, quickly being able to list the last reboot time of vms, will help your application and systems guys to focus validation checks
The gain is that the script gives the time and date rather that the uptime, a fixed point in time is what your escalation and quality team will want to see in post-mortem review.
Changing ntp on a large number of host by hand is not my idea of being productive
Here is a script that brings together available code and will help change the ntp servers that your hosts use cluster by cluster.
VMware’s Dump Collector is a useful tool from troubeshooting PSOD and unexpected host reboots. Once you have set up the dump collector the hosts need to be configured. Jonathan Medd created a couple of really useful PowerCLI functions that can save a whole bunch of time.
Quickly locate the owner of a mac address
Modify host advanced logging settings
Create a report of DRS VMotions/ SDRS SVMotion events
Check on Lun path state for hundreds of hosts in a moment
If you are using vm cpu mhz limits, (well you shouldn’t be…*) but if you are, this might be helpful, as it allows you to see if vms are hitting the limit
yellow-bricks – limiting your vcpu
Check cpu ready values for single vm or per cluster, some of the coolest code I’ve worked on, elegant and relevant
Get virtual machine usage in mhz
During fork lift host migrations or physical switch replacement, being able to extract physical port and switch information is vital
I found this at 2 am one morning, when the network guys realized that the switches/servers hadn’t been corrected connected to the the right cables.