This article addresses how MAC Learning policies are handled at the Distributed Virtual Port (DVPort) level within Distributed Virtual Switch (DVS) and clarifies the behavior of these policies during a vMotion operation, specifically concerning the DVPort ID persistence.
The DVPort ID is an attribute of the Distributed Virtual Switch and is assigned to the VM's virtual network adapter. When a VM is migrated to a new host (vMotion), the DVPort ID remains the same. Consequently, any network policy, including the MAC Learning configuration, that was applied directly to that specific DVPort will persist after the VM migration.
Port-Level Policy Configuration (Security Override)
This approach involves overriding the inherited network policy on a specific DVPort to set the MAC Learning policy.
Enabling Per-Port Policy Overrides (Pre-requisite)
Before overriding a specific port, you must first enable the override capability on the Distributed Port Group:
Applying the MAC Learning Override
Once override is allowed on the Port Group, you can apply the custom MAC Learning setting to the individual port:
Note: We strongly do not recommend using port-level overrides for long-term configuration management. This custom setting can easily be forgotten and if the VM's port group is changed or virtual NIC is disconnected/reconnected, the VM will likely be assigned a new DVPort ID.
Recommended Best Practice (Port Group Configuration)
For robust and easily manageable network policies, apply MAC Learning settings at the Port Group level:
This ensures the policy is consistently applied and persists, regardless of vMotion or administrative changes to the VM's network adapter connection.