Posts
Find LUNs Presented to Multiple Clusters
After some cluster migrations it appears that not all of the LUN presentations got cleaned up. I needed to find the LUNs that were shared by different clusters so I could determine which one they should belong to and remove access for the other cluster(s). PowerCLI to the rescue.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 param ( [VMware.
Posts
Validate Username / Password on ESX(i) Host
A simple script to validate the login credentials against an ESX(i) host. Useful when validating that the credentials are what you think they should be.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 <# .
Posts
VMware PowerCLI 5 Cmdlets by Noun
Generated using this post.
<th> Verbs </th> <td> Get,New,Remove,Set </td> <td> Get,New,Remove </td> <td> Get,New,Remove </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Get,Move,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> New,Remove,Set </td> <td> Get,Move,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Copy </td> <td> Apply,Get </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get,Move,New,Remove,Set </td> <td> Get </td> <td> Copy,Get,New,Remove,Set </td> <td> Get,Move,Remove </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Add,Get,Remove </td> <td> Get,Set </td> <td> Get </td> <td> Get,Move,New,Remove,Set </td> <td> Get,New,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get,Stop,Wait </td> <td> Get,Move,New,Remove,Set </td> <td> Dismount,Mount,Update,Wait </td> <td> Get,Remove </td> <td> Export,Get,Import,Move,New,Remove,Set,Start,Stop </td> <td> Get </td> <td> Get,New,Remove </td> <td> Get </td> <td> Get </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get,New,Remove </td> <td> Get,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Connect,Disconnect </td> <td> Get,Move,New,Remove,Restart,Set,Start,Stop,Suspend </td> <td> Get,Restart,Shutdown,Suspend </td> <td> Copy </td> <td> Get,Set </td> <td> Get,New,Remove </td> <td> Add,Get,Move,Remove,Restart,Set,Start,Stop,Suspend </td> <td> Get,New,Remove,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get </td> <td> Get,Set </td> <td> Get </td> <td> Format,Get </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Add,Get,Remove </td> <td> Get,Install </td> <td> Apply,Export,Get,Import,New,Remove,Set </td> <td> Test </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get,Restart,Set,Start,Stop </td> <td> Get,Set,Test </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Invoke </td> <td> Get,Set </td>
Posts
Simple XML output of a data object
I am doing some data collection using PowerShell and the output needs to be a simple XML document string.
The built in cmdlets do a great job when persisting data, but they produce some fairly complicated XML that provides more detail on object types than I can use.
Here is a single function to take a PSObject based data object and turn it into XML. I have also included a test function to show an example of building the data object.
Posts
Central Ohio VMUG Regional Event 2011
The regional VMware Users Group meeting for 2011 is coming up on May 17th. This was a great event last year and it looks like it could be even better this year.
So far, the named speakers are Chad Sakac, Scott Herold, and Tom Mackay.
Make sure to review the agenda and register before it fills up.
http://info.vmware.com/content/VMUG_Conference_Agenda?src=ws&ug=oh
Posts
Helpful Commands for vCenter Linked Mode Troubleshooting
Launch the command prompt via: Start | Programs | ADAM | ADAM Tools Command Prompt
dsdiag.exe /s:localhost:389 repadmin.exe /viewlist * /homeserver:localhost:389 repadmin.exe /replsummary * /homeserver:localhost:389 repadmin.exe * /repsto /homeserver:localhost:389 repadmin.exe /showconn * /homeserver:localhost:389
Posts
Quick Memory Allocation for Limit / Reservation Testing in VMware
I am testing the impact and behavior of memory limits and reservations along with balloon drivers and I needed a quick way to allocate memory in a user program.
PowerShell to the rescue. This isn’t a good method for exact memory allocation, but you can consume MBs to GBs of memory pretty quickly.
1 2 3 4 5 # Allocate memory by creating a large string. Divide the length by 4 # (Unicode size) to get an approximation of the MB allocation.
Posts
Testing TCP Network Firewall Ports from ESXi
As we all transition to ESXi there are certain activities that we need to figure out a new way of doing. One item that comes up in new deployments is making sure that all of the ESXi –> firewall rules are defined correctly.
I do not believe that there is a way to do this from the SDK so its off to Tech Support Mode. Unfortunately there is no telnet, netcat, or other network tool that I typically use.
Posts
PowerShell Asynchronous Job Queueing
Here is some sample code to have a variable size work queue for asynchronous jobs in PowerShell. The sample code uses Start-Job, but it was written as a skeleton to be able to run multiple PowerCLI tasks at once.
The variable length is beneficial in case the work should be split up, but there is a chance of overwhelming the system if too many concurrent jobs are started at once.
Posts
Basic PowerShell Registry Value Helpers
Working with registry values in PowerShell can be a little cumbersome, so here are some example helpers that I am using to simplify some of my configuration scripts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Function Get-RegistryValue { param ( $key, $value ) (Get-ItemProperty -Path $key -Name $value).
Posts
Using PowerCLI to Uninstall vCenter Extensions
After finishing a CapacityIQ evaluation we wanted to uninstall the plug-in from vCenter. VMware KB article 1025360 shows how to do this, but it requires the Managed Object Browser. Per the security hardening guide we disabled the mob so this solution would not work as given. PowerCLI to the rescue.
Here are the steps given in the original article and how they translate into PowerCLI.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #1.
Posts
VMware PowerCLI 4.1.1 Cmdlets by Noun
Generated using this post.
<th> Verbs </th> <td> Get,New,Remove,Set </td> <td> Get,New,Remove </td> <td> Get,New,Remove </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Get,Move,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> New,Remove,Set </td> <td> Get,Move,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Copy </td> <td> Apply,Get </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get,Move,New,Remove,Set </td> <td> Get </td> <td> Copy,Get,New,Remove,Set </td> <td> Get,Move,Remove </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Add,Get,Remove </td> <td> Get,Set </td> <td> Get </td> <td> Get,Move,New,Remove,Set </td> <td> Get,New,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> Get,Stop,Wait </td> <td> Get,Move,New,Remove,Set </td> <td> Dismount,Mount,Update,Wait </td> <td> Get,Remove </td> <td> Export,Get,Import,New,Remove,Set,Start,Stop </td> <td> Get,New,Remove </td> <td> Get </td> <td> Get </td> <td> Get </td> <td> Get,New,Remove,Set </td> <td> Get </td> <td> New,Remove </td> <td> Get,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Get,New,Remove,Set </td> <td> Connect,Disconnect </td> <td> Get,Move,New,Remove,Restart,Set,Start,Stop,Suspend </td> <td> Get,Restart,Shutdown,Suspend </td> <td> Copy </td> <td> Get,Set </td> <td> Get,New,Remove </td> <td> Add,Get,Move,Remove,Restart,Set,Start,Stop,Suspend </td> <td> Get,New,Remove,Set </td> <td> Get,Set </td> <td> Get </td> <td> Get,Set </td> <td> Get </td> <td> Format,Get </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,New,Remove,Set </td> <td> Add,Get,Remove </td> <td> Get,Install </td> <td> Apply,Export,Get,Import,New,Remove,Set </td> <td> Test </td> <td> Get,New,Remove,Set </td> <td> Get,Restart,Set,Start,Stop </td> <td> Get,Set,Test </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Get,Set </td> <td> Invoke </td> <td> Get,Set </td>