Hi all,
thanks for the responses!
EDIT: Some relevant information, as the machine is managed by Opennebula (http://opennebula.org), I have Network manager disabled. And the network configuration is configured by Opennebula driver. May be the hotplug of devices is something not implemented in Opennebula driver? How does Network Manager handle the device attachments (an script hooked to some event)?
I simplified the scenario leaving just one interface in the machine, and I'm still seeing the same problem (I'm afraid the problem is not related to the interface naming).
I left the VM with CentOS 7 with just 1 interface named eth0 and model virtio.
Code: Select all
virsh # domiflist one-20
Interface Type Source Model MAC
-------------------------------------------------------
one-20-0 bridge br_mgmt virtio 02:XX:XX:XX:XX:XX
Then I detach and reattach the interface to the VM, and the interface is again created with the 'eth0' name (that's why I think the problem is not related to the naming of the interface),
but it remains in DOWN state.
Code: Select all
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
link/ether 02:00:0a:5f:54:5d brd ff:ff:ff:ff:ff:ff
The configuration file is still created with the ip configuration:
Code: Select all
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
TYPE=Ethernet
NETMASK=255.255.255.128
IPADDR=10.95.84.93
GATEWAY=10.95.84.1
If I do a
ifup eth0, the interface gets in UP state and the IPs get configured and everything works fine.
The dmesg logs when the interface is reattached:
Code: Select all
[581978.331057] pci 0000:00:03.0: BAR 6: assigned [mem 0x80000000-0x8003ffff pref]
[581978.342051] pci 0000:00:03.0: BAR 1: assigned [mem 0x80040000-0x80040fff]
[581978.346360] pci 0000:00:03.0: BAR 0: assigned [io 0x1000-0x101f]
[581978.361706] virtio-pci 0000:00:03.0: enabling device (0000 -> 0003)
[581978.401529] virtio-pci 0000:00:03.0: virtio_pci: leaving for legacy driver
and lspci looks 'fine':
Code: Select all
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
Subsystem: Red Hat, Inc Device 0001
Physical Slot: 3
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step
ping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 10
Region 0: I/O ports at 1000 [size=32]
Region 1: Memory at 80040000 (32-bit, non-prefetchable) [size=4K]
[virtual] Expansion ROM at 80000000 [disabled] [size=256K]
Capabilities: [40] MSI-X: Enable+ Count=3 Masked-
Vector table: BAR=1 offset=00000000
PBA: BAR=1 offset=00000800
Kernel driver in use: virtio-pci
Kernel modules: virtio_pci
I'd need the ifup to be executed automatically.
Is there any configuration I have to set for that to happen automatically?
Who should be responsible for setting the interface up?, the virtio-pci driver? the network service in CentOS 7?
Thank you very much in advance!
Regards,
Andrés