Topic
3 replies Latest Post - ‏2012-11-12T20:25:44Z by new23d
swellkarl
swellkarl
7 Posts
ACCEPTED ANSWER

Pinned topic Persistent Net Rules

‏2012-11-09T20:59:50Z |
 We make the following changes on all our RHEL6 on POWER LPARs:

cat /etc/udev/rules.d/70-persistent-net.rules | sed -e 's/ATTR.*NAME="eth0"/BUS=="vio", KERNELS=="3000000f", NAME="eth0"/g' > /tmp/70-persistent-net.rules.tmp
cp /tmp/70-persistent-net.rules.tmp /etc/udev/rules.d/70-persistent-net.rules

grep -v HWADDR /etc/sysconfig/network-scripts/ifcfg-eth0 > /tmp/ifcfg-eth0.tmp
cp /tmp/ifcfg-eth0.tmp /etc/sysconfig/network-scripts/ifcfg-eth0
 
Note that the KERNELS=="3000000f" is different depending on which virtual slot address you use for your Ethernet adapter.  In our case, we always use 15.

This allows us to move an LPAR cold to another physical POWER server, and if we keep the same virtual slot numbers, the IP addresses stay bound to the NICs. Do you see any reason to NOT doing this, or is there a better way to do it?

Thanks.
 
Karl
 
Updated on 2012-11-12T20:25:52Z at 2012-11-12T20:25:52Z by new23d
  • new23d
    new23d
    5 Posts
    ACCEPTED ANSWER

    Re: Persistent Net Rules

    ‏2012-11-12T20:25:52Z  in response to swellkarl
    You could simply delete [all] the *persistent* files in /etc/udev/rules.d/ . They get autogenerated at boot if not found.
     
    Removing HWADDR from ifcfg-ethN scripts is the only other thing you would need, that I can think of, and which you have already done.
    Updated on 2012-11-12T20:25:52Z at 2012-11-12T20:25:52Z by new23d
    • swellkarl
      swellkarl
      7 Posts
      ACCEPTED ANSWER

      Re: Persistent Net Rules

      ‏2012-11-12T19:33:37Z  in response to new23d
       If I just deleted all the persistent rules, wouldn't there be a possibility for the eth cards to be discovered in the wrong order?
      • new23d
        new23d
        5 Posts
        ACCEPTED ANSWER

        Re: Persistent Net Rules

        ‏2012-11-12T20:25:44Z  in response to swellkarl
        There is a possibility, yes. But in my experience, the order is predictable. If they get discovered in a particular order one time and you deleted the persistent rules file, they would be discovered with the same order again. If your current methodology works, then might as well stick to it. Or experiment with what we've discussed.
         
        A different approach, conceptually similar to what I've recently used in RHEV [1], would be to make or change your virtual_eth_adapters with manually specified and maintained MAC Addresses. So, you would delete the persistent files, keep the HWADDR lines in ifcfg-ethN files, and match the underlying LPAR's virtual ethernet adapter's MAC Address to the one the OS is expecting. I checked the manuals of mksyscfg and chsyscfg and they seem to support this. Not sure how applicable this is in your environment, but I've been very successfully migrating virtual machines between data centers by giving them the MAC Addresses they were expecting!
         
        One little note: in RHEV, I didn't have to delete the udev persistent files to get this working. You may have to since the slot possibly changes.
         
         
        Updated on 2012-11-12T20:25:44Z at 2012-11-12T20:25:44Z by new23d