While attending a vSphere Design Workshop a question arose regarding when a virtual machine MAC address may be changed. It was suggested that a virtual machine’s MAC address should not ever change following initial creation of the VM. However, there appear to be some circumstances under which a virtual machine may be configured with a new MAC address. Some are obvious such as when a new network adapter is added it will have a new MAC address. Others are not as obvious.
In vSphere 5.x performing a vmotion or storage vmotion does not result in a change to the MAC address of a running VM however the documentation suggests that moving a virtual machine location on the same host may result in a network interfaces MAC address changing. The vSphere Documentation Center for 5.0 states:
After the MAC address has been generated, it does not change unless the virtual machine is moved to a different location, for example, to a different path on the same server. The MAC address in the configuration file of the virtual machine is saved. All MAC addresses that have been assigned to network adapters of running and suspended virtual machines on a given physical machine are tracked.
In addition vSphere 5.x does not track the MAC addresses assigned to virtual machines that are powered off. Therefore when a powered off virtual machine is powered on it is possible that it’s MAC address will have been assigned to another virtual machine. In this situation the virtual machine being powered on will be assigned a new MAC address. The vSphere Documentation Center for 5.0 states:
The MAC address of a powered off virtual machine is not checked against those of running or suspended virtual machines. It is possible that when a virtual machine is powered on again, it can acquire a different MAC address. This acquisition is caused by a conflict with a virtual machine that was powered on when this virtual machine was powered off.
Usually MAC addresses are not of great concern to a vSphere administrator. However some software requires a static consistent MAC address. In these cases it is possible to manually configured the MAC address so that it is known and unlikely to change.
A manual MAC address may be configured via the vSphere client:
1. Log in to the vSphere Client and select the virtual machine from the inventory panel.
2. Click the Summary tab and click Edit Settings.
3. Select the network adapter from the Hardware list.
4. In the MAC Address group, select Manual.
5. Enter the static MAC address, and click OK.
For vSphere 5.1 there are some specific requirements that have been helpfully documented by Cormac Hogan in his article ‘Heads Up! Valid Static Address Ranges in vSphere 5.1‘. These requirements appear to have been relaxed in vSphere 5.5 as the vSphere 5.5 Documentation Center states:
…all unique manually generated addresses are supported.