lmhostid获取hostid为空问题

问题描写叙述

今天迁移曾经的一个装有flexlm的虚拟机,结果发如今迁移后启动时报错

... Wrong hostid on SERVER line for license file
...
... SERVER line says 00e081787ba8, hostid is (Cannot get hostid of type 2 [])
... Invalid hostid on SERVER line


解决的方法

从问题描写叙述看,好像是取到hostid有问题,用lmhostid检查一下,发现取到的hostid为”“

./lmhostid 
lmhostid - Copyright (c) 1989-2004 by Macrovision Corporation. All rights reserved.
The FLEXlm host ID of this machine is ""


因为FLEXlm会使用第一块网卡(eth0)的mac地址做hostid,所以用ifconfig检查网络配置。发现当中没有eth0。例如以下:

eth1      Link encap:Ethernet  HWaddr 00:E0:81:78:7B:A8  
inet addr:192.168.0.88 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:81ff:fe78:7ba8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2463804 errors:0 dropped:0 overruns:0 frame:0
TX packets:345560 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:924819172 (881.9 MiB) TX bytes:34087357 (32.5 MiB)
Interrupt:11

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2843863 errors:0 dropped:0 overruns:0 frame:0
TX packets:2843863 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:729294023 (695.5 MiB) TX bytes:729294023 (695.5 MiB)


可是在用linux自带网络配置工具和/etc/sysconfig/network-scripts/下的文件配置看。确实是用的eth0。这说明配置出现了不一致问题。

最后。检查/etc/udev/rules.d/70-persistent-net.rules文件

# PCI device 0x1af4:0x1000 (virtio-pci)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*l", ATTR{address}=="00:e0:81:78:7b:a8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8139 (8139cp)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:78:7b:a8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


发现了问题,里面有两个网卡配置项。果断改动为

# PCI device 0x10ec:0x8139 (8139cp)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:78:7b:a8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


然后又一次启动机器。问题解决。