Infrastructure Adventures

01/28/2012

AutoExpanding vDS Port Groups

Filed under: Network, Virtualization — Tags: , , , , , — Joe Keegan @ 4:32 PM

Update: Looks like the KB was updated shortly after this post was published with some updated information. This seems like a good sign that it’s a supported feature. The KB article includes another way to enable the feature without using PoweCLI.

I was reviewing dvPort bindings while studying for my VCP 5 and I saw something mentioned in KB 1022312 that I had never heard of before. In the section on Static Port Bindings the KB mentions:

Starting vSphere 5.0 ‘Auto_Expand’ property is turned on by default for Static Port Binding. This property allows a dvPortgroup to expand automatically by a small predefined margin every time dvPortgroup is about to run out of dvPorts.

I did some googling and I couldn’t find much information on how the Auto_Expand property works. The only thing I could find was a mention of it in the vSphere API documentation for the DVPortgroupConfigInfo/Spec objects.

There was no information on how many ports were added … What exactly is a “small predefined margin”? I wanted to find out.

So I created a small dvPortgroup with 10 ports called AutoExpand and left it with the default Static Bindings.

Then I used some quick PowerCLI to create 10 VMs and connect them to the AutoExpand dvPortgroup.

$X=1
do {new-vm -VMHost $esx1 -Name VM$X -NetworkName AutoExpand -DiskStorageFormat Thin -RunAsync; $X++} while ($X -le 10)

After that ran I tried to create another VM with a connection to the AutoExpand port group via the vSphere client. And with great disappointment I was greeted with this error message.

So contrary to what was mentioned in the KB, it did not look like this feature was turned on by default. After some PowerCLI I was able to confirm that the AutoExpand property was indeed False by default.

PS>$PG = Get-VirtualPortGroup -Name AutoExpand
PS>$PGV = get-view $PG
PS>$PGV.config

Key : dvportgroup-2016
Name : AutoExpand
NumPorts : 10
DistributedVirtualSwitch : VmwareDistributedVirtualSwitch-dvs-1601
DefaultPortConfig : VMware.Vim.VMwareDVSPortSetting
Description :
Type : earlyBinding
Policy : VMware.Vim.VMwareDVSPortgroupPolicy
PortNameFormat :
Scope :
VendorSpecificConfig :
ConfigVersion : 1
AutoExpand : False
LinkedView :
DynamicType :
DynamicProperty :

Enabling AutoExpand

I still wanted to see what a “small predefined margin” was and set out to enable this feature. Since there was no way to do this from the vSphere client (at least as far as I know) I would have to do this through the vSphere API.

After some googling I once again found myself at LucD’s amazing blog and some of the work he has done with PowerCLI and DVS. Looking at some of his examples I was able to put together the following script that enables the AutoExpand feature.

$PG = Get-VirtualPortGroup -Name AutoExpand
$PGV = get-view $PG
$spec = New-Object VMware.Vim.DVPortgroupConfigSpec
$spec.AutoExpand = "True"
$spec.ConfigVersion = $PGV.Config.ConfigVersion
$PGV.ReconfigureDVPortgroup_Task($spec)
$PGV.UpdateViewData()

After running the script I was able to confirm that the AutoExpand feature was now enabled.

PS>$PGV.config

Key : dvportgroup-2016
Name : AutoExpand
NumPorts : 10
DistributedVirtualSwitch : VmwareDistributedVirtualSwitch-dvs-1601
DefaultPortConfig : VMware.Vim.VMwareDVSPortSetting
Description :
Type : earlyBinding
Policy : VMware.Vim.VMwareDVSPortgroupPolicy
PortNameFormat :
Scope :
VendorSpecificConfig :
ConfigVersion : 2
AutoExpand : True
LinkedView :
DynamicType :
DynamicProperty :

AutoExpand Behavior

It was now time to see what a “small predefined margin” was and I yet again tried to add a VM via the vSphere client. This time success! The VM was created successfully and the number of ports in the port group was increased to 20.

Continuing to add VMs to the port group shows that 10 more ports are added whenever the port group is expanded. So there you have it, a “small predefined margin”  is 10.

It’s not clear if this is a supported feature or not. I would guess since it’s not enabled by default and you have to go pretty deep to enable the feature that it is not currently supported.

About these ads

4 Comments »

  1. Great find. Didn’t know about this AutoExpand feature either.
    Thanks for the mention :-)

    Comment by LucD — 01/28/2012 @ 4:52 PM

  2. Looks like the KB article has been updated to say that this option is disabled by default.

    Comment by Loren Gordon — 02/05/2012 @ 7:37 AM

  3. vCloud Director 1.5 automatically creates dvPortgroups with AutoExpland enabled when using vCDNI or VLAN-backed Network Pool. It seems likely that AutoExpand is supported.

    Comment by jdoe — 02/12/2012 @ 2:24 AM

  4. [...] configure this with Powershell, connect to vCenter using the Connect-VI command and then: (Thanks Infrastructure Adventures for researching [...]

    Pingback by Port Binding with vSphere 5 - The Foglite — 08/13/2012 @ 1:37 PM


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 34 other followers

%d bloggers like this: