UCSD - UCSD Cloning Tips and Tricks

Version 4

    Tips and tricks

    ============

     

     

    In my lab I usually clone my current UCSD instance vCenter.

    The resulting clone has a few benefits for me.

    I have my old system still working and I have a new system for testing.

    In this cloning process I have noticed that the network interface advances from

    eth0 to eth1 and then the next clone from eth1 to eth2 and so on.

     

    In order to stop this the following file can be edited:


         vi /etc/udev/rules.d/70-persistent-net.rules


    File before I edited it:


    # This file was automatically generated by the /lib/udev/write_net_rules

    # program, run by the persistent-net-generator.rules rules file.

    #

    # You can modify it, as long as you keep each rule on a single

    # line, and change only the value of the NAME= key.

     

    # PCI device 0x8086:0x100f (e1000)

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:94:10:cf", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    # PCI device 0x8086:0x100f (e1000)

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:94:10:d2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

    # PCI device 0x8086:0x100f (e1000)

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:94:10:d9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"



    File after I edited it (changes are in red):


     

    # This file was automatically generated by the /lib/udev/write_net_rules

    # program, run by the persistent-net-generator.rules rules file.

    #

    # You can modify it, as long as you keep each rule on a single

    # line, and change only the value of the NAME= key.

    # PCI device 0x8086:0x100f (e1000)

    #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:94:10:cf", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    # PCI device 0x8086:0x100f (e1000)

    #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:94:10:d2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

    # PCI device 0x8086:0x100f (e1000)

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:94:10:d9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


    Basic idea is the rename the last line from ethx to eth0 and comment out the previous lines.


    Tested on UCSD 6.0


    Added info:

    I had an instance where this didn't work. If you modify the 70-persistent-net.rules and eth0 still doesn't come up, you have to also modify the ifcfg-ethx file in the /etc/sysconfig/network-scripts directory. In my case, UCSD had changed the interface to eth1, added the line in the 70-persistent-net.rules file and changed the ifcfg-eth0 file to ifcfg-eth1 as well as changed the name and device references in that file.  I wanted to keep eth0, so this is what I did:

    - login as root

    - modified /etc/udev/rules.d/70-persistent-net.rules file as Orf shows above

    - changed the name of /etc/sysconfig/network-scripts/ifcfg-eth1 to ifcfg-eth0  (mv ifcfg-eth1 ifcfg-eth0)

    - edit ifcfg-eth0 and change all references to eth1 to eth0  (vi ifcfg-eth0)

    - reboot appliance


    Hope that helps if anyone is struggling with this. As always, thanks to ogelbric