There are several reasons why would you like to update or change virtual adapter MAC address. One of the most common is legacy application license pined to network adapter card MAC address. In standard KVM you would edit virtual machine configuration file XLM and update mac address section.
<interface type='network'> <mac address='52:54:00:be:99:b3'/> <source network='NTNX-Local-Network'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </interface>
But, Acropolis Hypervisor – AHV – is not common KVM hypervisor 🙂 . It is highly customized CentOS KVM by Nutanix engineering team. All virtual machines and virtual machines settings (MAC address too) is controlled by Acropolis. On standard KVM one would change virtual machine XML configuration file. However changing virtual machine XML configuration file will not keep setting permanent as all virtual machine settings are stored in Cassandra (noSQL) database.
Of course, it is possible to change or update virtual machine MAC address by using acropolis command line acli.
Log in to CVM via ssh and start Acropolis command line – type acli – note: MAC_Change is a virtual machine name.
List all VM network adapters with details
<acropolis> vm.nic_get MAC_Change 52:54:00:7d:1b:91 { mac_addr: "52:54:00:7d:1b:91" network_name: "VLAN92" network_uuid: "8e06c992-7543-48f7-9380-51493b09317b" } <acropolis> vm.nic_list MAC_Change Mac Address IP Address Network UUID Network Name 52:54:00:7d:1b:91 8e06c992-7543-48f7-9380-51493b09317b VLAN92
Detach adapter from VM
<acropolis> vm.nic_delete MAC_Change 52:54:00:7d:1b:91 NicDelete: complete
Create new network adapter with new MAC address
<acropolis> vm.nic_create MAC_Change mac=52:54:00:7d:1b:92 network=VLAN92 request_ip=false NicCreate: complete <acropolis> vm.nic_list MAC_Change Mac Address IP Address Network UUID Network Name 52:54:00:7d:1b:92 8e06c992-7543-48f7-9380-51493b09317b VLAN92 <acropolis> vm.nic_get MAC_Change 52:54:00:7d:1b:92 { mac_addr: "52:54:00:7d:1b:92" network_name: "VLAN92" network_uuid: "8e06c992-7543-48f7-9380-51493b09317b" } <acropolis>