VMware Cloud Community
M3VM
Enthusiast
Enthusiast

Error in Python + ansible script for adding host to dvS, assign uplink and migrate vmkernel adapter to distributed switch

There is an Error in Python + ansible script for adding host to dvS, assign uplink and migrate vmkernel adapter to distributed switch. Running the script adds host to dvS but does not do assign uplink and migrate vmkernel adapter to distributed switch parts, instead removes the vSwitch0 uplink connection attached to vmnic0 thus getting the host down or throws the error: "An error occured while communicating with the remote host. Network configuration change disconnected the host from vCenter server and has been rolled back"

Any ideas on how to resolve it? The script is attached. The standalone-python script is also attached. Thanks



0 Kudos
1 Reply
vHaridas
Expert
Expert

Hi,

You need minimum two Physical NICs to migrate VM, Vmkernel Ports and add host to dvSwitch.

1. add Host and add One NIC to dvSwitch

2. Migrate Vmkernel Ports and VM to dvSwitc ( as per requirements )

3. Migrate remaining second NIC from SS to dvSwitch.

4. delete SS if needed.

Error which you have received due to the ESXi roll back features.

While migrating or making changes to management network, if you incorrectly make changes and esxi disconnect from vCenter then ESXi rolled back the changes.

Most likely, you are migrating host vmkernel to dvSwitch and then vCenter cannot communicate with host.

-

Haridas

Please consider awarding points for "Correct" or "Helpful" replies. Thanks....!!! https://vprhlabs.blogspot.in/
0 Kudos