I had trouble with that python script. The author responds to posts on the forum about it though, which deserves a nod.
But I got impatient (see attached):
usage:
renum-vmnic < esx.conf > esx.conf.renum
The key to vmnic ordering in esx.conf is to remember that the devices are listed in ascending PCI address order.
The first instance of an Ethernet card in the device section of esx.conf (look for vmkname) should be vmnic0, and increment up one from there for each subsequent device with a vmkname.
Then you need to go to the pnic section and make sure that child 0000 is vmnic0 and child 0001 is vmnic1 and so on. Don't worry about the MAC addresses - they are correct. It's all in PCI address ascending order.
If you end up with more pnic childs than vmnics in the device section, these are orphans from ESX trying to remap things. I delete them. You should have one device instance per pnic "child" id, with the vmkname/name being the association between them.
When you experience this NIC ordering insanity as I have with DL380 G5s, you will also note that modules.conf is wrong. modules.conf is going to be used when you boot in linux mode.
For example:
alias eth0 e1000
alias eth1 e1000
alias eth2 e1000
alias eth3 e1000
alias eth4 bnx2
alias eth5 bnx2
In a nutshell, e1000 gets loaded first, even if the Broadcom NICs have lower PCI addresses. Change it to:
alias eth0 bnx2
alias eth1 bnx2
alias eth2 e1000
alias eth3 e1000
alias eth4 e1000
alias eth5 e1000
I'm still working on a script to reorder modules.conf in a portable and programmatic way, based on PCI order, and the device to module mappings.
If you are kickstarting via http or ftp, you may be scratching your head about connectivity. In the above example, where e1000 got loaded first by default, it was the same in the kernel on the ISO. (See for yourself - in esx text mode installation, ALT-F2 once anaconda installer is kicked off to enter the shell, and go ahead and 'more /tmp/modules.conf')
For the DL380 G5's with this issue, I had to ksdevice=eth4 in order to use my first onboard NIC (i.e. the first bnx2 device in modules.conf) for network installation. By the time we get to post-install and my little awk script runs, we are in the kernel installed on the disk, so we've made this right - vmnic0 and eth0 are where they are supposed to be. But you can't do anything about the boot image other than hack the module load order and make a new ISO (I've been tempted to...) We just noted in our build book that for our specific G5's use ksdevice=eth4.