RHEL 6.6 eth0 changes to eth2 when cloned VM

Latest response

Last week we had a servers cloned running
9.0.2.1-347714.rhel6.ga.x86_64
Red Hat Enterprise Linux Server release 6.6 (Santiago)

eth2 Link encap:Ethernet HWaddr 00:50:56:9F:63:EE
inet addr:10.23.122.18 Bcast:10.23.122.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe9f:63ee/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Now setting it as eth2 was not an an issue , it comes up and I can access fro outside etc, but the Application gives a lot of errors, and the vendor
has requested that it be set back to eth0, now I have had a look at the net and tried

1) deleting the /etc/udev/rules.d/70-persistent-net.rules file and rebooting, still comes back as eth2
2) modified /etc/sysconfig/network-scripts/ifcfg-eth2 (change and make it ifcfg-eth2)
3) Modifying /etc/udev/rules.d/70-persistent-net.rules info in the file to look at eth0 like below

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9f:63:ee", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
4) and then reboot , still comes up as eth2
5) tried renaming the NIC
ip link set eth2 eth0
Error: either "dev" is duplicate, or "eth0" is a garbage

Anybody have any ideas how I can get the server up as the original name of link eth0 ?

Zelko

Responses

What's in egrep -RHn eth[012] /etc/modprobe.* ?

Have you tried renaming ifcfg-eth2 to ifcfg-eth0 and altering the DEVICE=eth2 to DEVICE=eth0?

With the udev rules in your point 3, and changing ifcfg name and DEVICE, the device should name to eth0.

Jamie,

1) egrep -RHn eth2 /etc/modprobe.* ( shows nothing)
2) I have tried renaming ifcfg-eth2 to ifcfg-eth0, changing the device to eth0.
3) My 70-persistent-net.rules file looks like below

PCI device 0x15ad:0x07b0 (vmxnet3)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="00:50:56:9f:63:ee", ATTR{type}=="1", KERNEL=="eth", NAME="eth0" ( It only has one NIC, initially did come up as eth2, I edited to eth0 )
4) As previously mentioned, did totally delete the persistant file and reboot, still comes up as eth2?

Modified the file to state 'eth0' and rebooted, sill comes up as eth2 ?

Have removed the MAC address in the ifcfg-eth2 file and rebooted .. same

Have removed the MAC address in the ifcfg-eth0 file and rebooted .. same

Now reading about it, they all say it's simple as removing the file and modifying your ifcfg-ethx and reboot but that is not the case.

That's strange, those are the things RHEL6 uses to persistently name devices. I'd now check the actual devices match the MACs in the config files, check for anything silly in rc.local or /sbin/ifup-local, check for additional udev rules or misnamed network scipts (eg: ifcfg-eth0.dontrun will still be run), and read logs for device renames in dmesg and /var/log/messages after boot.

Ok will do, and will let you know, thanks

Looking at the /var/log/messages I can see the following:

Jul 27 14:35:45 virtsdm-scm004 kernel: vmxnet3 0000:03:00.0: eth0: NIC Link is Up 10000 Mbps
Jul 27 14:35:45 virtsdm-scm004 kernel: udev: renamed network interface eth0 to eth2
Jul 28 13:20:33 virtsdm-scm004 /etc/sysconfig/network-scripts/ifup-eth: Device eth0 does not seem to be present, delaying initialization.
Jul 28 13:21:38 virtsdm-scm004 /etc/sysconfig/network-scripts/ifup-eth: Device eth0 does not seem to be present, delaying initialization.
Jul 28 13:27:07 virtsdm-scm004 kernel: vmxnet3 0000:03:00.0: eth0: NIC Link is Up 10000 Mbps
Jul 28 13:27:07 virtsdm-scm004 kernel: udev: renamed network interface eth0 to eth2
Jul 28 13:32:57 virtsdm-scm004 /etc/sysconfig/network-scripts/ifup-eth: Device eth0 does not seem to be present, delaying initialization.
Jul 28 13:35:19 virtsdm-scm004 kernel: vmxnet3 0000:03:00.0: eth0: NIC Link is Up 10000 Mbps
Jul 28 13:35:19 virtsdm-scm004 kernel: udev: renamed network interface eth0 to eth2
Jul 28 13:48:48 virtsdm-scm004 kernel: vmxnet3 0000:03:00.0: eth0: NIC Link is Up 10000 Mbps
Jul 28 13:48:48 virtsdm-scm004 kernel: udev: renamed network interface eth0 to eth2
Jul 28 14:19:22 virtsdm-scm004 /etc/sysconfig/network-scripts/ifup-eth: Device eth0 does not seem to be present, delaying initialization.
Jul 28 14:19:45 virtsdm-scm004 /etc/sysconfig/network-scripts/ifup-eth: Device eth0 does not seem to be present, delaying initialization.
Jul 28 14:23:17 virtsdm-scm004 kernel: vmxnet3 0000:03:00.0: eth0: NIC Link is Up 10000 Mbps
Jul 28 14:23:17 virtsdm-scm004 kernel: udev: renamed network interface eth0 to eth2
Jul 29 10:39:19 virtsdm-scm004 kernel: vmxnet3 0000:03:00.0: eth0: NIC Link is Up 10000 Mbps
Jul 29 10:39:19 virtsdm-scm004 kernel: udev: renamed network interface eth0 to eth2

Looking at the above, that is some job out there renaming eth0 ro eth2 ?

Hi,

could this discussion help you? It looks it's the same issue as yours...

//Zdenek

Zdenek,

Thank you for your reply, what basically occurs in this situation is we are moving about 3000+ VM's from one Data Centre to another, now the VM group does the clone/copy to the destination Data Centre and then hands the server/node to the Sys Admin group to configure to the network aspect of it, ie modify /etc/resolv.conf + /etc/sysconfig/network ( if needed) and the ifcfg-ethx to reflect the new MAC address and reboot and then we habd it back to them.

Just to clarify the above link https://access.redhat.com/discussions/916563 that is stating that you should change eth0 to eth5 etc.

Now , do I try that as soon as I get the cloned node at it's destination ( as that is when the VM is handed over to us) or does this need to happen at some ealier stage ??

Zelko

Ok thank you all for your help, next time they clone I will try the procedure and will let you know how it went.

Zelko

Malkeet, make sure the values in /etc/udev/rules.d/70-persistent-net.rules match your actual network interface files. Also see (for reference, your mileage may vary, no warrantee) this link in a Red Hat discussion

Not that this bit will solve the issue, but this link https://access.redhat.com/solutions/58610 may give some background.

We finally managed to fix the issue and bring back all nodes to have eth0:

Procedure as follows:

1) On the node that has allready been moved/cloned
1. Remove network adapter and power it on – ( VM Group)

  1.  Log on to VM console & confirm no network adapter (ethx) has been picked up –  (Systems team)
    
     ifconfig -a   ( ensure no NIC card is seen..)
    
  2.  Rename ethx to old-xxx
    
    ie:
     cd /etc/sysconfig/network-scripts  ( and rename any ifcfg files to old.xxxxx)
    
  3. shutdown -h now ( from console)
  4. Assign a new network adapter with the 'old' MAC address and power on VM ( VM Group)
  5. Logon to the VM Console
    ipconfig -a ( ensure it has picked up only eth0 )
    cd /etc/sysconfig/network-scripts/
    ll ifcfg ( and rename the file you had previously as old-ifcfg-ethx to ifcfg-eth0 )
  6. vi ifcfg-eth0 ( and change the following
    DEVICE=eth0
    HWADDR=00:xx:yy:cc:bb:aa ( ENTER the OLD MAC address that was used before the clone)

SAVE the file

service network restart ( restart network)

Now you should be able to ping in and out of the machine and you have your orig NIC eth0

I hope this helps for anyone that hcomes accross the same scenario, Zelko

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.