克隆kvm的centos的镜像之后,启动克隆后的虚拟机报错,出现device eth0 does not seem to be present, delaying initialization这个错误
解决办法是
先打开/etc/udev/rules.d/70-persistent-net.rules
#cat /etc/udev/rules.d/70-persistent-net.rules
# 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:0x10c9 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:9e:b5:e1:14", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x10c9 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:9e:b5:e1:15", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
编辑/etc/sysconfig/network-scripts/ifcfg-eth0 修改HWADDR为eth1的HWADDR
#cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:26:9e:b5:e1:15
TYPE=Ethernet
UUID=0564d60b-4d9c-463a-86f3-3522f58d76ad
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.2.115
NETMASK=255.255.255.0
NETWORK=192.168.2.0
GATEWAY=192.168.2.1
BROADCAST=192.168.2.255
删除/etc/udev/rules.d/70-persistent-net.rules
#rm -rf /etc/udev/rules.d/70-persistent-net.rules
重启系统
#reboot