If you have ever had the motherboard changed on a physical server, you will need to update the XenServer environment about the new MAC addresses. This is not a trivial task, as the MAC address is a read-only field. This requires that the PIFs be deleted and recreated with the correct MAC address. Once you have bonds in your XenServer environment, this complicates things further as you will need to break the bond on the host. To do this, you will need to perform the steps below (assuming this is a XenServer slave with physical access to the console or via HP ILO, Dell DRAC, etc.):

First, we need to see what interfaces are up:

ifconfig | more

Now we need to bring the interfaces down as we need this host to be a pool master. First we bring down all the bridges (xenbr0, xenbr1, xapi0,xapi1, etc.) followed by the physical intrfaces (bond0,eth0, eth1, etc.):

ifconfig ethX down

Now we have a host in its own world and we can now make it the pool master without interferring with the existing pool:

xe pool-emergency-transition-to-master

First order of business is to get a list of the physical interfaces (PIFs) including the bond, and the pair of ethernet devices making up the bond:

xe pif-list host-name-label=<Name of host>

We now need to know the universal unique ID (UUID) of the bond in order to break it:

xe bond-list master=<UUID of bond PIF>

Then,

xe bond-destroy uuid=<UUID of bond>

With the bond broken, we can then proceed with the removal of the PIFs that made up the bond:

xe pif-forget uuid=<UUID of PIF 1>
xe pif-forget uuid=<UUID of PIF 2>

Now, we can proceed with introducing the new PIFs with the correct MAC addresses, but first we need the UUID of the XenServer host:

xe host-list name-label=<Name of host>

Now we can scan for new PIFs:

xe pif-scan host-uuid=<UUID of host>

Once we have scanned for new PIFs, we should list them to see if we got any with a non-standard Linux device name such as “dev…”:

xe pif-list host-name-label=<Name of host> params=uuid,device,MAC,host-uuid

If we pick up any PIFs with a non-standard Linux device name such as eth0, eth1, etc. we will need to remove them and introduce them with the correct device name:

xe pif-forget uuid=<UUID of the PIF>
xe pif-introduce device=<device> host-uuid=<UUID of host> mac=<MAC address of PIF>

It may be good to rerun the pif-list command to validate we have devices as they should be and then to give one of them an IP address:

xe pif-reconfigure-ip mode=static IP=<IP Address> netmask=<Netmask> gateway=<IP address of Gateway> DNS=<IP of DNS server> uuid=<UUID of PIF>

We can now designate it as the host management interface and hopefully rejoin the pool:

xe host-management-reconfigure pif-uuid=<UUID of PIF>

XenServer host should now be visible in the XenCenter. At this point, it will synchronize with the pool master, but have old MAC addresses as listed in the pool database. At least it is talking to the pool. We now will have to do the same commands as before in order to update the pool database.

xe pif-list host-name-label=<Name of host>
xe bond-list master=<UUID of bond PIF>
xe bond-destroy uuid=<UUID of bond>

Now we have to do a shell game of sorts by removing one PIF, introducing it with the correct MAC address and move the host management interface to it:

xe pif-forget uuid=<UUID of PIF>
xe pif-introduce device=<device> host-uuid=<UUID of host> mac=<MAC address of PIF>
xe pif-reconfigure-ip mode=static IP=<IP Address> netmask=<Netmask> gateway=<IP address of Gateway> DNS=<IP of DNS server> uuid=<UUID of PIF>
xe host-management-reconfigure pif-uuid=<UUID of PIF>

Now we need to remove the other PIF:

xe pif-forget uuid=<UUID of PIF>
xe pif-introduce device=<device> host-uuid=<UUID of host> mac=<MAC address of PIF>

At this point, we should have a working XenServer with IP address and in sync with the pool database. We do need to create a bond and then move the host management to the bond:

xe network-list | more  *OR*
xe network-list name-label=<Name of Network>
xe bond-create mac=<MAC of PIF used for temporary host management> network-uuid=<UUID Network>  pif-uuids=<PIF UUIDs with comma separation>
xe host-management-reconfigure pif-uuid=<UUID of PIF bond>