satis egitimisatis egitimitengda.pro
Welcome, Guest
Username: Password: Remember me
Archived CloudStack Forums for reference purposes please direct all future inquiries to the Apache CloudStack mailing lists.

incubator.apache.org/cloudstack/mailing-lists.html

TOPIC: Unable to register "eth0" on CentOS VM template

Unable to register "eth0" on CentOS VM template 1 year 6 months ago #12298

  • neontech
  • neontech's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 1
I have created a CustomVM template (CentOS 6.3 with few softwares added to it). I am able to create the VM from this template through CloudStack. Upon starting the VM, it is not registering itself to "eth0" interface instead it is registering an "eth1" interface.

I have also tried as suggested in the blog below.
aaronwalrath.wordpress.com/2011/02/26/cl...-be-present-message/

Has anyone came across this?

BTW - I did not encounter any issues when I created a VM of this template on VMWare (ie via vCenter)
Last Edit: 1 year 6 months ago by neontech.
The administrator has disabled public write access.

Re: Unable to register "eth0" on CentOS VM template 1 year 6 months ago #12343

  • mjohanson
  • mjohanson's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
  • Karma: 1
Seeing the same issue with a 6.3 template. Mine was after running a yum update on a 6.2 to get to 6.3 before saving as a template.

In looking through dmesg it appears that udev (at least in my case) is behind the issue:
udev: renamed network interface eth0 to eth1

There is no MAC Address information in the ifcfg-eth0 file:
DEVICE=eth0    
BOOTPROTO=dhcp   
ONBOOT=yes    
TYPE=Ethernet

So not quite sure why it would have re-written the file to eth1.
The administrator has disabled public write access.

Re: Unable to register "eth0" on CentOS VM template 1 year 6 months ago #12358

  • mjohanson
  • mjohanson's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
  • Karma: 1
Did some more testing today with a CentOS6 template and without a yum update, the same issue happened:
udev: renamed network interface eth0 to eth1

/etc/redhat-release:

CentOS release 6.2 (Final)

Thought maybe it was due to mac address information in the ifcfg file (which would cause a similar problem switching drives from one chassis to another incase of say hardware failure), but the ifcfg-eth0 file has only the following in the one the template is made from:

[root@CentOS62 ~]# less /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet

Tried to bring the network up in the template built VM:


[root@localhost ~]# /etc/init.d/network restart
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: lo: Disabled Privacy Extensions
[ OK ]
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
[FAILED]

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet

Anyone have any thoughts on wy CentOS 6 is having such issues?
The administrator has disabled public write access.

Re: Unable to register "eth0" on CentOS VM template 1 year 6 months ago #12359

  • mjohanson
  • mjohanson's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
  • Karma: 1
Seems that vmware has this same issue.

I just did the following as recommended in the above link:

# cd /etc/udev/rules.d
# cp 70-persistent-net.rules /root/
# rm 70-persistent-net.rules

But instead of rebooting I just shutdown the vm and made my template. eth0 came up without an issue on new vm builds from that template.
The administrator has disabled public write access.
The following user(s) said Thank You: kirkkosinski

Re: Unable to register "eth0" on CentOS VM template 1 year 5 months ago #12370

  • kirkkosinski
  • kirkkosinski's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 70
  • Thank you received: 6
  • Karma: 6
I've seen this before. It seems to be common when cloning CentOS. Here's a thread from someone having the same issue on the Citrix forums:

Citrix Forums : Device eth1 does not seem to be present

For best results, before converting a CentOS 6.x VM to a template, delete the /etc/udev/rules.d/70-persistent-net.rules file, and edit /etc/sysconfig/network-scripts/ifcfg-eth0 to remove the HWADDR line. When you deploy a new VM from the template, the network should Just Work™. :)

Besides that, you can prepare other stuff to be cloned. For example, delete the SSH keys in /etc/ssh/ so on first boot sshd will generate new keys.
The administrator has disabled public write access.

Re: Unable to register "eth0" on CentOS VM template 1 year 4 months ago #12738

  • badge
  • badge's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Very helpful, thanks! This completely solved my problem, and I also updated my template to exclude SSH keys.

System Details:

CentOS 6.3 on VMware ESXi 5.1
The administrator has disabled public write access.
Time to create page: 0.310 seconds

Open@Citrix

Citrix supports the open source community via developer support and evangeslism. We have a number of developers and evangelists that participate actively in the open source community in Apache Cloudstack, OpenDaylight, Xen Project and XenServer. We also conduct educational activities via the Build A Cloud events held all over the world. 

Connect