The functionality of this Fling is now officially available in vSphere 6.7!
Jul 18, 2017

Do the DVS switch needs to be version 6.5 for this work?
For some reason the learnswitch setup script is not detecting my dvs, but they are 6.0 dvs running in a ESXi 6.5.

Jul 18, 2017

Hi Ricardo,
The script should work even if it is 6.0 dvs running on ESXi 6.5, I just verified it to be sure.
Please make sure that the IP you provide as argument to the script is the IP of the Outer physical ESX(not the nested ESX IP)). Please share the o/p of the script if you continue to hit the issue..

Thanks,
Subin

Jul 18, 2017

Hello Subin,

I'm using the IP of the vCenter and IP of the physical ESX.

The output is just: "ERROR: DVS esx01-dvs-pod01 not found"

It seems that it is not finding the dVS.

I double checked if the names for some reason were not correct, but they are listed correctly:

Get-VDSwitch -name *pod01*
Name NumPorts Mtu Version Vendor
---- -------- --- ------- ------
esx01-dvs-pod01 33 9000 6.0.0 VMware, Inc.

Get-VDSwitch -name *pod01* | Get-VDPortgroup -name *mgmt*
Name NumPorts PortBinding
---- -------- -----------
pod01-mgmt-vlan200 8 Static

Is there any way of getting a bit more verbose logging? I uncommented the "DEBUG" in the script, but do not seem to make a difference.

Jul 19, 2017

Thanks for the info.

The script just runs through the managed objects(mob) of VCenter, looking for a vDS by that name. It appears that esx01-dvs-pod01 was not found in this search.

Can you please update the method get_dvs_mor_from_datacenter() to print the entities under the networkFolder as below and check if esx01-dvs-pod01 shows up.

def get_dvs_mor_from_datacenter(dvs_name, datacenter):
for child in datacenter.networkFolder.childEntity:
print child.name
if isinstance(
child,
vim.dvs.VmwareDistributedVirtualSwitch):
#if child.name == dvs_name:
# return child
pass

Please make sure to revert back all the changes to this method once you are done(note that the last 3 lines of this method was also changed so as to iterate through all elements)

Thanks,
Subin

Jul 19, 2017

Hmm.. looks like the comments do not indent the code properly, I have added a ">" for each tabstop so that there is no confusion.

>def get_dvs_mor_from_datacenter(dvs_name, datacenter):
>>for child in datacenter.networkFolder.childEntity:
>>>print child.name
>>>if isinstance( child, vim.dvs.VmwareDistributedVirtualSwitch):
>>>>#if child.name == dvs_name:
>>>># return child
>>>>pass

Jul 19, 2017

Hello Subin,

With your sugestion, I found out what was the issue.

It seems that if the py is not liking the fact that my dvs was too "deep" in the network folder hierachy, it was in a sub network folder of a network folder.

I've tested by moving the dvs to the root of the network folders and all worked.

Thank you for the help solving this one.

Jul 19, 2017

glad to here that it is solved, happy to help..

Nov 23, 2017

I was also seeing the problem with the script not returning any dvs mors nested inside a network folder.
Workaround as long as the dvs name is unique.

def get_dvs_mor(dvs_name):
content = get_vc_content()
obj_view = content.viewManager.CreateContainerView(content.rootFolder,[vim.dvs.VmwareDistributedVirtualSwitch],True)
dvs_list = obj_view.view

for dvs_mor in dvs_list:
if dvs_mor.name == dvs_name:
return dvs_mor
print 'ERROR: DVS %s not found'% dvs_name
sys.exit(1)

Jul 18, 2017

Forgot to mention, this dVS do not have any physical uplink assigned, not sure if it is relevant.

Jul 19, 2017

I tried locally with a similar dVS and the script works fine, so I don't think this can be the issue.

May 15, 2017

Hey there. The version has been updated to 1.0.1; however, there's no corresponding Changelog updates to let us know what's changed and the download link still downloads the v1.00 binaries. Is it possible to have these updated?
Thanks in advance.

May 15, 2017

Hi Grant,

Thanks for letting us know. I've just reported this internally & we'll get this fixed along w/changelog with the updates.

May 15, 2017

Thanks William!

May 15, 2017

Thanks Grant, have updated the changelog and the download content.
You may have to reboot the host after installing the new VIB for it to take effect.

May 15, 2017

Thank you Msubin!

May 14, 2017

Since using the learnvswitch filter, I notice after reverting a snapshot on my VM it takes a while before the VM can be pinged (nested ESX). The revert powers off the VM and then after powering it on, it can take anywhere between 20-30 minutes before the VM starts responding to ping. I don't remember seeing the same behavior with the maclearn filter.

May 14, 2017

Hmm.. that's odd, may I know how many uplinks you have on the outer ESX?

You could also check on which switchport the MAC was learned by looking for the VM's MAC in the output of
"net-learnswitch --instance VDSName --mac-address-table"

Thanks,
Subin

May 22, 2017

There are two uplinks on the VDS, after just using one uplink it appears to be a non-issue now.

May 05, 2017

Hi Marco,
Did you do the below step from Instructions?
Step 5 - Move the learnswitch_cfg.py into the pyVpx directory that was created from the previous step and then change into pyVpx directory.

May 05, 2017

Oh my!!! Where I had my brain!!
Thank You very much Msubin, I have successfully completed the installation.