Posts

VM Storage Balancer

Image
One thing I’ve noticed in vCenter 4.0 is that it now has alarms to monitor datastore sizes and places little ‘warning’ or ‘alert’ icons.  I like it, but it also annoys me because I know I need to do clean up and make sure each of our datastores has a minimum of 20% free space.  So here we are: Move-VMStorageBalance.ps1 Summary: Running this script will attempt to storage vMotion systems in a specified cluster around to datastores that have more than x% of free space before and after the move. Systems with specified DRS rules are omitted by default.  I’ve left some defaults defined in two variables that you will need to change to work for your environment. Requirements: Powershell 2.0 PowerCLI 4.0 vCenter 4.0 or ESX 4.0 Disclaimer/Caveats: Use this script @ your own risk, I take no responsibility for any awesomeness that might occur.  Test, test, and test more. Script may be SLOW as it works against 1 VM at a time. Fast if ...

Windows 2008 IPv4 gateway keeps disappearing after reboot…

Image
Config: Windows 2008 Std/Ent Sp2 x86 Summary: After reboot of system, the system stops responding to pings and RDP. When accessing IPv4 settings, the gateway is missing, and will blank out every time. Workaround: Regedit Navigate to HKLM/System/CurrentControlSet/Services/Tcpip/Parameters/Interface/%CLSID% %CLSID% = A unique ID that is associated with each network adapter that you have on the machine. You should have one for each adapter installed on your server. Change the "DefaultGateway" Regkey and manually type in the correct IP.

Finding local networked devices via your Mac’s web browser by name instead of IP.

Image
Summary: Unable to connect to locally available network devices via their friendly name. Config: Mac OS 10.x (10.5 or 10.6) Details: I’ve found this to be only true for Macs. For example: When I try to connect to my NAS’s web admin console via the name I gave it ( http://zterastation ), my Mac cannot resolve the name. Yet, my Mac does find it by name in the list of available drives to connect to. Seems the fix is simply to append ‘.local’ to a locally available network devices friendly name. As so, http://zterastation.local . This could simply be in the way my router configures my DNS entry order, but does not seem to matter to my windows systems.

Exploring VMWare's API using PowerCLI Get-View

Image
Summary: How to explore properties of objects using PowerCLI’s Get-View cmdlet. Details: Figure out the object you want to dig in deeper about. For example, finding out all properties available about an ESX host. Declare your variable, run the get-vmhost cmdlet, then pipe that to get-view, like so: 1: $myvariable = get-vmhost myesxserver | get-view Now by simply typing $myvariable at the powershell prompt, I’ll get a return like this: If I want to find out more about what is under the “Summary” property, I can simply type $myvariable.summary then hit enter. You can continue to do dive deeper to find the information you are looking for quickly and effectively by using this method. The ‘tab’ auto-complete function also works. Cheers!

Changing Run Once entries in multiple Virtual Center customization specs...

Image
Summary: Script built to update multiple Virtual Center Windows customization scripts in one easy step. Powershell Code: http://docs.google.com/View?id=ddvthst9_15fsx7vdgb Details: I have several customization scripts that all are configured in almost the exact same way minus IP gateway settings (thus the need for many specs). I needed to add a couple more run once commands to to fix an issue we were having with McAfee ePO agents that were statically installed on templates. The agent apparently generates a unique GUID and mac address in the registry associated with the systems name. To fix this when cloning the template I needed to delete these two registry entries so ePO would regenerate new ones when the cloned template builds it would register properly with ePO. There is probably a bit more that can be done with this script, but it’s done what I need it to do for now.

Send photos from the iPhone to a Japanese Cell Phone

Image
Summary: To successfully send e-mails w/ an attached photo from an iPhone to a Japanese cell phone, the photo needs to be resized to either 640x480 or 320x240. Photos taken with the iPhone's camera do not meet these size requirements. One app that I've discovered to help with that is called MailPhotos . It's fairly easy to use and has worked fairly well in my testing. Read below for detailed information. [Update: Does not apply to all Japanese cell phones apparently. Seems to depend on a combination of phone and/or carrier. My in-laws use AU, which this app works for, my friend in Tokyo uses Docomo and has a crazy phone that works fine with the default size. ] Details: One of my main complaints with using the iPhone was the inability to send photos via e-mail to my friend's cell phones. I couldn't figure out what the issue was for the longest time, until recently when testing. Seems any photo larger than 640x480 sent to a Japanese cell-phone doesn't seem...

Gather disk.usage.average stats per Datastore

Image
Image via Wikipedia Summary: This script isn't perfect as there can be some exceptions to the rule, but it can give you an idea of how much you are utilizing to each of your datastores to determine if there might be a bottleneck. Get-DatastoreAvgUsgKBps.ps1 Details: The script first gathers your datastores, then does a get-vm to list all VM's located in that datastore. For each VM, get-stat is run to gather the disk.usage.average metric for the date range specified in the $start and $finish variables. Once that data is gathered for that VM, it takes the KBps data and mathematically averages those numbers then continues to the next VM in that Datastore. After averages for all VM's in the datastore have been calculated, they are all added up to represent the Average disk usage KBps against that datastore. This is repeated for each datastore. Exceptions: If a system has been vmotion'd to another datastore within the specified date range, the averages could be thrown off. S...