Some of you might just use it as a once shot deal manually and some of you might use it as I did, but I did not realize how many f you are having the same issue as I did. Since I posted this script it has ad close to 3000 hits. So for those of you who have used it and appreciated the work I have done or for those of you who have modified it and added to it. Please leave some feed back weather in the form of comments or in the forums.
Could you believe that VMWare says that a feature of there software will reorder your NICs after the kickstart???
So if this was the order of our NICS
03:02.0 Ethernet controller: Intel Corporation 82546EB Gigabit Ethernet Controller (Copper) (rev 01)
03:02.1 Ethernet controller: Intel Corporation 82546EB Gigabit Ethernet Controller (Copper) (rev 01)
eth0 == 03:02.0
eth1 == 03:02.1
When VMWare comes up it will reorder them so that vmnic0 will point to 03:02:01 when it should be 03:02:00 Now this only happens when you have a box with multiple nics from multiple vendors. This script will take care of it for you.
Here are some instructions on how to run this script and what you should do before and after you run this script on your ESX Server..
- run esxcfg-nics -l (keep the ouput so you can compare it to the new ouput after the script has done its job)
- copy this script in any directory you want… for instance ( /tmp/esx_nic_fix.py )
- Reboot your ESX server and once it comes up ESXwill reboot again to apply the nic changes.
- run esxcfg-nics -l and compare the new output to the old output…. ( The order should be correct now ).
- Leave me a comment on how my script helped you and digg this article. ( I would appreciate it ).
I have received numerous request on how to count reboots so that this script can run effectively right at the right moment. This is not an exact science and the number of reboots might have to be tweaked on a per environment basis, but here is what we use..
count=`last -x|grep "reboot" |wc -l`if [ $count -ge 3 ]; then python /usr/local/bin/esx_nic_fix.py chmod 644 /etc/rc.d/rc.local reboot exit 0fi