Multiple vCenters and MAC address conflicts

VMware KB article 1024025 explains an issue with MAC address conflicts due to multiple vCenter configurations with the same instance ID. Here is a technical description straight from the KB article:

Each vCenter Server system has a vCenter Server instance ID. This ID is a number between 0 and 63 that is randomly generated at installation time, but can be reconfigured after installation. 

vCenter Server uses the vCenter instance ID to generate MAC addresses and UUIDs for virtual machines. If two vCenter Server systems have the same vCenter instance ID, they might generate identical MAC addresses for virtual machines. This can cause conflicts if the virtual machines are on the same network, leading to packet loss and other problems. 

The solution is to verify that all of your vCenter configurations use different instance IDs for MAC address generation. This wouldn’t be difficult if you only had two or three vCenters, but as you scale out it becomes more of a challenge. Here is some PowerCLI code that will help you check for duplicate instance IDs.

[cc lang=”Powershell”]
# Virtual machine MAC address conflicts – http://kb.vmware.com/kb/1024025
$vCentersToCheck = “vcenter1″,”vcenter2″,”vcenter3”

$config = Get-PowerCLIConfiguration
if($config.DefaultVIServerMode -eq “Single”){Set-PowerCLIConfiguration -DefaultVIServerMode Multiple}
foreach ($vCenter in $vCentersToCheck){connect-viserver $vCenter | Out-Null}

$myReport = @()
$global:DefaultVIServers | %{
$si = Get-View ServiceInstance -Server $_.Name
$set = Get-View $si.Content.Setting -Server $_.Name
$myReport += new-object -type PSObject -Property @{
InstanceID = ($set.Setting.GetEnumerator() | where {$_.key -eq “instance.id”}).value
vCenter = $_.Name
}
}

$myResults = $myReport | Group-Object InstanceID | where {$_.Count -gt 1} | select -ExpandProperty Group | select vCenter, InstanceID
if ($myResults.count -gt 1) { $myResults } else { “No duplicate InstanceIDs were identified in the vCenters checked” }
[/cc]

By default, the script will let you know if you have any duplicates. However, if you want to know what all instance IDs are in use, they are stored in the $myReport variable. You can type “$myReport” (without the quotes) in the console window after this script completes.

This entry was posted in Scripting, Virtualization. Bookmark the permalink.

2 Responses to Multiple vCenters and MAC address conflicts

  1. Pingback: EnterpriseAdmins.org » Blog Archive » Virtual Machines with duplicate MAC addresses

  2. Pingback: EnterpriseAdmins.org » Blog Archive » How vCenter assigns MAC addresses

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.