VMware Cloud Community
JDLangdon
Expert
Expert
Jump to solution

Renaming VMnics to match PCI Slot Numbers

When installing ESX is choose the wrong Pnic for the service console. The end result is that vmnic0 is in PCI slot 2, vmnic1 is in PCI slot 2, and so on. Is there any way to ny way to rename the vmins so that the vmnic number matches the PCI slot number? I know I can very easily reinstall ESX but I'd like to know if there is an other way.

Jason

0 Kudos
30 Replies
ksf
Contributor
Contributor
Jump to solution

Has anyone bothered with updating the modules.conf as well?

If so, has anyone had success with the make-modules_conf script(?), I just got a load of syntax errors when trying this...

0 Kudos
RichD
Contributor
Contributor
Jump to solution

You need to fix both esx.conf and modules.conf in order to complete the fix properly.

I used the attached scripts to achieve that.

If you run into problems, respond to thread and I'll post an update.

-

Richard Dagenais, VCP

0 Kudos
linuxdynasty
Enthusiast
Enthusiast
Jump to solution

Hey RichD I know in the past we had our little tit for tat about the modules.conf on esx3.5, but You are the first person who I have heard mention that they needed to change modules.conf and use my script at the same time.

Dconvery do you have to modify the modules.conf when you run my script as well??

Till this day I have not have to modify modules.conf with 4+ nics running in my environment.

0 Kudos
RichD
Contributor
Contributor
Jump to solution

It's funny that you say that because the impression I got is that you kinda resented that I posted an alternate solution to the problem.

I think its quite cool that you posted your script online, and that you've been actively maintaining it, and I've given you credit for that since my first post.

There are two reasons why I started from scratch on this problem after trying your much earlier script in the lab.

First, you used python which was not supported by any of our resources in-house. We decided to leverage bash, gawk/awk, sed - tools that were very supportable and consistent with the rest of the deployment script suite we were developing. Your original version was not working correctly in our environment and we couldn't debug it, so we figured the problem out on our own and wrote our own script.

Also, you ignored the modules.conf file which is necessary to complete the nic renumeration properly. Otherwise you are going to have a port assignment mismatch in linux boot mode and lose connectivity. Further, you would leave the system inconsistent with the way it is intended to be deployed by VMware and when you do a support call and run into that problem, support will poo-poo the script.

Since I am a VCP and my primary mandate is to make things as conform to standards of practice as possible, I could not leave out the modules.conf fix from my script suite. If you look at the code I shared here, you'll see that the modules.conf fix is quite a bit more fancy that the esx.conf renumeration script. It had to be, to interpret the driver tables and pick the correct one.

The script was made by myself and another expert; combined we have over 30 years of Unix experience. We felt strongly that this was a required part of the solution and spent the extra time for good reason. The client (Federal Gov't) agreed. We wanted a reliable fix, not a partial hack.

An important note here is that there is no reason why you can't use my modules.conf fix script with your own python script. The two stand alone.

I don't have a website which I am driving traffic to with this thread. I published the scripts on the VMware community to help out my colleagues, not to compete with you. I think there is plenty of room for different solutions to this problem. In fact, I think that having a little "competition" of sorts has driven you to improve your script greatly which can only be a positive thing all around for those who choose to use it.

Cheers!

-Richard Dagenais, VCP

0 Kudos
linuxdynasty
Enthusiast
Enthusiast
Jump to solution

WoW, you really went there, as professional as possible you are throwing your title around as well as your years of experience.... All I have been asking since the beginning of this thread and the other threads is WHY do you have to modify modules.conf. And I am not looking for because that is the VMware standard. Technically WHY??? The only reason I am harping on this, is because the Linux Kernel will assign the NIC's in the proper order based on PCI ID. Then after you are done with the ESX install, ESX will reorder them based on what ever criteria they are using. So All my script is doing is reordering back in the correct order based on PCI ID. Which you will never have to do again. So my question stands.. WHY do you HAVE to modify modules.conf??

I do not resent that you have another script out there. I really do not, as I am not in competition with you or anyone else, I just love giving back to the community. That is the sole purpose of my website! I just do not understand why you "HAVE" to modify modules.conf..... Let me ellaborate further.... You are the 1st user who has told me you "HAVE" to modify modules.conf and made it mandatory in all of your postings. I have yet to modify modules.conf with HP boxes and successfully pxe kicked my esx host's and yes my script has been used in 100's of esx deployments. So that is the only reason for me going back and forth with you. This is the first time that you say there is no reason not to modify modules.conf.

And you really do not want to make this posting about Experience and throwing around titles, because I can embarrass Admins who have been doing this type of work 3 to 4 longer then I have.

0 Kudos
dconvery
Champion
Champion
Jump to solution

Looking at a modules.conf file from a recent engagement, it looks like it MAY need to be edited. I am not sure if kudzu discovers the changes are re-orders the modules.conf file. I would have to try it the next time I come into the need to give a definite answer. I CAN say, however, that on the last engagement where I used it with different NICs, the server ran fine. I do not have a modules.conf file available from one where I actually ran the script. Like I said, I would assume that kudzu would handle the changes to modules.conf. Here's what I did last time:

kickstart install

reboot

ran python script on ESX console

reboot

Kudzu detects changes during boot up and reboots again

system comes up fine

Maybe someone can confirm this on their system? The latest engagement I am working is ALL e1000 NICs, so modules.conf does not NEED to be edited

Here's an output from a modules.conf file from an HP:

alias eth0 e1000
alias eth1 e1000
alias eth2 e1000
alias eth3 e1000
alias eth4 e1000
alias eth5 e1000
alias eth6 e1000
alias eth7 e1000
alias eth8 e1000
alias eth9 e1000
alias eth10 e1000
alias eth11 e1000
alias eth12 e1000
alias eth13 e1000
alias eth14 e1000
alias eth15 e1000
alias eth16 bnx2
alias eth17 bnx2

Dave Convery

VMware vExpert 2009

Careful. We don't want to learn from this.

Bill Watterson, "Calvin and Hobbes"

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
0 Kudos
dconvery
Champion
Champion
Jump to solution

I just thought of something when I looked at my post...The bnx aliases point to the LAST NICs even though they are the on-boards. The python script was not run on this server.

Dave Convery

VMware vExpert 2009

Careful. We don't want to learn from this.

Bill Watterson, "Calvin and Hobbes"

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
0 Kudos
RichD
Contributor
Contributor
Jump to solution

>The bnx aliases point to the LAST NICs even though they are the on-boards.

It's important to note that modules.conf and esx.conf are two different problems, for two different boot states/kernels.

It's also important to note that the kernel in the installer has the same problem with NIC ordering, but that this is unique to that kernel and the driver loading order on the install image.

So there are three places you need to implement a workaround:

- By selecting a different adapter during kickstart;

- by re-ordering NICs during POST using either of the scripts in this thread, and;

- by reordering modules.conf.

We wrote the make-modules_conf script to address the latter, to get the bnx's in their appropriate spot, and this consistent with nic renumeration of esx.conf (i.e. always in PCI address order, consistent with Best Practices).

make-modules_conf achieves this by parsing the PCI IDs, the driver tables provided by vmware, and building modules.conf from scratch.

I'm not sure why I'm getting flamed for pointing this out, but modules.conf needs to be fixed in order for the nic re-ordering to be complete. Of course fixing esx.conf will resolve nic ordering while running vmnix, and that is what matters 99.9% of the time. But if you reboot in linux mode you lose connectivity. make-modules_conf is the only script I am aware of that currently fixes this issue, which is why I wanted to share it with the class.

-Richard Dagenais, VCP

0 Kudos
linuxdynasty
Enthusiast
Enthusiast
Jump to solution

that's all I was asking for. I just wanted to know why you have to set modules.conf. and what you are saying does makes sense. I never had to boot into linux mode on any of my esx servers so I never ran into this issue. the reason for the flaming is that you made this personal by implying that I am soliciting my site and throwing your title around as well. all I wanted to know is why and now that you explained it to me. I will research this issue. fyi... I run my site out of my own pocket and the sole purpose of the site is to share my knowledge with every one..

0 Kudos
keinstein
Contributor
Contributor
Jump to solution

Hello,

I downloaded the script and used it, it works great, however since i'm new to the whole ks and post script arena i would like to know how could i include this script in the %post section of my ks. I need to deploy more than 40 hosts in one night and i don't want to configure them manually. i jsut want to automate as much as possible. Thanks for your help!!

-- Ken

0 Kudos
livinma1
Contributor
Contributor
Jump to solution

Hey Guys --

Currently installing vsphere 4.0 and I noticed that my nics are out of order. I want the internal broadcom nic to come up as nic 0 but it is showing up has nic2.

Linux Dynasty I spent all day trying to get your script to run but since I am very new to linux it took me a bit to realize I needed to install Python and then once I downloaded Python I then needed GCC. I have spent the better half of the day trying to locate a binary for GCC but with no luck. I have not yet installed GCC which means I cannot install Python.

How can I get pass this ? What information will you like ?

0 Kudos