Virtually everything is poshable
Archive for September, 2009
PowerCLI: How many VMs on your Datastores ?
Sep 23rd
How many VMs do you have on your datastores ? Do you know ? should you care ?
Yes, you should care, you should care because over saturated datastores can cause issues with IO and also cause scsi locks if you are using fibre. So what is the sweet spot ?
Unfortunately its one of those “It Depends” situations, isn’t everything !
It depends on the type of shared storage you are using, fibre, iSCSI, NFS and also depends on the types of VMs you are using, all I can recommend is that you try and distribute your VMs evenly and try and think about the type of VMs you are putting on the same datastore, for example, if you have multiple SQL servers on the same datastore or if you have an exchange server on the same datastore as your SQL VM’s then do something out it.
The first place I would start is by reading the great Yellow-Bricks article “Max amount of VMs per VMFS volume” where Duncan tells us how he works out his sweet spot
You can see how evenly you are currently distributed with the following one-liner:
Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM).Count}} | Sort Name
Example Output:
| Name | NumVM |
| ESX01_Local | 0 |
| iscsi_0 | 0 |
| iscsi_1 | 2 |
| iscsi_2 | 1 |
| NFS_1 | 7 |
And don’t forget, with the wonders of Move-VM and SVMotion we can move some VM’s around to start evenly distributing the load on our datastores.
I would also suggest monitoring from the SAN up so you can see straight way if you have a volume or LUN issue.
PowerCLI: One-Liners Checking Host Network Information
Sep 21st
Sometimes as a consultant when performing an initial look or a healthcheck on a new system you will want to confirm all hosts have the correct network information, if there is a mis-configured vmotion portgroup or something similar then this could impact HA or if there is an incorrect DNS server then this may also have issues further down the line with your service console.
The following quick one-liners display some vital information for each host, errors can be seen at a glance, rather than checking each host individually, for us to gain this information we use the wonderful Get-VMHostNetwork cmdlet and expand a few areas of interest:
- Remember these can be narrowed down further by adding the Get-Cluster “MyCluster” | to the start of the line.
- Also remember this information can also be exported to a csv by adding | Export-csv “C:\info.csv” to the end of the line.
To list all ESX Hosts and their Service console information: More >
vTip – A VMware Expert updating your VI
Sep 10th
We have all seen the message of the day setting which allows you to alter what you would like to tell your colleagues today and other than the normal fun type messages I have never seen it put to good use. (Yes I know this is used to tell people that a host is being managed by a VI).
So you could stick with your normal messages….
Or you could put it to use, how would you like a vExpert, no a vGuru, no a vGod to update your Message of the Day, giving you tips and help each day and helping you along the path to virtual enlightenment ? Well now you can.
Jason Boche has recently announced his vCalendar which is a great daily calendar with tip for each day, there is also a blog widget and netvibes or Google widget for this too, so my script takes these wonderful daily tips and adds them to a place we all visit on a daily basis…. The Virtual Infrastructure Client.
Now you can be taught a daily message by the vMan himself.
The script should work in most cases apart from those companies that have complex proxy servers. – Hope it works for you !
Don’t forget to set it up as a scheduled task to run at 00:01 every night and update your VI with the next vTip.
Function vTip { $proxyAddr = (get-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServer $proxy = new-object System.Net.WebProxy $proxy.Address = $proxyAddr $proxy.useDefaultCredentials = $true $webClient = New-Object System.Net.WebClient $webadd = "http://www.printedowl.com/CalendarNetvibeGadget.aspx?id=boche&render=1" $webClient.proxy = $proxy trap [System.Management.Automation.MethodInvocationException]{ Continue} $RAWTip = $webClient.DownloadString($webadd) if ($RAWTip -eq $null){ $DailyTip = $null } Else { $DailyTip = $RAWTip -replace "[`r`n]",'' -replace '^.*<!-- google_ad_section_start -->(.*)<!-- google_ad_section_end -->.*$','$1' } $DailyTip } $Message = VTip # Dont forget to change the below line to connect to your VI Connect-VIServer MYVISERVER $UpdateMessage = Get-View -Id SessionManager $UpdateMessage.UpdateServiceMessage($message)
Or if your like me and do most of your work from the PowerCLI console you could remove the last 5 lines and add it to your PowerShell profile:
New PowerCLI Blogger
Sep 9th
Anyone who has ever wondered how to do anything in PowerCLI and added a question to the PowerCLI community will know the name LucD or if you are on twitter, LucD22or if you were at VMWorld you will have seen the man in person presenting “TA2650 – Taking PowerCLI to the next level” together with Hal Rottenberg
After much peer pressure and beating with large sticks, Luc has started a blog, if his help on the communities is anything to go by you will know that this blog is surely to be a great place for PowerCLI and PowerShell knowledge in general.
So go over to Luc’s Blog now and add him to your RSS feeder, there are already a couple of nice posts on there explaining some of what happened at VMWorld and I cant wait for the future posts.
Dont forget he has also appeared a couple of times on this blog, giving very complex and informative posts.
Go now, stop reading this !
Script List – Finally !
Sep 5th
I have had a link there for a while, you know the one at the top of this page that said ‘Script List’ but didn’t actually contain anything.
Well I finally managed to get some time to fill out a page with a list of all the scripts I have created so far, please take a look, there are some in there which I had forgotten about !
I have categorised these into the following categories…
- Getting Started
- Virtual Machines
- ESX Hosts
- Licensing
- Datastore’s
- Networking
- Reporting
- Lessons
- Cluster
- Snapshots
- Security
- Others
Let me know if there is anything you are looking for that doesn’t exist as yet, I’m sure I can help out.
PowerCLI: APIs made easy “Project Onyx”
Sep 2nd
For those of you who are living on Mars it is VMworld, No I am not there but I am trying to keep up with all the information coming from VMworld.
One of the coolest things I have seen is “Project Onyx”
Onyx is a cryptocrystalline form of quartz, but apart from that its also a code name for a cool new app the VMware PowerCLI team are working on.
Project Onyx basically allows you to record what you are doing in the virtual infrastructure client and turn it into PowerCLI scripts, so all those things you wanted to script but never knew how can now be achieved.
The PowerCLI team will be giving this new tool to a select few at VMworld to test as it is still in beta, hopefully a wider beta will be released at some point in the future.
For the meantime why don’t you check out the PowerCLI Blog for more information here (Love the paperclip reference)







(3)
(13)
(0)