VMware vSphere

 View Only
  • 1.  How to delete a distributed switch?

    Posted Jan 15, 2022 10:53 AM

    Hi, In ESX 7.0.2, I've got a VDS that I can't seem to cleanup. This is the output from "esxcfg-vswitch -l":

    DVS Name Num Ports Used Ports Configured Ports MTU Uplinks
    DSwitch 11776 1 512 1500

    DVPort ID       In Use Client
    0               0
    1               0
    2               0
    3               0
    4               0
    13              0
    12              0
    h-1             0

    Various attempts to do "something":

    [root@] esxcfg-vswitch -d DSwitch
    Not a valid virtual switch or it is a DVSwitch: DSwitch
    [root@] esxcfg-vswitch -d --dvswitch DSwitch
    Not a valid virtual switch or it is a DVSwitch: DSwitch
    [root@] esxcfg-vswitch -d -v 0 DSwitch
    Error, only one command can be performed at a time.
    [root@] esxcfg-vswitch -d -v 0 -s DSwitch
    Error, only one command can be performed at a time.

    Every command combination I've found on the web simply fails for one reason or another. All of the uplinks and users of the vDS have been removed via the CLI but the switch itself is another story.

    Clues?



  • 2.  RE: How to delete a distributed switch?

    Posted Jan 15, 2022 10:37 PM

    From the vcsa (vsphere web client) you would typically remove the host from the DVS, not command line from the cli from the host. I'm sure there is a way to do it command line, but I just use the GUI.

    --Alan--

     

     

     



  • 3.  RE: How to delete a distributed switch?

    Posted Jan 16, 2022 12:18 PM

    That would require that the vDS was visible in the web front end - it isn't.



  • 4.  RE: How to delete a distributed switch?

    Posted Jan 16, 2022 05:08 PM


  • 5.  RE: How to delete a distributed switch?

    Posted Jan 16, 2022 06:27 PM

    No, it does not, because as I said in the previous post, the distributed switch is not visible from the web client.



  • 6.  RE: How to delete a distributed switch?

    Posted Jan 16, 2022 06:39 PM

    Only a guess.
    Does one of your VMs have active snapshots from a state, when it was connected to a port group on that vSwitch?

    André



  • 7.  RE: How to delete a distributed switch?

    Posted Jan 18, 2022 01:50 AM

    service network restart 

    to cleanup that which is wrong with networking ?  

    --Alan--

     



  • 8.  RE: How to delete a distributed switch?

    Posted Mar 22, 2022 02:31 PM

    The solution I ended up using was just to reinstall the host as there were no VMs running on it.



  • 9.  RE: How to delete a distributed switch?

    Posted Dec 20, 2024 12:35 PM

    Please pardon the late response. Just adding breadcrumbs for anyone who came across this problem.

    Need access to CLI or the host.

    #List the switches
    esxcfg-vswitch -l

    #Delete the uplink first
    esxcfg-vswitch --del-dvp-uplink=vmnic1 --dvp=<dv_port_id> <dvs_name>

    #Delete the dvs

    net-dvs -d <dvs_name>

    # Destroy the port set

    vsish -e set /net/portsets/DvsPortset-X/destroy destroy

    # Delete DB of any dvs

    rm -f /etc/vmware/dvsdata.db

    # Reboot

    reboot