This article guides you through the process of migrating host networking from a DVS switch to a standard switch using ESXi CLI commands.
STEP:- 1
STEP:- 2
Note: If the management VMkernel is running on a Distributed Switch, you should perform the steps from the DCUI remote console, as you may lose connectivity to the management network during the process. Otherwise, you can execute these steps via SSH on the ESXi host using root credentials to move all VM network port groups only.
STEP:- 3
esxcfg-vswitch -l
Important: The Distributed Switch (DVS) must have two physical adapters configured for the management VMkernel adapter.
STEP:- 4
To remove network cards (known as vmnics) to or from a vNetwork Distributed Switch (vDS) using below command:
esxcfg-vswitch -Q vmnic -V dvPort_ID_of_vmnic dvSwitch
Create a Standard Switch for the virtual machine, VMkernel, and Service Console port group depending on the environment on the ESX host you are migrating using below command :
esxcli network vswitch standard add --vswitch-name=vSwitch
STEP:- 5
esxcli network vswitch standard uplink add --uplink-name=vmnic --vswitch-name=vSwitch
STEP:- 6
esxcli network vswitch standard portgroup add --portgroup-name=portgroup --vswitch-name=vSwitch
Sample :- esxcli network vswitch standard portgroup add --portgroup-name=Management_Temp --vswitch-name=vSwitch0
STEP:- 7
esxcli network ip interface remove --interface-name=vmkX
Note: The vmk interface number used for management can be determined by running the esxcli network ip interface list command.
To create a VMkernel port and attach it to a portgroup on a Standard vSwitch, run these commands:
esxcli network ip interface add --interface-name=vmkX --portgroup-name=portgroup
esxcli network ip interface ipv4 set --interface-name=vmkX --ipv4=ipaddress --netmask=netmask --type=static
Note: By default, the ESXi, the management vmkernel port is vmk0 and resides in a Standard Switch portgroup called Management Network.
STEP:- 8
esxcli network vswitch standard portgroup set -p portgroup --vlan-id VLAN
STEP:- 9
esxcli network vswitch standard portgroup add --portgroup-name=portgroup --vswitch-name=vSwitch
STEP:- 10