Unable to remove uplinks from Distributed Switch - "Invalid network policy" "Cannot add portgroup"
search cancel

Unable to remove uplinks from Distributed Switch - "Invalid network policy" "Cannot add portgroup"

book

Article ID: 405728

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • In vCenter UI, the operation to remove a vmnic from a DVS fails with the error: "Operations failed, some tasks could not complete." 
    The error  "A specified parameter was not correct" may also be observed. 
  • Hostd.log shows ""Cannot add portgroup" error: 

info hostd[2100434] [Originator@6876 sub=Hostsvc opID=m8ebdp24-5315867-auto-35xr7-h5:70639722-1d-da-6f5f user=vpxuser:VSPHERE.LOCAL\Administrator] Invalid NIC order: one of more PNIC specified are not uplinked to vswitch.
info hostd[2100434] [Originator@6876 sub=Hostsvc opID=m8ebdp24-5315867-auto-35xr7-h5:70639722-1d-da-6f5f user=vpxuser:VSPHERE.LOCAL\Administrator] Invalid NIC teaming policy: invalid NIC order specified.
info hostd[2100434] [Originator@6876 sub=Hostsvc opID=m8ebdp24-5315867-auto-35xr7-h5:70639722-1d-da-6f5f user=vpxuser:VSPHERE.LOCAL\Administrator] Invalid network policy: invalid NIC teaming policy.
info hostd[2100434] [Originator@6876 sub=Hostsvc.NetworkVmkSimulator opID=m8ebdp24-5315867-auto-35xr7-h5:70639722-1d-da-6f5f user=vpxuser:VSPHERE.LOCAL\Administrator] Cannot add portgroup [<PORTGROUP_name>]: invalid network policy specified:(vim.host.NetworkPolicy) {
-->    security = (vim.host.NetworkPolicy.SecurityPolicy) {
-->    },
-->    nicTeaming = (vim.host.NetworkPolicy.NicTeamingPolicy) {
-->       policy = "loadbalance_srcid",
-->       notifySwitches = true,
-->       rollingOrder = false,
-->       failureCriteria = (vim.host.NetworkPolicy.NicFailureCriteria) {
-->          checkBeacon = false,
-->       },
-->       nicOrder = (vim.host.NetworkPolicy.NicOrderPolicy) {
-->          standbyNic = (string) [
-->             "vmnic0"


  • Looking at the the vswitch configuration via :  esxcfg-vswitch -l

   We can see that there are ni uplinks assigned to the virtualswitch while there are for the portgroup teaming.

   Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks   
  vSwitch0         9216        1           128               1500                                              No uplinks on the virtual switch 

  PortGroup Name                           VLAN ID  Used Ports                   Uplinks
  <PORTGROUP_name>                  0              0                                  vmnic0       Uplink listed on the port group  

Environment

VMware vSphere ESXi 8.0 

Cause

If NetworkSystem.invokeHostTransactionCall is called to make changes to vDS while there is a configuration issue observed, the change operation will fail.  

There is a mismatch configuration error observed on the portgroup "<PORTGROUP_name>" -  the uplink is present on the portgroup, however there is no uplink on the the virtual switch itself. 

 

Resolution

Delete the affected portgroup:

From the GUI, 

  • Click Networking in the VMware Host Client inventory and click the Port groups tab.
  • Right-click the port group that you want to remove and select Remove from the pop-up menu.
  • To remove the port group, click Remove.
  • Click Refresh to verify that you have removed the port group.

 

Command to delete the portgroup from the command line:

esxcli network vswitch standard portgroup remove --portgroup-name=PORTGROUP --vswitch-name=vSwitch0

 

 

Additional Information