If you need to reorder the NIC of a XenServer for whatever reasons, follow the procedures below. Note that XenServer 6.1 has an easier way of reordering the NICs and the instructions are here – http://support.citrix.com/article/CTX135809
1. First step is to add the static mapping of the NIC to the device name to this conf file:
For example, to assign the NIC with MAC address of “00:25:B5:16:01:DF” to device name eth2, add this line to the static-rules.conf file:
eth2: mac = “00:25:B5:16:01:DF”
2. After you have added the static mapping rule, run interface-rename.py:
3. Verify that the mapping is okay by looking at /var/log/interface-rename.log.
If successful, the log will show something like:
INFO [2013-02-28 10:33:02] NIC side-eth2->(00:25:B5:16:01:DF,0000:07:00.0) has moved on the PCI bus from eth2->(00:25:B5:16:01:DF,0000:07:00.0)
INFO [2013-02-28 10:33:02] Successfully renamed link side-eth2 to eth2
Instead if you see error that it is unable to rename like this message:
ERROR [2013-02-28 10:31:27] Unable to rename link side-eth2 to eth1. (Exit 2)
Then try changing the device name (eth) in this file also:
Look for the MAC address of the NIC that you want to change and rename the “ethX”. If you have another NIC that is already using the same device name, you need to change that as well. Rightfully, dynamic-rules.json is updated when interface-rename.py is run, but I always get problems with the script when it tries to do the update. Thus I find that updating the dynamic-rules.json file manually helps to get past the error.
If you need to reorder a few NICs, it is better to add the static mapping one at a time. Do the first NIC, run interface-rename.py, make sure that the mapping is updated correctly in dynamic-rules.json, then proceed to add the next NIC.
4. Once everything is done, do a pif-scan:
xe pif-scan host-uuid=<host uuid>
and reboot the server to make sure the reordering works.