Migrating from VMware vSphere Distributed Switch (vDS) to vSphere Standard Switch (vSS)

Over the last week, I have being migrating hundreds of hosts from one vSphere to another to facilitate an architectural redesigned provided to my client by VMware PSO.

As part of the migration, the hosts were going to be reimaged and new network settings applied to them. Each host had two physical NICs of which both were used in a VMware Distributed switch (One pNIC for VM Network/Management, the other dedicated for vMotion)

This posed a problem that I still needed to remain control of the hosts while I removed them from vSphere. For those reading this that has ever tried to remove a host from vSphere you will find there are some hoops you need to jump through:

  • The host must be in maintenance mode, or you get an error like this:

maintenance_mode

  • The removal of the host will result in loss of access to VMs, Resource Pool, vApps that remain on the host as well as the admin/log data associated with the host.

remove_host_warning

  • The host must be removed from the VMware Distributed Switch (vDS) before attempted removal of the host from vSphere.

error_vDS_removal

The obvious solution if to remove the host from the vDS and then you can remove the host (Assuming you have placed it in maintenance mode as per the above error).

[Home] -> [Inventory] -> [Networking]

remove_dVSreconfigure_vDS

Opps.. That didn’t work… If you read the error message it is complaining that a VMKernel is still in use. That results in the source of this blog; you can’t remove the Management VMKernel otherwise you lose management access and you can’t migrate it (yet) because all your physical NICs are in use. Therefore graceful removal of the hosts from vSphere is like Catch 22.

So here is what I came up with:

  1. Evacuate the host of all VMs and vApps by placing the host into Maintenance Mode
  2. Remove all the VMKernel from the vDS by selecting ones NOT used for management traffic by going to the [Manage Virtual Adapters] of the [vSphere Distributed Switch] section of [Networking] , selecting the non-management VMKernel and selecting ‘remove’. Once there is only the VMKernel port marked for Management Traffic left, select [Close] to exit the [Manage Virtual Adapters] window.vmk1
  3. The next aim is to free up at least one physical uplink port, which is done via the [Manage Physical Adapters] option on the vDS.  Select the uplink (In this case ‘vmnic1’) and selecting [remove], accept the warning, and select [ok] to exit the [Manage Physical Adapters] window.pNICs
  4. Select the [vSphere Standard Switch] window, select [Add Networking], select [Virtual Machine] and [Next]. You should select the pNIC that you just removed from the vDS and then [Next]vSS_add
  5. At the next window, give the network and name, VLAN (If required in your network). The VLAN ID is not important as the aim is to create a new Standard Switch (vSS) not a working virtual machine network for live traffic to go down. Once this is completed, select [Next], read the summary and select [Finish]vSS_add2
  6. The [Networking] screen will look similar to thisvSS
  7. Return to the [vSphere Distributed Switch] window, and select [Manage Virtual Adapters]. Select the remaining VMKernel  (The one marked as ‘Management Traffic: Enabled’) and select [Migrate]dVS_Migrate
  8. Follow the prompts, selecting the vSS switch you have just created, filling in a network label and a VLAN ID (This time it is important that this is correct!) and select [Finish] vDS_to_vSS_Migrate
  9. When the migration has completed, you can check that networking is now host-centric and not vSphere-centric by selecting [vSphere Standard Switch] and you can now see that the management traffic VMKernel has been migrated.vSS_summary
  10. The host can now be removed from the vDS via [Home] -> [Inventory] -> [Networking], and selecting the vDS, and the [Hosts] tab. Find the host you want to remove, right click on the host and select [Remove from vSphere Distributed Switch]
  11. When this has completed, return to the hosts view [Home] -> [Inventory] -> [Hosts and Clusters], right click on the host and select [Remove], read the warnings and select  [Yes]remove_host_warning
  12. The host will now be successful removed from vSphere and its management influence.

The host has now been removed from the vSphere Distributed Switch and vSphere. The host is now independent of vSphere management and be reconfigured, reimaged or decommissioned as required.

13 Comments

  1. vaibhav said:

    Thank you for the article, you mentioned “”””architectural redesigned””””; if possible can you share something about it so that I can check for the same in my environment & also it will be a learning.

    Thanks

    13/04/2015
    Reply
    • Crispyire said:

      Thank you vaibhav for your kind comments!
      I will attempt to write something in the near future about the redesign process that has taken place at my client’s site and the benefits it has brought (Within the confines of NDA).

      13/04/2015
      Reply
  2. Mitra said:

    can we remove host from vdist switch without vCenter server ??

    14/05/2016
    Reply
    • Crispyire said:

      Hi Mitra, vDS are a construct of vCenter with Enterprise Plus license. There isn’t a graceful way to remove a host directly without vCenter but you can reset the networking from the DCUI. This will result in a network loss for any VMs or features (eg. vMotion, iSCSI, etc) that are using the vDS. After reset you will just be on vSS. The vCenter will need to be cleaned up afterwards thus not ideal. If you can, use vCenter every time.

      14/05/2016
      Reply
      • Mitra said:

        Thanks for quick reply !!!

        Issue Description :
        Our customer environment having 75 ESXi Host with 750 VMs , all esxi host are configured with vDvswitch, the problem is our vCenter was down because of DB corruption (we try after restoring last backup off the date 28th April -but no luck ) now we are planning to move to new vCenter server & add all esxi hosts in it- but for that purpose we must remove all the esxi host from vDvswitch from old vC & problem is vCenter server is down .
        thats why i asked you for solution how to come out of this situation .. !!

        15/05/2016
        Reply
        • Hi Mitra,

          If you are planning to deploy a new VC then if you have a spare NIC — create a Standard Switch — migrate the VM’s and the vmkernel port on it — build a new VC — if you have backup of vds then import it — else create all vds — then migrate the esxi and vms one at a time to the new network.

          17/05/2016
          Reply
          • Andre said:

            Hi Christian,
            do you have an idea how I can do this in vSphere 6.5?
            I want to migrate the vmkernel mgmt port from a dvSwitch to a Standard Switch with the Host client, without having the vCenter!
            I can migrate the VMs, but not the vmkernel…
            Regards, Andre

            17/04/2018
          • Christian Parker said:

            Hi Andre,

            I haven’t tried it for 6.5. I’ll try in my lab and get back to you. vDS are a construct of vCenter so what you suggest may not be possible without vCenter but I’ll take a look.

            Chris

            17/04/2018
  3. Ettore said:

    Simply perfect! Thanks

    14/07/2017
    Reply
  4. BrianM said:

    Hi, can you tell me if this process will work if the vCenter server is one of the Windows VM’s on the servers in question – which will be going into maintenance mode? I really just need to convert from distributed switch to standard – not remove the hosts from the vCenter. Can I do all of this by connecting directly to each host instead of to vCenter using vSphere client? I’m assuming vCenter will update it’s setting once taken back out of maintenance mode and pulls the updated settings from the hosts.

    19/07/2017
    Reply
    • Christian Parker said:

      Assuming you have multiple hosts, you can use this technique to do this on one host, configure the host for vSS setup, then migrate vCenter onto the newly configured host (I don’t think you can migrate the vm network from vDS to vSS without downtime but I maybe wrong… So power down vCenter, connect to the vSS host, go to the same datastore that vCenter is stored and register it to inventory. Once registered, you can change the network on the vm, power on and reconnect to vCenter as normal. You can then complete the migration to vSS on the remaining hosts.

      Please note this is untested but should work in theory. Please test throughly before doing so in production.

      19/07/2017
      Reply
  5. Andre said:

    Hi Chris,
    thanks for your reply.
    I could do it susseccfully with vSphere 6 – in the old vSphere client I could migrate a mgmt vmkernel from a dvSwitch to a standard switch, without having the vCenter present.
    But at vSphere 6.5 I found no way for that.
    It would be very nice and helpful if I get a workaround for that.
    Regards, Andre

    18/04/2018
    Reply
    • Andre said:

      Hi Chris,
      I tested this today in another lab environment.
      As I told in vSphere 6.0 I could migrate the vmkernel port from a dvswitch to a standard switch.
      In vSphere 6.5 this is not possible in vSphere host client.
      In KB1008127 I found the (hopefully right) solution for this – per CLI I can delete the existing vmkernel, after that recreate a new vmkernel for management at the standard switch with the same ip adress. So you are right, an online migration without mgmt downtime for the ESXi host is not possible.
      After that I can manage the ESXi host, and the main important thing is, this is possible without a vcenter and without interrupting the network traffic for the virtual machines.

      Maybe in a future version this could be managed a little bit more comfortable.

      Regards,
      Andre

      18/04/2018
      Reply

Leave a Reply to BrianMCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.