VCF 5.0 LAB Deployment Issue – Failed to migrate vmnics of ESXi host to Distributed vSwitch
During my latest deployment of VCF in my lab environment I ran in to the following issue.
![](https://vronin.nl/wp-content/uploads/2024/01/image-19-1024x122.png)
![](https://vronin.nl/wp-content/uploads/2024/01/image-3-1024x95.png)
Failed to migrate vmnics of host 192.168.11.12 to DVS sfo-m01-cl01-vds01 . Reason: Failed to migrate vmknic vmk0 to DvSwitch 50 22 42 8c d5 a1 d4 8f-6d 9e 8a 1e 93 ac 5b 9d Failed to migrate vmnics of host 192.168.11.12 to DVS sfo-m01-cl01-vds01 . Reason: Failed to migrate vmknic vmk0 to DvSwitch 50 22 42 8c d5 a1 d4 8f-6d 9e 8a 1e 93 ac 5b 9d Failed to migrate vmnics of host 192.168.11.12 to DVS sfo-m01-cl01-vds01 . Reason: Failed to migrate vmknic vmk0 to DvSwitch 50 22 42 8c d5 a1 d4 8f-6d 9e 8a 1e 93 ac 5b 9d Failed to migrate vmnics of host 192.168.11.12 to DVS sfo-m01-cl01-vds01 . Reason: Failed to migrate vmknic vmk0 to DvSwitch 50 22 42 8c d5 a1 d4 8f-6d 9e 8a 1e 93 ac 5b 9d
The error is pretty clear, the migration of vmk0 from the standard vSwitch to the Distributed vSwitch failed on esx02. I checked esx01 and on this host the migration was successfull.
![](https://vronin.nl/wp-content/uploads/2024/01/image-4-1024x511.png)
I tried to manually migrating the vmk0 to the distributed vSwitch also ran in to an error in vCenter.
Right-click dvSwitch -> Add and Manage Hosts -> Manage Host Networking -> Select esx02
![](https://vronin.nl/wp-content/uploads/2024/01/image-5-1024x314.png)
Click Next and leave the physical adapters as is, click next again.
On the next screen click on “Assign Port Group” next to vmk0.
![](https://vronin.nl/wp-content/uploads/2024/01/image-6.png)
Click on ASSIGN next to the management portgroup
![](https://vronin.nl/wp-content/uploads/2024/01/image-7.png)
Next, Next, Finish…..Task is running and fails after a few seconds.
![](https://vronin.nl/wp-content/uploads/2024/01/image-9.png)
Checking the Task Details on the ESX host:
![](https://vronin.nl/wp-content/uploads/2024/01/image-10-1024x545.png)
After some investigation and searching internally within VMware resources and also ran into this blog article: https://mhvmw.wordpress.com/2023/03/17/issue-with-nested-vcf-4-5-deployment-lab-only/
it is a MAC address conflict when the esxi takes the mac of the physical nic for vmk0.
By deleting and recreating the vmk0 interface you generate a new MAC address for vmk0.
Steps to check, delete and recreate vmk0 interface
Login via DCUI
![](https://vronin.nl/wp-content/uploads/2024/01/image-11.png)
Enable ESXi Shell
![](https://vronin.nl/wp-content/uploads/2024/01/image-12.png)
Next, Click ALT+F1 to access ESXi console and login as root.
![](https://vronin.nl/wp-content/uploads/2024/01/image-14.png)
Type the command:esxcli network ip interface list
![](https://vronin.nl/wp-content/uploads/2024/01/image-15.png)
Make a note of the portgroup, in this case “Management network” and then remove the vmk0 with the following command:
esxcli network ip interface remove –-interface-name=vmk0
When vmk0 is deleted, we can immediately create a new interface with the same name and portgroup. This is done by the following command:esxcli network ip interface add -–interface-name=vmk0 -p “Management Network”
To check if vmk0 is created again type the command:esxcli network ip interface list
![](https://vronin.nl/wp-content/uploads/2024/01/image-16.png)
Click ALT+F2 to access ESXi DCUI and login to disable the ESXi shell.
Now we can configure the IP settings again via the DCUI
Go to Configure Management Settings -> IPv4 Configuration and set the static IPv4 configuration
![](https://vronin.nl/wp-content/uploads/2024/01/image-17.png)
Hit Enter then Esc and Yes to restart the management network
Now we can try to redeploy via cloudbuilder, after this the deployment went on succesfully