How to maintain a the same MAC address all the time within your vSphere 4 installation.
In VMware vSphere 4 environement, when you move your VM to another host or the VM has different path on the same host, the MAC adress of the VM is changed.
If you want to guarantee that the same MAC address is assigned to a given virtual machine every time, even if the virtual machine is moved, or if you want to guarantee a unique MAC address for each virtual machine within a networked environment you have 2 choices. You can do it on the VM configuration level or you can do it on the guest level.
On the VM level you can do it via GUI or by editing your VMX file (just make sure that you unregister the VM from vCenter first, otherwise vCenter will overwrite the value) you go to Menu VM > Edit Settings > Network Adapter and you set the radio button on Manual. Then you can assign a static MAC address there between the authorised range by VMware. The MAC address range is:
If in some rare cases you need to keep the same MAC as for exaple on your Physical server (for some software license files tightened to a MAC address for exemple), and the MAC adress is outside of the range, you have the possibility to do it inside of your Windows (linux) VM.
On the Windows VM you do it in the properties of your NIC:
Start the VM and in the Windows system go to Control panel > network connections > Properties
Click the Configure button and go to Advanced Tab where on selecting Locally administered value you are able to enter your own value.
And for linux VM you can try this:
ifconfig eth0 down
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
ifconfig eth0 up
There is reference webpage I found about MAC addresses ranges on VMware's Website here. The page is is for VMware ESX Server 2.1, but it's still valuable… There might be other resources on that, feel free to post a comment…
michael says
“In VMware vSphere 4 environement, when you move your VM to another host or the VM has different path on the same host, the MAC adress of the VM is changed.”
What do you mean by moving VM to another host? vMotion? Migrate? Unregister / Register?
And what is “different path on the same host”? (ESX 2.X hosts that used to store VMX files locally?)
Chad says
Is this also the best practice when dealing with SRM?