Go to main content

Oracle® VM Server for SPARC 3.6 Administration Guide

Exit Print View

Updated: September 2019
 
 

Managing MAC Addresses With Oracle VM Server for SPARC

Assigning MAC Addresses Automatically or Manually

You must have enough media access control (MAC) addresses to assign to the number of logical domains, virtual switches, and virtual networks you are going to use. You can have the Logical Domains Manager automatically assign MAC addresses to a logical domain, a virtual network, and a virtual switch, or you can manually assign MAC addresses from your own pool of assigned MAC addresses. The ldm subcommands that set MAC addresses are add-domain, set-domain, add-vsw, set-vsw, add-vnet, set-vnet, and set-io. If you do not specify a MAC address in these subcommands, the Logical Domains Manager assigns one automatically.

The advantage to having the Logical Domains Manager assign the MAC addresses is that it uses the block of MAC addresses dedicated for use with logical domains. Also, the Logical Domains Manager detects and prevents MAC address collisions with other Logical Domains Manager instances on the same subnet. This behavior frees you from having to manually manage your pool of MAC addresses.

MAC address assignment happens as soon as a logical domain is created or a network device is configured into a domain. In addition, the assignment is persistent until the device, or the logical domain itself, is removed.

Range of MAC Addresses Assigned to Domains

Domains have been assigned the following block of 512K MAC addresses:

00:14:4F:F8:00:00 ~ 00:14:4F:FF:FF:FF

The lower 256K addresses are used by the Logical Domains Manager for automatic MAC address allocation, and you cannot manually request an address in this range:

00:14:4F:F8:00:00 - 00:14:4F:FB:FF:FF

You can use the upper half of this range for manual MAC address allocation:

00:14:4F:FC:00:00 - 00:14:4F:FF:FF:FF


Note - In Oracle Solaris 11, the allocation of MAC addresses for VNICs uses addresses outside these ranges.

Automatic Assignment Algorithm

When you do not specify a MAC address when creating a logical domain or a network device, the Logical Domains Manager automatically allocates and assigns a MAC address to that logical domain or network device.

To obtain this MAC address, the Logical Domains Manager iteratively attempts to select an address and then checks for potential collisions. The MAC address is randomly selected from the 256K range of addresses set aside for this purpose. The MAC address is selected randomly to lessen the chance of a duplicate MAC address being selected as a candidate.

The address selected is then checked against other Logical Domains Managers on other systems to prevent duplicate MAC addresses from actually being assigned. The algorithm employed is described in Duplicate MAC Address Detection. If the address is already assigned, the Logical Domains Manager iterates, choosing another address and again checking for collisions. This process continues until a MAC address is found that is not already allocated or a time limit of 30 seconds has elapsed. If the time limit is reached, then the creation of the device fails, and an error message similar to the following is shown.

Automatic MAC allocation failed.  Please set the vnet MAC address manually.

Duplicate MAC Address Detection

To prevent the same MAC address from being allocated to different devices, the Logical Domains Manager checks with other Logical Domains Managers on other systems by sending a multicast message over the control domain's default network interface, including the address that the Logical Domains Manager wants to assign to the device. The Logical Domains Manager attempting to assign the MAC address waits for one second for a response. If a different device on another Oracle VM Server for SPARC-enabled system has already been assigned that MAC address, the Logical Domains Manager on that system sends a response containing the MAC address in question. If the requesting Logical Domains Manager receives a response, it notes the chosen MAC address has already been allocated, chooses another, and iterates.

By default, these multicast messages are sent only to other managers on the same subnet. The default time-to-live (TTL) is 1. The TTL can be configured using the Service Management Facilities (SMF) property ldmd/hops.

    Each Logical Domains Manager is responsible for the following:

  • Listening for multicast messages

  • Keeping track of MAC addresses assigned to its domains

  • Looking for duplicates

  • Responding so that duplicates do not occur

If the Logical Domains Manager on a system is shut down for any reason, duplicate MAC addresses could occur while the Logical Domains Manager is down.

Detecting MAC Address Collisions

A detection check for duplicate MAC addresses is performed when the logical domain or network device is created, when the logical domain is started with the –m option, and when the ldmd/mac_collision_check SMF property is set to true.

The mac_collision_check SMF property controls whether a MAC address collision check is performed when the Logical Domains Manager starts. The check is performed when the property value is true. The default value is false.

The following command enables the MAC address collision check during Logical Domains Manager startup by setting the mac_collision_check SMF property:

primary# svccfg -s ldmd setprop ldmd/mac_collision_check=true
primary# svcadm refresh ldmd
primary# svcadm restart ldmd

By default, MAC address collision checks are disabled. If the mac_collision_check SMF property is enabled, a warning message is logged when collisions are detected.


Note - The MAC address collision check slows down the start of the Logical Domains Manager process depending on the number of MAC addresses to check.

In addition to the Logical Domains Manager performing MAC address collision checks, you can perform this check when a domain starts by using the ldm start-domain -m command. If a MAC address collision is detected, the ldm start-domain command fails.


Note - The MAC address collision check slows down the start of a domain depending on the number of MAC addresses to check.

The following command to enable the MAC address collision check when the ldg1 domain starts up fails with an error:

primary# ldm start-domain -m ldg1
MAC address 00:14:4f:fb:9d:32 is already in use.