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
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
An interesting question on Alarms arrived in my mailbox recently. Charlie wanted to know if it was possible to add an action to a selected set of the alarms he has defined in his vCenter.
The current PowerCLI build (version 4 update 1 – build 208462) unfortunately has no cmdlets to work with alarms. There are some alarm-related cmdlets available in the VI Toolkit for Windows Community Extensions. But none of these provides the functionality Charlie wanted to have.
Continue reading Alarms – Adding an action
An interesting question came up in the PowerCLI Community recently. Jason wanted to use a script from another thread where you could connect a NIC to a specific portgroup while cloning a new guest from a template.
The script didn’t work when the requested portgroup was on a dvSwitch. Enough of a reason for me to have another look.
Continue reading dvSwitch scripting – Part 5 – Clone/pg to dvPG
The end of my previous post in this series, see PowerCLI & vSphere statistics – Part 1 – The basics, showed how you could get the statistical values for a specific day.
Depending on the point in time for which you request the values, the sampling interval will be different. For example Historical Interval 2 will return values measured over 30 minute intervals. See also the schematic I included in the previous post.
This sample interval is not always what you want for your reports. Suppose you want to always report hourly values and only for working hours during business days. This post will show you how to accomplish that.
Continue reading PowerCLI & vSphere statistics – Part 2 – Come together
Today the Dutch VMUG event 2009 took place. It was my first visit but this truly is an amazing event. Lots of knowledgeable and interested visitors.
During my session I showed some small, handy scripts that I use on a regular base. In fact they are stored in my profile.
As promised, here are the scripts.
Continue reading Dutch VMUG event 2009 – handy scripts
In a previous entry (see Events: a great source of information – Part 1) I showed how to use the VmCreatedEvent event to find out which guests were created longer than 30 days ago.
In the vSphere SDK documentation there are currently 432 events listed. That makes it sometimes hard to decide which event(s) to use for your reporting/auditing needs.
But luckily there are some tricks to make it easier on you.
Continue reading Events, Dear Boy, Events – Part 2
On the Yellow Bricks blog there was today a very interesting entry called Performance : Thin Provisioning. Besides the link to the excellent VMware document called Performance Study of VMware vStorage Thin Provisioning, Duncan also included some tips and tricks.
Since I’m in favour of automating as much as possible in my vSphere environment, I decided to have a look how all this could be scripted.
One of the interesting new features in vSPhere is vStorage Thin Provisioning. I’m not going to explain what Thin Provisioning is all about. For that you can consult several knowledgeable blogs (for example this entry on Virtual Geek) and/or books (for example Scott Lowe’s excellent Mastering VMware vSphere 4.0).
The problem I have with Thin Provisioning, is that there are a lot of existing guests and templates out there that were created with Thick VMDKs in the past. The only documented way I could find to convert these Thick VMDKs to Thin VMDKs was to use svMotion from the vSphere client.
Now that is not a solution I want to (or can) use in an automated environment. Continue reading Thick to Thin with PowerCLI and the SDK
An interesting question arrived in my mailbox recently. The user was trying to find out how he could assign a vCenter license. The vSphere API Reference clearly pointed to the UpdateAssignedLicense method.
But the value that should be provided in the entity parameter was a bit of a mystery. An entity ID for a vCenter was new for me.
Continue reading Assign a vCenter license