March 22, 2012 by aubreykloppers
While adding multiple Network Interface Cards (NICs) to a XenServer host, I needed to re-arrange them so their logical naming (eth0, eth1, eth2 etc…) matched that of their physical order.
Here’s a quick guide how to do that.
- Before adding your NICs to your XenServer host, note the MAC addresses of each port.
- You might also want to put this on a label, and affix it to the bracket itself, so you can determine the MAC of the NIC by looking at the rear of the server.
- Add your NICs to your XenServer host. Note where you position each card, so you know which MAC goes where.
- Boot XenServer.
- From the shell (Hit Alt+F3 after boot has finished), type in:
xe pif-scan host-uuid=[tab-complete your hosts UUID]
This will scan for new NICs, and enumerate them as Physical Interfaces (PIFs).
- Determine the order and UUIDs of the new PIFs, by running:
This will return the uuid, device (which is actually device-name) and other info about each PIF. Check whether the device (-name) fits what you had planned. Eg. if it says eth2, and that’s what you wanted, just leave it. If you wanted it to be eth1, continue.
- Remove the PIF from XenServer, by running:
xe pif-forget uuid=[UUID of PIF you want to remove]
- Add the PIF again, by running:
xe pif-introduce host-uuid=[UUID of your host] mac=[the MAC you noted earlier, seperate octets with :] device=eth[x]
xe pif-introduce host-uuid=8c5bcb04-184b-4523-b870-5d3a5804ca67 mac=00:19:5b:5a:2d:a6 device=eth3
After this, your new PIF might show up with unknown device and vendor. While merely cosmetic, a reboot of your XenServer host should fix this. I was able to use D-Link DGE-528T cards, using the above, even though they aren’t officially supported on XenServer. Well… 2 out of 3 cards worked when placed in a single XenServer host. All 3 cards were detected, and named using the above method.