Troubleshooting ESXi Performance with iperf

Fixing the iperf error 'Operation not permitted'

A few months ago, I had to migrate sizable VMs between two separate ESXi clusters in the same datacentre, but the transfer speeds were wretched. Fortunately, both clusters were running ESXi 7, which natively include the iperf tool (otherwise, I’d have to load it onto the servers in question).

On both the server and client:

Disable the firewall:
esxcli network firewall set --enabled false

Change to the iperf directory:
cd /usr/lib/vmware/vsan/bin/

On the Client, run iperf in client-mode:
./iperf3 -i 1 -t 10 -c 192.168.100.16 -fm

On the Server, run iperf in server-mode:
./iperf3 -s -B 192.168.1.10

This generated an error:

[root-esxi8-01:/usr/lib/vmware/vsan/bin] ./iperf3 -s -B 192.168.1.10
iperf3: error - unable to start listener for connections: Operation not permitted
iperf3: exiting

It turns out that I needed to turn off security enforcement:
localcli system secpolicy domain set -n appDom -l disabled

After making that change, iperf worked:

[root-esxi8-01:/usr/lib/vmware/vsan/bin] ./iperf3 -s -B 192.168.1.10
-----------------------------------------------------------------------------------------------------------------------
Server listening on 5201 (test ?1)
-----------------------------------------------------------------------------------------------------------------------

I ran my tests, then turned security enforcement back on:
localcli system secpolicy domain set -n appDom -l enforcing

References

Two sites I visited when trying to figure this out were:
Use iPerf to test NIC speed between two ESXi hosts
VxRail: iperf3 Error: Unable to Start Listener for Connections: Operation Not Permitted

Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy