vSphere 5 Top 10 – NetIOC

Another post from our Dutch VMUG Event 2011 presentation. This time it’s about number 5 in the Top-10, Network I/O Control. This feature allows user-defined network resource pools and end-to-end QoS.

Note that this feature requires distributed Switches (dvSwitch). In fact I could have also written this post in my dvSwitch series with the title dvSwitch scripting – Part 10 – NetIOC.

The script


Line 38: Although the QosTag is an [int], we use the [string] cast. Otherwise the absence of the parameter would set QosTag to 0, which is a valid 802.1p value.

Line 38-40: The absence of these 3 parameters on a call to the function will create a user-defined network resource pool with the same settings as if the resource pool was created in the vSphere Client.

Line 51-57: If the Shares parameter is not set to “normal”, “high” or “low”, it will be set to “custom” and the Shares value will be used as an [int] value.

Line 80: The removal of a user-defined network resource pool requires the Name parameter to be set.

Line 111: If no Name parameter is used, all the user-defined network resource pools on the dvSwitch will be returned.

Line 114: To get the most recent data, the script refreshes the dvSwitch object.

Line 120: This test will make sure, that the function returns the same values as displayed in the vSphere Client.

Line 121: When the Shares level is “custom”, the [int] value of the share will be returned.

Sample usage

We start with an empty dvSwitch. The Get-dvSwitch function can be found in my dvSwitch scripting – Part 2 – dvPortgroup post.

First we get the dvSwitch and we get a list of the current network resource pools.

This will return the system network resource pools.

The same information as we can see in the vSphere Client under System network resource pools.

Note that NetIOC is not enabled by default.

Next we create a number of user-defined network resource pools.

The result shows the 3 newly created network resource pools.

And we see the same in the vSphere Client.

As we noticed earlier, NetIOC is not enabled by default. Let’s display the current setting.

We change the setting and retrieve the value again

This gives

To conclude we will clean up the demo pools and disable NetIOC again.

Enjoy !

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.