项目

一般

简介

ESX/ESXi change MAC Address

范 益波大约 11 年 之前添加

Intro

This article provides steps to change the MAC address manually to be persistent after a reboot in ESX/ESXi 4.0.

Problems

Attempting to changing the MAC address manually from the vSphere Client fails with the error: The MAC address entered is not in the valid range. Valid values are between xx:xx:xx:xx:xx

Solution

Add or change MAC address information to the .vmx file on the ESX/ESXi host

  1. Shut down the virtual machine.
  2. Right-click the virtual machine and click Remove from Inventory.
  3. Login as the root user to a console session on the ESX/ESXi host.
  4. Go to the virtual machine home directory:
    cd /vmfs/volumes/DatastoreName/VMFolderName
    
  5. Make a backup of the existing virtual machine's .vmx configuration file with the command:
    cp vmname.vmx vmname.vmx.old
    
  6. Open the .vmx configuration file in an editor such as vi or nano and add or change the following entries:
    ethernetN.checkMACAddress = “false”
    ethernetN.addressType = “static”
    ethernetN.Address = “XX:XX:XX:XX:XX:XX″
    

    Where XX:XX:XX:XX:XX:XX is the new desired MAC address for the virtual machine.
  7. Register the virtual machine back to the inventory.
  8. Start the virtual machine.

or skip step 2 and 7, and reload .vmx manually

How to reload .vmx manually

  1. Find your vm id. This will show all VM’s running on that host. The first number on the left is the VmId.
    vim-cmd vmsvc/getallvms
    
  2. Reload .vmx for specific vmid
    vim-cmd vmsvc/reload your_vmid
    

reference

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2007042
http://blog.vmpros.nl/2009/05/15/vmware-reload-the-vmx-from-service-console/
http://www.networknet.nl/apps/wp/archives/787