xcp-ng / xcp

Entry point for issues and wiki. Also contains some scripts and sources.
https://xcp-ng.org
1.26k stars 74 forks source link

Guest VM missing Virtio Network Device in xcp-ng-8.2.1 #661

Closed alex-765123 closed 2 weeks ago

alex-765123 commented 2 weeks ago

Hi

I just install xcp-ng-8.2.1 in HP DL380p Gen8. Installation is success and Onboard NIC card is detected as below [16:28 xcp-ng-8-2 ~]# lspci | grep -i eth 03:00.0 Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01) 03:00.1 Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01) 03:00.2 Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01) 03:00.3 Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)

Full network interface information can be returned using ethtool command [16:28 xcp-ng-8-2 ~]# ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: on Supports Wake-on: g Wake-on: g Current message level: 0x000000ff (255) drv probe link timer ifdown ifup rx_err tx_err

After Quick deploy Xen Orchestra, new guest VM "XOA" is installed in the xng-cp. By default, Guest Utilities "Management agent 1.0.0-proto-0.4.0" is installed. and NIC type "Realtek RTL8139" is selected [16:37 30] xoa@xoa:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm

However, found that no VirtualIO Network device is returned in the lspci command [16:32 30] xoa@xoa:~$ sudo lspci 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01) 00:02.0 VGA compatible controller: Cirrus Logic GD 5446 00:03.0 SCSI storage controller: XenSource, Inc. Xen Platform Device (rev 01)

Also ethtool command can only display below information 16:34 30] xoa@xoa:~$ sudo ethtool enX0 Settings for enX0: Link detected: yes

speed and duplux information cannot be displayed if cat the below file [16:36 30] xoa@xoa:~$ sudo cat /sys/class/net/enX0/mtu 1500 [16:36 30] xoa@xoa:~$ sudo cat /sys/class/net/enX0/speed cat: /sys/class/net/enX0/speed: Invalid argument [16:37 30] xoa@xoa:~$ sudo cat /sys/class/net/enX0/duplex cat: /sys/class/net/enX0/duplex: Invalid argument

Change network interface speed and duplex is not allowed [16:43 30] xoa@xoa:~$ sudo ethtool -s enX0 speed 1000 duplex full netlink error: Operation not supported

I try to create new AlmaLinux9 GuestOS in the xcp-ng. Latest Guest Utilities "Management agent 8.2.0-2" is installed. and NIC type "Realtek RTL8139" is selected However, same issue found. [root@almalinux9-01 ~]# cat /etc/redhat-release AlmaLinux release 9.4 (Seafoam Ocelot)

[root@almalinux9-01 ~]# lspci 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01) 00:02.0 VGA compatible controller: Device 1234:1111 00:03.0 SCSI storage controller: XenSource, Inc. Xen Platform Device (rev 02)

[root@almalinux9-01 ~]# cat /sys/class/net/enX0/mtu 1500 [root@almalinux9-01 ~]# cat /sys/class/net/enX0/speed cat: /sys/class/net/enX0/speed: Invalid argument [root@almalinux9-01 ~]# cat /sys/class/net/enX0/duplex cat: /sys/class/net/enX0/duplex: Invalid argument

[root@almalinux9-01 ~]# ethtool -s enX0 speed 1000 duplex full netlink error: Operation not supported

Same problem even i change the NIC type to "intel e1000"

Those problem is due to missing VirtualIO network device, or other reason? May i know how to solve the issues?

It is great appreciate if you can help on it

olivierlambert commented 2 weeks ago

Hi,

Xen isn't KVM, it doesn't work with virtIO. Virtual NICs are not using emulation after the kernel boots: only before, eg at Grub stage and then switch to Xen PV drivers.

MTU must be changed at the XCP-ng Network level.

See https://docs.xcp-ng.org/networking/ for more details.

Also, it's better to use our forum https://xcp-ng.org/forum for general question, leaving the bug tracker for confirmed bugs. Feel free to open a thread there :+1: Thanks!

alex-765123 commented 2 weeks ago

Hi,

Thanks for your prompt reply

Since we use zabbix to monitor all OS. In order to trigger NIC throughput alarm, speed of the network interface will be read. However, if the GuestOS installed in xcp-ng, zabbix fail to read network speed. But if GuestOS installed in vmware ESXi, speed of network interface can be read successfully.

I fully read the https://docs.xcp-ng.org/networking/ but still no idea how to solve the problem

Why the guestOS installed in xcp-ng cannot display full information of network interface? Any setting/package installation is needed to make the network interface display properly?

[root@almalinux9-01 ~]# ethtool enX0 Settings for enX0: Link detected: yes

[root@almalinux9-01 ~]# cat /sys/class/net/enX0/speed cat: /sys/class/net/enX0/speed: Invalid argument

[root@almalinux9-01 ~]# cat /sys/class/net/enX0/duplex cat: /sys/class/net/enX0/duplex: Invalid argument

[root@almalinux9-01 ~]# ethtool -s enX0 speed 1000 duplex full netlink error: Operation not supported

Thanks for help again

olivierlambert commented 2 weeks ago

There is no emulated device, it's just a PV driver to talk to Xen directly. You cannot read speed because there's no speed for a PV driver. XCP-ng is not KVM or ESXi, it's different, so you cannot do exactly everything the same way.

I'm not even sure to understand the problem you are trying to solve even exists in XCP-ng in the first place (since… there's no emulated devices).

alex-765123 commented 2 weeks ago

Hi

I also installed windows10 in the xcp-ng. In the device manager, can see the driver "XCP-ng PV Network Device" is installed Speed of the Network interface can be displayed successfully

However, it seems fail to read Speed/Duplex of Network interface in Linux platform. My problem is, if we choose xcp-ng as virtual machine, Speed/Duplex of Network interface have to be read successfully. Any XCP-ng PV driver for Linux can be installed so that the Linux can display Speed/Duplex of Network interface?

Fohdeesha commented 2 weeks ago

Hi, linux comes with xen PV drivers installed in the kernel already, that's why your VM is not reporting link speeds - because it's using the most efficient fastest method - PV drivers, not a fully emulated device. This is also why the intel / realtek NIC type dropdown option on your VM has no effect, because these old school emulated NICs are not used on modern VMs.

As Olivier said, there's no link speed to report - the pv network device in your VM does not have an ethernet link with a negotiated speed, it's just copying packets in and out of memory on the hypervisor, the link speed is theoretically infinite. The same happens in windows VMs, however windows just lies and reports a standard link speed on PV NICs. Windows VMs are still capable of higher throughput than the speed it reports, for ethernet traffic to other VMs on the same host - because the traffic never touches a real NIC.

So, having Zabbix report throughput alarms on these virtual NICs doesn't make sense in the first place, which is your root issue in my opinion. There's no throughput "limit" to report on - VMs on the same host can theoretically send each other ethernet traffic as fast as your hypervisor can copy it in and out of memory. If you need throughput alarms because you're afraid of saturating your actual physical host links, then monitor the hypervisor host itself with zabbix, and set your alarms there.

alex-765123 commented 2 weeks ago

Hi

Fully understanding now, thanks for you both help and support

olivierlambert commented 2 weeks ago

Great! If you have other questions/remarks, happy to read you on https://xcp-ng.org/forum !