Today there was quite a bit ofΒ activity on Twitter following Jason Boche‘s blog post titled VMware Update Manager Becomes Self-Aware.
The problem Jason discovered was that the VUM skipped the guests which are hosting the VUM server and the vCenter server. As a consequence you can not select a cluster, select “remediate” and go out for lunch anymore. The resolution was a rather cumbersome and error prone manual procedure.
But of course PowerCLI can help the human vSphere administrator π
dvSwitch scripting – Part 8 – Get and Set network adapters
One of the feature requests that came up in several emails I received for my dvSwitch series, was how to get and set the network adapters of virtual guests. In the current PowerCLI version the Get-NetworkAdapter and Set-NetworkAdapter cmdlets can not handle portgroups on dvSwitches.
That is why I created the following two functions, called Get-dvSwNetworkAdapter and Set-dvSwNetworkAdapter.
Continue reading dvSwitch scripting – Part 8 – Get and Set network adapters
About Async tasks, the Get-Task cmdlet and a hash table
There was an interesting question in the PowerCLI Community on how to use the -RunAsync parameter. The user wanted to create a number of new guests and start each guest once the creation was complete. This can be done rather easily by using a New-VM cmdlet and piping the result to the Start-VM cmdlet.
Only problem was, the creation of the new guests was done in Async mode.
That’s where the Get-Task cmdlet and the use of a hash table come in handy.
Continue reading About Async tasks, the Get-Task cmdlet and a hash table
Alarms – Moving them around
You should know by now that alarms are a powerful tool to help you manage and monitor your vSphere environment.Β But in my opinion there is a basic operation missing.
There is no easy way to move an alarms from one entity to another entity. No drag-and-drop in the vSphere Client, no Move-Alarm cmdlet in PowerCLI.
A practical example, you have developed this fantastic new alarm and for testing purposes you had defined it on a single virtual machine. Now the tests are done and your alarm is ready for production. But there is apparently no easy way to move your new alarm to the root of your vSphere environment.
Security – Hardening – Part 1 – Virtual Machines
A couple of weeks ago Charu Chaubal published his draft vSphere 4.0 Security Hardening Guides in the Security & vShield Zones community. If you haven’t read them yet, you definitely have to put them on your To-do list.
A vSphere administrator often considers security as a necessary evil that he has to take care of at a point in time, preferably a few days before an audit is going to take place π
Charu’s Guides can make this exercise a lot easier. And if we add to those guides some scripts to automate the hardening process, the vSphere administrator has no more excuses to tackle security on a regular basis (like it should be !).
Continue reading Security – Hardening – Part 1 – Virtual Machines
Events β Part 5 : Powered off for more than 1 week ?
An interesting question was raised in the PowerCLI community by JΓΆrn. He wanted to find all the guests that had been powered off for more than a week.
Before you tackle such a request, it is useful to sit down and think a bit about the solution. If you are going to search through all the events in your vCenter to answer this question, you could be in for a surprise. Depending on the size and activity of your vSphere environment this straight-forward solution could run for hours !
But there is a better way of doing this.
Continue reading Events β Part 5 : Powered off for more than 1 week ?
dvSwitch scripting β Part 7 β Find portgroup/Change VLAN Id
In a comment on one of the previous dvSwitch posts, see dvSwitch scripting β Part 2 β dvPortgroup, Gert asked how he could check if a portgroup with a specific VLAN Id existed on a distributed virtual switch.
Since a function that allows you to search for a portgroup that meets specific requirements can be quite useful, I decided to create a new function to do just that.
Additionally I will show in this post how you can change the VLAN Id of a specific portgroup.
Continue reading dvSwitch scripting β Part 7 β Find portgroup/Change VLAN Id
PowerCLI and the SDK – part 3 – Steve Jin’s best practices
Steve Jin, author of the VMware VI and vSphere SDK: Managing the VMware Infrastructure and vSphere book,Β recently started his DoubleCloud blog. In a short time span he produced several high quality posts which should be a must-read for every SDK user.
In his latest post, Top 10 Best Practices Using VMware VI and vSphere SDK (part 1), Steve gives invaluable advice for working with the SDK.
Since most of the SDK samples are (still) in Java, and since I know there are quite a few SDK users coming from the PowerCLI world, I decided to write up on some of Steve’s best practices for PowerCLI users.
And I hope Steve doesn’t mind π
Update: I thought it would make it easier for the reader to group all the SDK best practices and tips & tricks together. So I created a dedicated page, see SDK.
dvSwitch scripting β Part 6 β Private VLAN
Another post in the dvSwitch series. This time I’ll tackle the creation and use of a private VLANs (PVLAN) on a dvSwitch.
For those that are not that familiar with PVLANs have a look at KB1010691, that article gives a good overview of the PVLAN concept. And there were several sessions during the last VMworld that talked about PVLANs. The most noteworthy being TA2525 VMware vSphere 4 Networking Deep Dive.
In short, PVLANs allows isolation for guests on a shared IP subnet.
Continue reading dvSwitch scripting β Part 6 β Private VLAN
PowerCLI & vSphere statistics β Part 4 β Grouping
In a previous post in this series (see PowerCLI & vSphere statistics β Part 2 β Come together), I showed the usefulness of the Group-Object cmdlet when working with statistical data. The script in that post grouped data samples for each hour together, which made it much easier to calculate the hourly average. With the Group-Object cmdlet you avoid numerous nested if- or switch-statements.
And best of all, you don’t have to code the grouping yourself, it was all done for you by the PowerShell Team.
So make sure this cmdlet belongs to your basic PowerShell repertoire. It will prove invaluable when processing statistical data.
This post will show you several of the different options you have to group statistical data together. And I will illustrate each of these with a sample script.
Continue reading PowerCLI & vSphere statistics β Part 4 β Grouping