I recently had a client with some ESXi hosts having intermittent issues with NFS storage. After checking vmkernel.log (and confirming via vodb.log) I found that these hosts were reporting IP conflict errors. Someone bought extra drinks that night!
The following PowerCLI script will help check /var/log/vmkernel.log on each ESXi host in a cluster. You can find it on GitLab.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<# .SYNOPSIS Script to find IP conflicts on your ESXi hosts. .DESCRIPTION This script will enumerate all hosts in the HostGroup you specify, then connect to all of them and look for any IP Conflict errors in /var/log/vmkernel.log .NOTES Version: 1.0.1 Author: Kyle McDonald Twitter: @KarmicIT Github: https://gitlab.com/KarmicIT/public Change Log v1.0, 20190617 - KJM + Initial version .LINK https://gitlab.com/KarmicIT/public/blob/master/Get-ESXi_IP_Conflicts.ps1 .PARAMETER HostGroup Name of Host / Cluster / Datacenter to check. If you dont provide this on the CLI you will be prmopted for it. .EXAMPLE .\Get-ESXi_IP_Conflicts.ps1 -hostgroup * .\Get-ESXi_IP_Conflicts.ps1 -hostgroup CLUSTER_01 #> Param ( [Parameter(Mandatory=$false)][string]$HostGroup = $(Read-Host -prompt "`nEnter name of Host / Cluster / Datacenter to check") ) #cls $count = 0 $hosts = Get-VMhost $HostGroup | Sort-Object name $hostcount = ($hosts).count write-host "`nChecking $hostcount servers" -ForegroundColor Green foreach ($Hostname in $Hosts.name) { $count++ write-progress -Activity "Checking Hosts" -CurrentOperation "$Hostname" -PercentComplete (($count / $Hostcount) * 100) $hostlog = (Get-Log -VMHost (Get-VMHost $Hostname) vmkernel).Entries | Where-Object {$_ -like "*is using my IP address*" } | Select-Object -last 1 if ($null -ne $hostlog) {write-host $Hostname -ForegroundColor Yellow -nonewline; write-host " -" $hostlog} } write-host "Done`n" -ForegroundColor Green |