Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

eth0 renamed as eth1 on vmware -when cloning using template Linux machine

Posted on 2012-09-10
14
Medium Priority
?
1,393 Views
Last Modified: 2012-10-16
Hi All Please help me with the solution apart from Udev rules editing for this problem so that I dont need to edit udev rules for solve this issue...

VMware - when creating a rhel machine using template this issue came and eth0 renamed as eth1 i want to resolve it so that no need to change it after installation..pls advice
0
Comment
Question by:apunkabollywood
  • 8
  • 6
14 Comments
 
LVL 124
ID: 38383047
This is a SOFTWARE Bug which exists when an Linux VM is CLONED in ALL Hypervisors.

This is not specific to VMware.

At present, apart from editing the udev rules, and clearing the file, it as is.

if you look at the rules, you will see why eth1 is created because the MAC address has been changed.
0
 

Author Comment

by:apunkabollywood
ID: 38383096
So there is no any alternative for it ...because i need to create lotz of Machines and its now headache to change it every time :( from script or etc
0
 
LVL 124
ID: 38383116
the issue is the MAC Address, we created a script to erase the created udev rules, and then clone the server without the udev rules created.

then at runtime, first clone power-on the udev rules run, map the correct MAC address, and you get a single eth0 with correct MAC Address.

So try and create your Golden Image, then Delete the Rules, and then Convert to CLONE.

Deploy Clone.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:apunkabollywood
ID: 38383583
Would you please help with that script ...if you have? plese
0
 

Author Comment

by:apunkabollywood
ID: 38384297
Hello Han ..please m little bit confuse about ur above steps..if you could give me step by step procedure of it ...it would be great ...:)
0
 
LVL 124
ID: 38384320
1. Create a Linux VM, Power On, Make all your changes, just before you Power Off, delete the udev, rules -

(udev rules are run automatically re-run at startup, and maps MAC Address to eth(x).)

2. CLONE

3. At startup the CLONE will have new MAC Address, Udev rules will run for first time, MAC address will Map to correct eth0.

the reason it fails is because you have an older udev rule, with original MAC address...

so you end up with eth0, eth1...
0
 

Author Comment

by:apunkabollywood
ID: 38385878
Same problem is coming :(
0
 
LVL 124
ID: 38385899
check your persistent rules
0
 

Author Comment

by:apunkabollywood
ID: 38386138
I think rules are same as they before ...

what i have tried:

1. Creating fresh machine using DVD than delete that UDEV rules only 70-Presistent-net file
and than making clone of it -  BUT SAME ISSUE

2. Creating machine with same issues - Did all the work like changing mac and 70-presistent file and solve that issue than delete those udev rules and clone it -BUT Issue remain same

I am trying on RHEL 6.2
0
 
LVL 124
ID: 38386159
if the rules do no exist, at machine power-up, the udev will be created with the correct mac address.
0
 

Author Comment

by:apunkabollywood
ID: 38386188
want to confirm what do you mean by udev rules :

All files under /etc/udev shud deleted or only 70-persistent-net under /etc/udev/rules.d/ shud deleted?
0
 
LVL 124

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 total points
ID: 38386228
the file is /etc/udev/rules.d/70-persistent-net.rules. After cloning, it will contain a reference to the old network interface as eth0:


The easiest way to fix this problem is to simply delete the file. Linux will regenerate it properly the next time it boots up.

sudo rm /etc/udev/rules.d/70-persistent-net.rules

Deleting the file from my master VM. After shutting it down,  cloned from that state. Every clone would then generate its own udev rule on “first” boot.
0
 

Author Comment

by:apunkabollywood
ID: 38391713
Thanks for ur Help Hanccocka for your help but dont know it still taking same MAC :(
0
 

Author Closing Comment

by:apunkabollywood
ID: 38500663
Its done finally Thank you :)
0

Featured Post

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Ransomware is a malware that is again in the list of security  concerns. Not only for companies, but also for Government security and  even at personal use. IT departments should be aware and have the right  knowledge to how to fight it.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question