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.

Read more…
Over the last few weeks I have published a number of blog entries that showed how you could use PowerShell, PowerCLI and the SDK to automate the management of the vNetwork Distributed Switch.
To facilitate the use of the functions I provided in these posts I created a table that lists all the dvSwitch related functions together with a link to the post where they were published.
| Functionname |
Description |
Link |
New-dvSwitch |
Creates a new dvSwitch |
Part 1 |
Get-dvSwHostCandidate |
Find hosts that can be connected to a dvSwitch |
Part 1 |
Add-dvSwHost |
Add a host to a dvSwitch |
Part 1 |
Get-dvSwitch |
Find a dvSwitch by name |
Part 2 |
New-dvSwPortgroup |
Create a new dvPortgroup |
Part 2 |
Get-VLANRanges |
Internal function ! Do not use directlu. |
Part 2 |
Set-VM2dvPortgroup |
Connect a VirtualMachine to a dvPortgroup |
Part 2 |
New-InternaldvSwvNic |
Internal function ! Do not use directly. |
Part 3 |
New-dvSwConsole |
Create a Service Console on a dvSwitch |
Part 3 |
New-dvSwvmKernel |
Create a vmKernel on a dvSwitch |
Part 3 |
Set-dvSwPgvMotion |
Enable vMotion on a vmKernel dvPortgroup |
Part 3 |
Set-dvSwPgFTLogging |
Enable FT logging on a vmKernel dvPortgroup |
Part 3 |
Set-dvSwUplink |
Update the number of uplinks on a dvSwitch |
Part 4 |
Add-dvSwHostpNic |
Add pNics to a dvSwitch |
Part 4 |
Set-dVSwPgTeam |
Set up Nic Teaming on a portgroup on a dvSwitch |
Part 4 |
| <script> |
Clone a guest and connect to a dvPG |
Part 5 |
New-dvSwPVLAN |
Create PVLAN |
Part 6 |
Set-dVSwPgPVLAN |
Assign a PVLAN to a portgroup |
Part 6 |
Get-dvSwPg |
Find a portgroup |
Part 7 |
Set-dvSwPgVLAN |
Change the VLAN Id of a portgroup |
Part 7 |
Get-dvSwNetworkAdapter |
Get network adapter information |
Part 8 |
Set-dvSwNetworkAdapter |
Change portgroup connection of a network adapter |
Part 8 |
Get-dvPgTrafficShaping |
Get the traffic shaping settings of a portgroup |
Part 9 |
Set-dvPgTrafficShaping |
Set the traffic shaping settings of a portgroup |
Part 9 |
New-dvSwNetworkResourcePool |
Create a user-defined network resource pool |
Part 10 |
Remove-dvSwNetworkResourcePool |
Remove a user-defined network resource pool |
Part 10 |
Get-dvSwNetworkResourcePool |
Retrieve user-defined network resourcepool(s) |
Part 10 |
Set-dvSwSIOC |
Enable/disable NetIOC on a dvSw |
Part 10 |
Get-dvSwSIOC |
Retrieve the NetIOC status |
Part 10 |
Get-dvVmPort |
Get port used by VM NIC |
Part 11 |
The previous parts (Part1, Part2 & Part 3) in the dvSwitch series showed how to create a dvSwitch, a portgroup for Virtual Machines and a Service Console & vmKernle portgroup. The test setup now looks something like this:
The double Service Consoles and vmKernel connection might look confusing at first. But when you select one these connections, the vSphere client will show you to which uplink a specific connection is going.
Read more…
In the previous dvSwitch posts (see Part1 & Part2) I created a dvSwitch with a dvPortgroup, and we migrated some guests to this dvSwitch .
In this part I’ll show you how to create Service Console and vmKernel portgroups over the dvSwitch. Again, all the shown scripts will do a minimal configuration of the new portgroups. More advanced configurations will be discussed in future posts in the dvSwitch series.
This is the schematic view of the configuration that we currently have.
With the introduction of vSPhere the types of Tasks you can select when you create a new Scheduled Task has increased. This is a very useful feature that allows you to schedule for example your (s)vMotions, your Snapshots, your Imports and Exports and so on.

In the PowerCLI Community there was a recent question on how these Scheduled Tasks can be created from PowerShell (see relocate vm’s from csv file and create schedule task in VC).
Being able to create a Scheduled Task for a svMotion for several guests from a PowerShell script, instead of clicking away in the vSphere Client, would be another step on the path of vSphere automation. Read more…
In Part 1 of the dvSwitch scripting series I created a simple dvSwitch with 2 uplinks, which I connected to all the ESX hosts that were returned as possible candidates. In this part I will show you how to add a dvPortgroups and how you can connect Virtual Machines to this dvPortgroup.
This is the schematic of what we have so far.
Read more…
With the introduction of vSphere one of the new features that was introduced was the vNetwork Distributed Switch. This new type of switch offers many more features than the “classical” vSwitch we knew.
In the current PowerCLI build there are no cmdlets present to create, configure, manage and remove this new type of switch. Surely this will change in one of the upcoming PowerCLI releases.
To bridge the time till the next release, I decided to write a number of functions that would allow PowerCLI users to work with the vNetwork Distributed Switch. Read more…
On the PowerCLI community someone raised a question how he could get a list of guests that were created longer than 30 days ago. The obvious source to get this kind of information are the events that VI/vSphere keeps. Note that in vSphere you will have to take into account how long events are kept! The current PowerCLI build provides the Get-ViEvent cmdlet that allows you to get at the information. Read more…