You encounter loss of packets and connectivity because virtual machines have duplicate MAC addresses generated by vCenter Server.

Problem

The MAC addresses of virtual machines on the same broadcast domain or IP subnet are in conflict, or vCenter Server generates a duplicate MAC address for a newly created virtual machine.

A virtual machine powers on and functions properly, but shares a MAC address with another virtual machine. This situation might cause packet loss and other problems.

Cause

Virtual machines might have duplicate MAC addresses due to several reasons.

  • Two vCenter Server instances with identical IDs generate overlapping MAC addresses for virtual machine network adapters.

    Each vCenter Server instance has an ID between 0 and 63 that is randomly generated at installation time, but can be reconfigured after installation. vCenter Server uses the instance ID to generate MAC addresses for the network adapters of the machine.

  • A virtual machine has been transferred in power-off state from one vCenter Server instance to another in the same network, for example, by using shared storage, and a new virtual machine network adapter on the first vCenter Server receives the freed MAC address.

Solution

  • Change the MAC address of a virtual machine network adapter manually.
    If you have an existing virtual machine with a conflicting MAC address, you must provide a unique MAC address in the Virtual Hardware settings.
    • Power off the virtual machine, configure the adapter to use a manual MAC address, and type the new address.
    • If you cannot power the virtual machine off for configuration, re-create the network adapter that is in conflict with enabled manual MAC address assignment and type the new address. In the guest operating system, set the same static IP address to the re-added adapter as before.

    For information about configuring the network adapters of virtual machines, see the vSphere Networking and vSphere Virtual Machine Administration documentation.

  • If the vCenter Server instance generates the MAC addresses of virtual machines according to the default allocation, VMware OUI, change the vCenter Server instance ID or use another allocation method to resolve conflicts.
    Note: Changing the vCenter Server instance ID or switching to a different allocation scheme does not resolve MAC address conflicts in existing virtual machines. Only virtual machines created or network adapters added after the change receive addresses according to the new scheme.

    For information about MAC address allocation schemes and setup, see the vSphere Networking documentation.

    Solution Description
    Change the vCenter Server ID

    You can keep using the VMware OUI allocation scheme if your deployment contains a small number of vCenter Server instances. According to this scheme, a MAC address has the following format:

    00:50:56:XX:YY:ZZ

    where 00:50:56 represents the VMware OUI, XX is calculated as (80 + vCenter Server ID), and YY:ZZ is a random number.

    To change the vCenter Server ID, configure the vCenter Server unique ID option in the Runtime Settings section from the General settings of the vCenter Server instance and restart it.

    The VMware OUI allocation works with up to 64 vCenter Server instances and is suitable for small scale deployments.

    Switch to prefix-based allocation

    You can use a custom OUI. For example, for a 02:12:34 locally administered address range, MAC addresses have the form 02:12:34:XX:YY:ZZ. You can use the fourth octet XX to distribute the OUI address space between the vCenter Server instances. This structure results in 255 address clusters, each cluster managed by a vCenter Server instance, and in about 65000 MAC addresses per vCenter Server. For example, 02:12:34:01:YY:ZZ for vCenter Server A, 02:12:34:02:YY:ZZ for vCenter Server B, and so on.

    Prefix-based allocation is suitable for deployments of a larger scale.

    For globally unique MAC addresses, the OUI must be registered in IEEE.

    1. Configure MAC address allocation.
    2. Apply the new MAC address allocation scheme to an existing virtual machine in its Virtual Hardware settings.
      • Power off a virtual machine, configure the adapter to use a manual MAC address, revert to automatic MAC address allocation, and power on the virtual machine.
      • If the virtual machine is in production and you cannot power it off for configuration, after you change the vCenter Server ID or the address allocation scheme, re-create the network adapter in conflict with enabled automatic MAC address assignment. In the guest operating system, set the same static IP address to the re-added adapter as before.
  • Enforce MAC address regeneration when transferring a virtual machine between vCenter Server instances by using the virtual machine files from a datastore.
    1. Power off a virtual machine, remove it from the inventory, and in its configuration file (.vmx), set the ethernetX.addressType parameter to generated.
      X next to ethernet stands for the sequence number of the virtual NIC in the virtual machine.
    2. Import the virtual machine from one vCenter Server system to another by registering the virtual machine from a datastore in the target vCenter Server.
      The virtual machine files can reside in a datastore that is shared between the two vCenter Server instances or can be uploaded to a datastore that is accessible only from the target vCenter Server system.

      For information about registering a virtual machine from a datastore, see vSphere Virtual Machine Administration.

    3. Power on the virtual machines for the first time.
      While the virtual machine is starting up, an information icon appears on the virtual machine in the vSphere Web Client.
    4. Right-click the virtual machine and select Guest OS > Answer Question.
    5. Select the I Copied It option.
    The target vCenter Server re-generates the MAC address of the virtual machine. The new MAC address starts with the VMware OUI 00:0c:29 and is based on the BIOS UUID of the virtual machine. The BIOS UUID of the virtual machine is calculated from the BIOS UUID of the host.
  • If the vCenter Server and hosts are version 6.0 and later and the vCenter Server instances are connected in Enhanced Linked Mode, migrate virtual machines by using vMotion across vCenter Server systems.
    When a virtual machine is migrated across vCenter Server systems, the source vCenter Server adds the MAC address of the virtual machine to a denylist and does not assign them to other virtual machines.