Automation

 View Only
  • 1.  Disable ESXi vmnic

    Posted Aug 06, 2020 09:25 AM

    Hi All,

    We need to disable the VMNIC from the secondary Ports coming from HP Enclosure.

    We have standard vSwitch

    2 vmnics per vSwitch and active active configuration

    Please do let us know is there any way to achieve it from PowerCli.

    Ex: vmnic4 is coming from primary & vmnic5 is secondary

    We need to disable only vmnic5

    Best Regards,

    Ram



  • 2.  RE: Disable ESXi vmnic

    Posted Aug 06, 2020 09:30 AM

    By disabling, do you mean removing it from the vSwitch teaming?



  • 3.  RE: Disable ESXi vmnic

    Posted Aug 06, 2020 09:40 AM

    Instead of removing the vmnic from teaming.

    Diabling vmnic will speed up the process and also avoids to re-adding it to the same standard vSwitch

    Currently ESXi are running with ESXi 6.0 and looking similar task is possible as per VMware Knowledge Base



  • 4.  RE: Disable ESXi vmnic

    Posted Aug 06, 2020 10:02 AM

    You could do something like this

    $tgtNIC = 'vmnic5'

    Get-VMHost -PipelineVariable esx |

    ForEach-Object -Process {

        $esxcli = Get-EsxCli -VMHost $esx -V2

        if(($esxcli.network.nic.list.invoke()).Name -contains $tgtNIC){

            $esxcli.network.nic.down.Invoke(@{nicname=$tgtNIC})

        }

    }