Static MAC address set in .vmx file on ESX is overwritten when virtual machine is powered on in VirtualCenter
search cancel

Static MAC address set in .vmx file on ESX is overwritten when virtual machine is powered on in VirtualCenter

book

Article ID: 339820

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

I attempted to set a static MAC address by manually editing the .vmx file on the ESX Server host, but the changes reverted back to the original settings after I powered on the virtual machine through VirtualCenter Server.
I edited the virtual machine's .vmx file from the ESX Server service console and removed:
ethernetN.generatedAddress
ethernetN.addressType
ethernetN.generatedAddressOffset
I added:
ethernetN.address = "xx:xx:xx:xx:xx:xx"
ethernetN.addressType = "static"
 

I saved the changes, verified the changes were saved, and powered up the virtual machine. Upon powering up the virtual machine, I find the virtual machine is not using the MAC address I just assigned to it in the edited .vmx file. When I look at the .vmx file, I find that the virtual machine's .vmx file has been changed back to:

ethernetN.generatedAddress = "NN:NN:NN:NN:NN:NN"
ethernetN.addressType="vpx"
(Where "NN:NN:NN:NN:NN:NN" is not the static address I entered).
Why did this happen and how do I set a static MAC address in ESX Server 3.0.x with VirtualCenter Server 2.x?


Environment

VMware VirtualCenter 2.0.x
VMware ESX Server 3.0.x

Resolution

The ethernetN.addressType = static is replaced with the VirtualCenter value and the generated address reappears because VirtualCenter Server owns the virtual machine. Any manual additions to the .vmx file from ESX Server 3.x are overwritten by the entries stored in the VirtualCenter database.

If you need to edit a virtual machine's .vmx file, first remove it from VirtualCenter's inventory (right-click it and choose Remove from Inventory). Once you edit it, register the virtual machine again from the ESX Server command line using
vmware-cmd -s register /<path>/<to>/<.vmx>
A return code of 1 signals success.
Related topics: