Automatically Configuring ce Cards With ce_settings.kshTom Kranz, April 2005 Download the ce_settings.ksh script.
We've all been there. The server's been jumpstarted, the applications installed, and the machine's been handed over to the users. Suddenly, the calls start coming in. Network access is slow. File transfers take too long. A brief check of the obvious things like cables and switch settings leads on to fun with Annoying, but such is life. We've come to accept that auto-negotiation between servers running the Solaris OS and Cisco switches is one of those things that would be nice to have, but can be tricky to achieve.
As always, though, things are changing. Sun is moving away from editing While the ce cards are reliable and fast, they cause some unique issues. This is because there are two types of card, using the same core chipset and driver. In the blue corner, we have X2222A -- the 100 Mbit/sec dual UTP/SCSI PCI Combo Card. In the red corner, we have X1150A -- the Sun GigaSwift Ethernet PCI card.
Our problem here is that we have two different card speeds. We know we have to force the 100 Mbit card to 100 Mbit/sec full duplex. The trick is to not force the Gigabit Ethernet card -- it needs to auto-negotiate, so it can implement useful GigE features like flow-control. Normally, this means we would need to manually edit the
An issue exists where a ce GigE instance, which is forced to any speed/duplex setting but is not plumbed, will constantly "flap" (going up and coming down) even though it is not configured and may not even be plugged in. This results in a huge storm of "Link Up" "Link Down" messages on the console and in
This article covers the A couple of things need to be covered before we start looking at the script. I know many people reading this will be thinking "string manipulation," and then thinking "Why isn't he using perl?" The simple answer is, when deploying this on several hundred servers, I know they will all have ksh and that it will be in the same place on every machine and behave in the same way. Unfortunately, the same cannot be said about perl -- certainly not on the estates I've dealt with. Also a shell script is an easier thing for more junior sys admins to handle; regular expressions in perl can be a source of constant bemusement and frustration for many. Following on from that, we need to look at how we can split strings in korn. Here we're calling on a shell built-in called IFS -- the Internal Field Separator. By dropping a string into an array, we can change the value of IFS and thus split out the array into individual strings, assigning them to variables. This gives us a very flexible way of chopping and changing things, which we can apply to other system shell scripts. Taking the above into account, it can be seen that by writing the script in korn we get one major advantage -- it's not too much work to take this and morph it into a Bourne script, which can be used as part of a custom JumpStart install -- something fun for you to try once you're happy with how this script does its stuff. The only hint I'll give you here is that Bourne doesn't have arrays.
Right, let's look at "physical-name" instance-number "driver-binding-name"
Here's a sample ce entry from "/pci@fc,700000/pci@1/network@0" 0 "ce"
Next, we'll examine the format of the name="pci108e,abba" parent="<device path up to /network@part>" unit-address="<instance-number>" <configuration parameters>
Let's look at a sample line from name="pci108e,abba" parent="/ssm@0,0/pci@1e,600000" unit-address="1" adv_autoneg_cap=0 adv_1000fdx_cap=0 adv_1000hdx_cap=0 adv_100fdx_cap=1 adv_100hdx_cap=0 adv_10fdx_cap=0 adv_10hdx_cap=0;
We can see instantly that
Now, let's look at
In the first section of the script, we define where our Next, we define our basic parameters. The only one that will ever change is the auto-negotiation setting -- it will be enabled for GigE and disabled for 100 Mbit cards.
Next, we start to build our output. First of all, we need to scan and pull apart
Since the 100 Mbit card has dual Ethernet and SCSI ports (compared to the single Ethernet port on the GigE cards), it will always have an extra segment to its device path. We can use this to work out what sort of card we have when splitting up the physical name from
At this stage, we've gathered all the information we need so we can construct our
All that's needed is a quick manual check of
The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource. Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| |||