PowerGUI
PowerCLI: Configured Maximums – Storage
Feb 11th
With vSphere introduced some new maximum’s which we not only have to memorise for the exams but also have to keep in mind when designing and using your infrastructure.
In the back of your mind when adding a new host to a cluster you should always be thinking, how many hosts should be in this cluster ? or when adding another LUN to your clustered hosts, how many datastores should I have as a maximum before it starts impacting my performance and how many paths are supported ?
The answer to these questions (in my case anyway) is to use PowerCLI to check them
I will of course add these to the next version of vCheck so they are automatically checked for but in the meantime here are some quick one-liners to check your infrastructure against the configured maximums for storage, I will add more as I write them:
PowerCLI: How many HBA’s ?
Feb 9th
I needed a quick one-liner today to help me find out how many HBA’s my hosts had, the following one-liner needs no more introduction:
Get-VMHost | Select Name, @{N="FibreHBAs";E={($_ | Get-VMHostHba | Where { $_.Type -eq "FibreChannel"} | Measure-Object).Count}} | Out-GridView
Output:
PowerCLI: Virtual Machine disk usage
Jan 27th
Recently I have had a few comments on an old post I wrote showing a one-liner to get the VM’s disk sizes for each VM, I was asked if there was a way to export this information into a CSV file.
The easy answer is yes but what you need to do is build up a container and then add each part of the information to the container, this is quite common practice in PowerShell, its a great technique where you can basically build and populate your own information and then just add to it, once you are completed you can then take your container and export it to whatever format you wish, for example:
The one-liner mentioned in my previous post simply outputted the data one VM at a time to the screen, whilst this was great for looking at the information, when we try and export it things start to go wrong !
The new script, below, may take up more lines but is far more efficient and adaptable.
PowerCLI: Scripting ESXi
Jan 15th
As the service console is moved further away from the hypervisor, people are finding it harder to configure ESX in the same way as has been done in previous versions.
Moving forward the only way to do this really is by accessing ESXi through the API using scripting toolkits such as PowerCLI or the Perl toolkit.
There are two basic versions of ESXi “free” and “licensed”, the scripting toolkits are limited to read-only access for the free version of VMware ESXi. When the host is upgraded to vSphere Essentials, vSphere Essential Plus, vSphere Standard, vSphere Advanced, vSphere Enterprise, or vSphere Enterprise Plus these toolkits have write-access enabled and provide a scriptable method for managing ESXi hosts. More >
PowerCLI: Automating traffic shaping on portgroups
Jan 13th
I was contacted by someone who needed to automate some changes to their virtual infrastructure, I can never resist a challenge so of course I agreed to help.
He worked for a Virtual Hosting platform who offer hosting at a low cost of entry. Each customer where he works is provided with a dedicated virtual machine, a public IP space in a logical VLAN. As such his platform is currently 9 hosts, 190 VM’s and 60 Portgroups/VLAN’s. The platform is based on HP c700 Chassis with Cisco 3020 gig switches, with each “half” of the chassis trunked back to our core with a 2Gbps etherchannel. Each Blade’s “production” interface is connected to each “half” of the chassis at 1Gbps with originating VM id based load balancing. More >
PowerCLI: Comparing Clusters
Jan 12th
A simple one-liner for today, I needed to check all our current clusters and ensure all the ‘Production’ clusters were set the same, now we could go to each one and look at the settings but in this wonderful PowerCLI world we live why would you do anything more than once ?
The code is simple:
Get-Cluster | Select Name, * -ExcludeProperty id, CustomFields, ParentId | Sort Name | Out-GridView
The Get-Cluster cmdlet gets all the cluster information and then we simple exclude a few of the items I am not really interested in and then push the output through Out-GridView to display a nice filterable table as below:
VESI & PowerGUI PowerPack V3
Dec 18th
The popularity of this PowerPack never ceases to amaze me, as if it wasn’t enough to have more than 2500 downloads already it was also mentioned by the great Eric Sloof at the recent Dutch VMUG, check out a video of the session here (if you speak Dutch) or check out his slide deck here.
So, I have been working on V3 of the PowerPack and have just finished the final touches.
What’s new ?
To be honest I cant remember everything that is new but as you can see from the left hand node list there are a fair few new nodes which may help in your day to day admin life.
I have not only added my own enhancements but also included a bunch of bug fixes, (thanks Arnim and Luc) and also included some other scripts from Arne over at ICT-Freak.nl
I have re-organised some of the nodes so when you add the latest PowerPack you will receive a prompt like the below:
Make sure you click yes to re-organise the nodes into the new areas.
I have also made a dependency on PowerCLI V4.0 Update 1 so if you do not have that version installed then please install it before upgrading to the latest PowerPack, you will not need vSphere 4.0 U1 as PowerCLI 4.0U1 is backward compatable.
In the latest version of PowerCLI VMware have made the connection methods a million times better, if you look at the code you will now see how easy it is to paste your new code into the nodes and create your own enhancements.
So what’s next for V4 ? More of the same great scripts, more enhanced nodes, a move towards more actions and less nodes, and I am also thinking about opening this up as a community project, we can all add our own scripts to the PowerPack as a community effort and make this THE ULTIMATE FREE TOOL to have when administering or consulting VMware systems, express your interest via the comments please.
If your not a scripter but would like to see something in the PowerPack to make your life easier also please let me know via the comments.
Use the automatic update feature or download the new version now from below.
Exploring the PowerCLI cmdlets – Get-NicTeamingPolicy Part 2
Dec 2nd
In my previous post “Exploring the PowerCLI cmdlets – Get-NicTeamingpolicy” I showed you how to output some great looking information for vSwitches which detailed all the information we may ever need to know, so whilst on the same cmdlet lets look at PortGroups, these have the same type of settings and the same cmdlet also works against a PortGroup object, as before we can display this information with a single one liner… More >
Exploring the PowerCLI cmdlets – Get-NicTeamingPolicy
Dec 1st
One of the new cmdlets from PowerCLU 4.0 Update 1 is Get-NicTeamingPolicy, so what does this do ?
It retrieves the Nic teaming policies of the specified virtual switches and virtual port groups, obviously !
So how can we use this cmdlet ?
Well, as it details the teaming policies of either a virtual switch or a portgroup then we will need to give it a…virtual switch or a portgroup, so how do we do this, lets try a one-liner:
Get-VMHost | Get-VirtualSwitch | Get-NicTeamingPolicy
This will do as it says on the tin, get a list of the hosts, for each of these it will get a list of virtual switches attached to the hosts and then list their nic teaming policies, the output is as so:
Jump Start Virtualization EcoShell
Nov 30th
I have talked about the Virtualisation EcoShell (VESI) enough on this blog for people to know what its all about but how do you get started ?
One option is to join the FREE live meeting tomorrow (1/12/2009) at 17:00 GMT (11:00 am Central Standard Time) presented by Scott Herold by registering or joining here. Anyone who has seen Scott present before will know how great the presentation will be and you are bound to pick up some expert tips from the man himself. More >






