ESXi

 View Only
  • 1.  ESXi Command line

    Posted Oct 05, 2020 05:15 AM

    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.



  • 2.  RE: ESXi Command line

    Posted Oct 05, 2020 06:42 AM

    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.



  • 3.  RE: ESXi Command line

    Posted Oct 05, 2020 06:54 AM

    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}'



  • 4.  RE: ESXi Command line

    Posted Oct 05, 2020 06:59 AM

    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