AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  Where is MAC address information stored in AIX?

    Posted Mon February 29, 2016 11:24 AM

    Originally posted by: TomaszGasiorowski


    Hi Guys,

     

    Does anyone have any idea, where AIX keeps the information about MAC address? I've been trying to search in ODM, however cannot find anything.

    I know a few ways to display it (netstat, entstat, lscfg ...), but I'm wondering if there is any place that AIX actually stores such information.

     

    I'm pretty sure there must be something.

     

    I performed the following test:

    1. I have my test LPAR  with virtual ethernet adapter, IP assigned

    2. I cloned a SAN volume and LUNs attached to it

    3. New LPAR created. While defining virtual ethernet adapter in HMC, I forced to use the same MAC address as the base LPAR.

    4. I attached the cloned LUNs to new LPAR

    5. After boot, the system came up with the IP address assigned.

    6. When I do not force the MAC address and allow it to be auto-generated, IP address is not set up after boot.

     

    That makes me think there must be a MAC-IP relation kept somewhere in the OS, however I don't have any clue where to find it.

    This is pretty crucial for a small project I'm working on, so any hint would be appreciated!

     

     

     



  • 2.  Re: Where is MAC address information stored in AIX?

    Posted Tue March 08, 2016 03:51 PM

    Originally posted by: Wouter Liefting


    I don't think AIX stores the MAC address in the ODM. What is probably used to uniquely identify the adapter is the physical hardware address (the one that looks like U9111-520-00C54321-P1-C3-T1). I don't have an AIX system to hand right now, but if the MAC address is stored in the ODM, it should be in CuAt. (odmget CuAt | grep -p ent0)

     

    When AIX boots, rc.boot runs cfgmgr, which in turn looks at the reduced ODM (part of hd5) to identify/configure all previously-existing devices. It uses the ODM to set IP addresses and such. But since a MAC address is hard-coded on the adapter (at least, as far as AIX is concerned), there would not be a reason to store the MAC address in the ODM. As you saw, commands like entstat can simply pull this from the adapter direct (via the device driver).

     

    Having said all that, I don't understand what you're trying to achieve and why you would want to "clone" a MAC address. Or are you using iSCSI instead of a FC SAN?



  • 3.  Re: Where is MAC address information stored in AIX?

    Posted Wed March 09, 2016 02:09 AM

    Originally posted by: TomaszGasiorowski


    Indeed, AIX doesn't store the MAC address in ODM.

     

    But even though the MAC address is hard-coded on the adapter, there must be a relation between MAC and IP stored somewhere on the system.

    Another test just proved it: when I build a new LPAR using cloned disks and clone the HMC profile from the source, the IP is recovered automatically.  With a fresh new profile it doesn't work. 

     

    Moreover, if I use a fresh profile (cloned LUNs still) and set up an alternate MAC address for the one from source machine, the IP automatically gets set up.

     

    I tend to believe it's not a trivial one-command task to retrieve a MAC address from adapter in Defined state, but somehow AIX keeps such information. Somewhere...

     

    BTW. It's not iSCSI related, I use NPIV. I'd like to use it to recover a machine and it's configuration having just a cloned storage. I know I could place some script on the source machine which collects some information for me and executes when the fresh recovered machine is booted, but this is not possible at the moment.



  • 4.  Re: Where is MAC address information stored in AIX?

    Posted Wed March 09, 2016 03:02 AM

    Originally posted by: Wouter Liefting


    There's no real relationship between the IP address and the MAC address. What happens is that the device is stored in the ODM based on the physical adapter address. If during bootup AIX detects that a device is the same as last time, it configures it as the same device with the proper IP address. If it's a different device, it gets a new device name and the old device will remain "Defined". Obviously the new device doesn't have a configuration (including an IP address) yet, in that case.

    Here's the catch: Both the LPAR ID and the virtual slot ID are encoded in the physical device address. Look at the output of lscfg or similar commands. The physical hardware address of your ethernet adapter will look like this: U9111-520-00C12345-V1-C3. The V1 is your LPAR ID, the C3 is your virtual slot ID. So if you clone the *LPAR*, the LPAR gets a new LPAR ID, which also means the adapter gets a different V number so AIX will detect the adapter as a different one. But if you clone the *profile*, the LPAR ID stays the same and if you are careful enough to use the same virtual slot number, the adapter is detected as being the same.

    That last thing should be independent of the MAC address but I have not tested that. What you could do is take your original LPAR/profile, shut that down, change the MAC address of the ethernet adapter from the HMC (using the CLI - this can't be done from the GUI) and boot up the partition again without cloning either the LPAR or the profile. AIX should detect the adapter as being the same and configure it. Despite the different MAC address.



  • 5.  Re: Where is MAC address information stored in AIX?

    Posted Wed March 09, 2016 03:22 AM

    Originally posted by: TomaszGasiorowski


    Yes, but when I create a new LPAR (no clone profile) and it is created on a different Power box, then the VPD (including location address) is different than on the source LPAR.

    Changing/setting the MAC address still does the magic of IP recovery, though.

     

    So even though the VPD differs, the MAC address is enough to bring the IP configuration back. How the hell does the  AIX know it?

     

    The problem is that the source LPAR theoretically is unavailable for me. I don't have access to it, I cannot pre-gather any information, I don't have access to its HMC (ok, I know at least the VLANs for vNICs, so I can prepare a correct profile). Cloned storage is all I have.

    That's why I'm looking for the solution for the IP recovery having only the fresh LPAR and a clone of source disks. As the MAC address change did the job, I'm wondering if there is any way to retrieve the original MAC from Defined devices. If not by a high-level command (lscfg, entstat, netstat...), maybe there is another way to get deeper into the system?



  • 6.  Re: Where is MAC address information stored in AIX?

    Posted Wed March 09, 2016 09:07 AM

    Originally posted by: The_Doctor


    I gotta agree.... the MAC is not tied to the IP address.  (if it is, I've never seen a scenario which would make me believe it.)

     

    What few observations I've gone cloning & migrating LPARs leads me to believe the tie in of IP address goes like this:  (note: this ONLY applies to Virtual Ethernet Adapters.  I don't think this would apply to physical ethernet adapters)

    • IP address is tied to the enNN device in the ODM
    • enNN is tied to entNN
    • entNN is tied to the VIRTUAL slot number only ( e.g. xxxxxxxx-C5 )

    a.k.a.  if the Virtual slot number of the Ethernet adapter in the NEW LPAR matches the Virtual slot number in the OLD LPAR..... the IP address will follow.  If the Virtual slot numbers don't match, the IP address will not follow UNLESS you have some old lingering IP addresses left behind in your ODM from years gone by..... and they just happen to have aligned.  (BTW, I would suggest, the AIX admin guy should have been cleaned them up years ago but that's another story.)

     

    Be sure to take this with a grain of salt.  I have no inside knowledge of how it really works.  The above were just my observations when migrating LPARs (without LPM) a few years back. Someone may prove me wrong, which is ok too.