Highlighted
Enthusiast
Enthusiast

ESXi Hosts pNIC get rx ring buffer size

Jump to solution

Could someone help me get the ring buffer values from all the ESXi hosts for all the vmnics? I'm trying to get the hostname, vmnic name and its corresponding rx buffer values (both current and preset).

Snag_ebd1ba6.png

$Hosts = Get-VMhost

foreach ($ESXi in $Hosts) {

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

    foreach ($vmnic in $EsxCli.network.nic.list.Invoke()) {

        ForEach-Object -Process {

            $EsxCli.network.nic.ring.current.get.Invoke(@{nicname = $vmnic.Name})

            $EsxCli.network.nic.ring.preset.get.Invoke(@{nicname = $vmnic.Name})

        }

    }

}

Although the above code gives me the values, it still produces errors.

Snag_ebfe277.png
0 Kudos
1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

Most of the time this error indicates in this case that the retrieval of the value is not supported by the NIC.

You will have to check the log to make sure.

If you run it like this, that error won't stop your script

Get-VMhost -PipelineVariable esx |

ForEach-Object -Process {

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

    $esxcli.network.nic.list.Invoke() |

    Select @{N='VMHost';E={$esx.Name}},

        @{N='vmnic';E={$_.Name}},

        @{N='Current';E={$esxcli.network.nic.ring.current.get.Invoke(@{nicname = $_.Name}).RX}},

        @{N='Preset';E={$esxcli.network.nic.ring.preset.get.Invoke(@{nicname = $_.Name}).RX}}

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
13 Replies
Highlighted
User Moderator
User Moderator

Most of the time this error indicates in this case that the retrieval of the value is not supported by the NIC.

You will have to check the log to make sure.

If you run it like this, that error won't stop your script

Get-VMhost -PipelineVariable esx |

ForEach-Object -Process {

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

    $esxcli.network.nic.list.Invoke() |

    Select @{N='VMHost';E={$esx.Name}},

        @{N='vmnic';E={$_.Name}},

        @{N='Current';E={$esxcli.network.nic.ring.current.get.Invoke(@{nicname = $_.Name}).RX}},

        @{N='Preset';E={$esxcli.network.nic.ring.preset.get.Invoke(@{nicname = $_.Name}).RX}}

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
Highlighted
Contributor
Contributor

HI Luc,

Thank you so mutch for your script. It was very helpfull for me.

Is there any option to modify it to "set" ring buffer only for host in specific cluster?

When i try something like this

$esxes = Get-VMhost |where {$_.Name -like 'hosts in first cluster*'}
ForEach ($esx in $esxes) {

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

     $esxcli.network.nic.list.Invoke() |

        $esxcli.network.nic.ring.current.set(@{nicname = $_.Name} -r 8192)
}

the command $esxcli.network.nic.ring.current.set(@{nicname = $_.Name} -r "8192")  is underlined as error.

I made this command based on your "get script" and this information:

$esxcli.network.nic.ring.current.setnicname
rx
rxjumbo
rxmini
tx

0 Kudos
Highlighted
User Moderator
User Moderator

When you use the V2 switch, you have to use the Invoke method.

See PowerCLI 6.3 R1: Get-ESXCLI Why the V2?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Contributor
Contributor

Thank you Luc,

but even though i use invoke as you stated,  "  $esxcli.network.nic.ring.current.set.Invoke(@{nicname = $_.Name} -r 8192)  "

still got red underlined for it.

Did i make a typo in the command or what is wrong with it.

Could you please guide me about this?

0 Kudos
Highlighted
User Moderator
User Moderator

Did you actually read that post I pointed to?
All the parameters need to be in a hash table, something like this for example

$esxcli.network.nic.ring.current.set.Invoke(@{nicname = $_.Name;rx=8192})


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Contributor
Contributor

HI Luc,

thank you for your quick replay.

i read this article but i'm new in powershell/powercli so this is not easy for me to understand.

Could you please tell me where my logic failed?

$esxes = Get-VMhost |where {$_.Name -like 'esxhosts'}

ForEach ($esx in $esxes) {

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

     $nics = ($esxcli.network.nic.list.Invoke()).Name

        ForEach ($nic in $nics)  {
            $esxcli.network.nic.ring.current.set.Invoke(@{nicname = $nic;rx=8192})
        }

}

i got output like below:

     $nics = ($esxcli.network.nic.list.Invoke()).Name

        ForEach ($nic in $nics)  {

            $esxcli.network.nic.ring.current.set.Invoke(@{nicname = $nic;rx=8192})

        }

Message: EsxCLI.CLIFault.summary;

InnerText: Unable to complete Sysinfo operation.  Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.EsxCLI.CLIFault.summary

At line:4 char:13

+             $esxcli.network.nic.ring.current.set.Invoke(@{nicname = $ ...

+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationStopped: (:) [], MethodFault

    + FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault

Message: EsxCLI.CLIFault.summary;

InnerText: Unable to complete Sysinfo operation.  Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.EsxCLI.CLIFault.summary

At line:4 char:13

+             $esxcli.network.nic.ring.current.set.Invoke(@{nicname = $ ...

+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationStopped: (:) [], MethodFault

    + FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault

0 Kudos
Highlighted
User Moderator
User Moderator

The maximum RX value is 4096.

See also KB2039495


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Contributor
Contributor

I understood it, but i'm refering to this VMware Knowledge Base

and according to VMware support we need to increase ring buffer to 8192 on all our affected hosts.

That is why i tried to do it via script.

0 Kudos
Highlighted
User Moderator
User Moderator

Where do you see VMware saying it must be 8192 in that KB?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Contributor
Contributor

Hi Luc,

We have in Vmware support opened case and they recommended to set this value in our environment.

0 Kudos
Highlighted
User Moderator
User Moderator

Can you change the value to 8192 with the esxcli command on the ESXi console?
If not, perhaps ask support on how to do it.

If that works, there might be a bug in the Get-EsxCli cmdlet.t

Are they talking about a VMXNet3 adapter?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Contributor
Contributor

Thank you Luc for your suggestion.

When i tried to set this value from ESX console i received error as well, but it pointed me out, that i must set TX value as well.

this is working fine now.

$esxes = Get-VMhost |where {$_.Name -like 'ESXiHosts*'}

ForEach ($esx in $esxes) {

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

     $nics = ($esxcli.network.nic.list.Invoke()).Name

        ForEach ($nic in $nics)  {
            $esxcli.network.nic.ring.current.set.Invoke(@{nicname=$nic;rx='8192';tx='8192'})
        
        }    
}

Are they talking about a VMXNet3 adapter? -- no, they stated this value for physical uplinks from ESXi hosts.

0 Kudos
Highlighted
User Moderator
User Moderator

Good to hear you got it solved.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos