Hi,
I am trying to add a vmkernel adapter to distributed switch by the below command:
esxcli network ip interface add --interface-name=vmk1 --dvs-name=DVSWITCHNAME --dvport-id=PORT_ID
It is failing every time with error invalid port id. esxcfg-vswitch -l command shows that vmnic1 and vmnic2 of the hosts are connected to 636 and 637 port of this dvswitch.
How to determine what port_ID should be used to execute the command successfully.
Please help.
There are only some functions with VDS and ESXi command-line. To the best of my recollection you can remove and recreate but create a new one is not an option.
Hi,
I understand you are trying to create vmk1 with below command. Have you check and make sure vmk1 not connected to dvswitch.
check port id with below command.
esxcfg-vswitch -l |grep vmk1 |awk '{print $1}'
Hey Pilu1978,
Your command is failing because you need to specify the dvportgroup-id and you are specifying the port-id from a PortGroup. However I could not find a way of getting dvportgroup-id without any interface connected to it.
Of course there are a lot of places to get that information such as vCenter MOB, vCenter API, using vRealize Orchestrator, using external tools and I think even using PowerCLI. Try to go over those solutions to see if you can get it or what you can do to easily get it is to create a VMK interface manually from the UI and after you create it, run the command esxcfg-vswitch -l and record the dvportgroup-id