一、故障现象描述:
VMware Workstation 5,6;
Guest OS安装 SUSE Enterprise Server/Desktop 10; Open Enterprise Server 2;
将安装好的Guest OS Vmachine 目录拷贝到另外的Host,用VMware Workstation 打开,无论选择“拷贝”还是 “移动”方式,启动后,检查网络配置,均会多一个”eth1”的网卡,而且用yast或者命令行方式都无法配置该网卡的 IP 地址。Guest OS无法正常进行网络通讯。
二、故障分析
SLES有根据网络接口MAC地址向虚拟网络设备映射的机制,这种映射是通过udev来进行的。
udev会将映射的规则保存在/etc/udev/rules.d/30-net_persistent_names.rules文件中:
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="MAC>", IMPORT="/lib/udev/rename_netiface %k ethn"
其中:
SYSFS{address}对应一条MAC地址,IMPORT里包含遇到前面的MAC地址时利用/lib/udev/rename_netiface脚本将虚拟网络设备名映射为ethn的规则(n是阿拉伯数字)。
将VMware虚拟机移动或拷贝后,VMware虚拟机的MAC地址会发生变化。会在/etc/udev/rules.d/30-net_persistent_names.rules文件中添加新MAC地址到新虚拟网络接口名的映射。
三、排错操作过程
注: 在执行下述操作之前,记得在 Guest Os中先安装最新的VMware Tools 。
1.首先停止Network服务
vmoes2srv:/# rcnetwork stop
2.切换到 /etc/udev/rules.d 目录下,找到形如“xx-net persistent names.rules” 的文件,使用文本编辑工具打开:
vmoes2srv:/ # vi /etc/udev/rules.d/30-net_persistent_names.rules
配置文件可能的格式内容如下:
# This rules are autogenerated from /lib/udev/rename_netiface.
# But you can modify them, but make sure that you don't use an interface name
# twice. Also add such interface name rules only in this rules file. Otherwise
# rename_netiface will create wrong rules for new interfaces.
# It is safe to delete a rule, as long as you did not disable automatic rule
# generation. Only if all interfaces get a rule the renaming will work
# flawlessly. See also /etc/udev/rules.d/31-net_create_names.rules.
#
# Read /usr/share/doc/packages/sysconfig/README.Persistent_Interface_Names for
# further information.
#
# Use only a-z, A-Z and 0-9 for interface names!
#
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:72:8d:ee", IMPORT="/lib/udev/rename_netiface %k eth0"
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:04:1a:68", IMPORT="/lib/udev/rename_netiface %k eth1"
~
~
~
~
将其中所有的有效配置行,如:“SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:72:8d:ee", IMPORT="/lib/udev/rename_netiface %k eth0" 和
“SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:04:1a:68", IMPORT="/lib/udev/rename_netiface %k eth1" 全部注释掉。
3.顺序执行如下命令:
vmoes2srv:/# rmmod vmxnet
vmoes2srv:/# rmmod pcnet32
vmoes2srv:/# modprobe vmxnet
vmoes2srv:/# modprobe pcnet32
4.切换到 /etc/sysconfig/network 目录下,将原来的eth1的配置文件更名为 “ifcfg-eth0”
vmoes2srv:/ # cd /etc/sysconfig/network/
vmoes2srv:/etc/sysconfig/network # mv ifcfg-eth-id-00\:0c\:29\:72\:8d\:ee ifcfg-eth0
5.重新启动 network服务
vmoes2srv:/ # rcnetwork start
6.现在再执行 “yast2 network”,按照需要修改IP配置参数即可。
阅读(1260) | 评论(0) | 转发(0) |