Under certain conditions, you might be unable to remove a host from the vSphere distributed switch.

Problem

  • Attempts to remove a host from a vSphere distributed switch fail, and you receive a notification that resources are still in use. The notification that you receive might look like the following:
    The resource '16' is in use.
    vDS DSwitch port 16 is still on host 10.23.112.2 connected to MyVM nic=4000 type=vmVnic
  • Attempts to remove a host proxy switch that still exists on the host from a previous networking configuration fail. For example, you moved the host to a different data center or vCenter Server system, or upgraded the ESXi and vCenter Server software, and created new networking configuration. When trying to remove the host proxy switch, the operation fails because resources on the proxy switch are still in use.

Cause

You cannot remove the host from the distributed switch or delete the host proxy switch because of the following reasons.

  • There are VMkernel adapters on the switch that are in use.
  • There are virtual machine network adapters connected to the switch.

Solution

Problem Solution
Cannot remove a host from a distributed switch
  1. In the vSphere Web Client, navigate to the distributed switch.
  2. On the Configure tab, select More > Ports.
  3. Locate all ports that are still in use and check which VMkernel or virtual machine network adapters on the host are still attached to the ports.
  4. Migrate or delete the VMkernel and virtual machine network adapters that are still connected to the switch.
  5. Use the Add and Manage Hosts wizard in the vSphere Web Client to remove the host from the switch.

After the host is removed, the host proxy switch is deleted automatically.

Cannot remove a host proxy switch
  1. In the vSphere Web Client, navigate to the host.
  2. Delete or migrate any VMkernel or virtual machine network adapters that are still connected to the host proxy switch.
  3. Delete the host proxy switch from the Networking view on the host.