Hi
I am trying to migrate a newly installed ESX host from a standard switch to a Distributed switch with PowerCLI. I have done some testing with the VDSPowerCLI and LucD's tools. I have a general idea on what to do:
Now as step 5 the problem appear. I only have one physical nic available at this time, so i need to migrate both the vmk port and the physical nic from the standard switch to the distributed switch with one single command, otherwise i loose connectivity to the ESX. It is possible to do this from the vSphere Client, so it should be possible to do it via SDK/PowerCLI as well.
I hope there is someone out there that have some hints for me.
Regards
Claus
Did you already try with the AddServiceConsoleVirtualNic method ?
I use it in my dvSwitch scripting – Part 3 – Service Console & vmKernel post.
Did you already check if Onyx shows what the GUI is actually doing ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi
Onyx gave med the answer.
It created a single VMware.Vim.HostNetworkConfig object, that both removed the pnic and vmk from the standard switch, and then added them to the distributed switch. Then a single call of UpdateNetworkConfig did the change. 🙂
Thanks for the hint, LucD
Can you share your code here?