2012년 9월 12일 수요일

VMware error: Device eth0 does not seem to be present

After I successfully deployed a VM from template via VI client, I got an error in associated with network while I was configuration the database through the console of the VM.

At first, I checked the configuration of its NIC
$ ping www.google.com
ping: nuknown host www.google.com 
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
HWADDR="00:50:56:B0:7F:24"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.20.174
NETMASK=255.255.255.0
DNS=168.126.63.1
DNS=168.126.63.2
GATEWAY=192.168.20.1
IPV6INIT=no

then, I restarted network of the VM.
$ service network restart
....
Bringing up interface eth0: Device eth0 does not seem to be present, defining initialization                                                [FAILED]



I found a post which include how to solve it. According to a post: http://aaronwalrath.wordpress.com/2011/02/26/cloned-red-hatcentosscientific-linux-virtual-machines-and-device-eth0-does-not-seem-to-be-present-message/

It was said like the following: 
"As it turns out there is a device manager for the Linux kernel named 'udev' which remembers the settings from the NIC of the virtual machine before it was cloned.  I was not familiar with udev because it was not installed in my previous Linux VM install, which were mainly CentOS 5."

I checked network device again.
$ ls /sys/class/net/
eth1   lo

It was wrong information. I intended that I added the NIC named "eth0". 

To solve this, I had to changed some information in /etc/udev/rules.d/70-persistent-net.rules file and in /etc/sysconfig/network-scripts/ifcfg-eth0.

1) Replace value of "ATTR{address} of "eth0 with the value of "eth1"
$ vi /etc/udev/rules.d/70-persistent-net.rules
.......
# PCI device 0x15ad:0x07b0 (vmxnet3) 
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}== "00:50:56:B0:7F:24", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
     -> wrong info.

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:8e:27:fe", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"            -> right info. 


My /etc/udev/rules.d/70-persistent-net.rules file was modified. 
$ cat /etc/udev/rules.d/70-persistent-net.rules
....
# PCI device 0x15ad:0x07b0 (vmxnet3) 
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}== " 00:50:56:8e:27:fe", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

2) Change NIC's mac address with the same value of above case.
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR=" 00:50:56:8e:27:fe"
NM_CONTROLLED="no"
.....

3) Restart the VM.

The network of the VM worked as "eth0" after reboot.

댓글 2개:

  1. 이봐 요! 낯선 사람이 당신의 기사를 도난되면 본 ​​적 위치에 직면 했습니까? 답변에 미리 감사합니다.

    답글삭제