Bug 2026765
Summary: | Can't define a TFTP server without a DHCP server in network configuration | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Jiri Kortus <jikortus> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
libvirt sub component: | General | QA Contact: | yalzhang <yalzhang> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | unspecified | ||
Priority: | unspecified | CC: | dzheng, jdenemar, mprivozn, pkrempa, xuzhang, yanqzhan, yicui |
Version: | 9.0 | Keywords: | Triaged, Upstream |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-8.5.0-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-11-15 10:03:03 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | 8.5.0 |
Embargoed: |
Description
Jiri Kortus
2021-11-25 18:27:21 UTC
Generally we don't try to support every possible configuration but only those which make sense together with the usecase of running VMs. Thus any more complex setup as in the case of running a different DHCP server are not something we've designed this for, as it's not a general purpose dnsmasq config tool. That said I'm not against the idea altogheter, I just don't think this is justified for a downstream RFE. @jikortus is there need for this bug to be private? We like to have bugs open by default (until they contain customer sensitive data) and include links in commits. Can you please make it public? Michal: Sure, I'll make it public. Thank you for fixing this bug! Merged upstream as: 12be42ee7e network: Generate TFTP config regardless of DHCP bab462db6e network: Separate DHCP config generator into a function 314dac422d network: Initialize variables in networkDnsmasqConfContents() v8.4.0-5-g12be42ee7e Reproduce the bug on libvirt-8.3.0-1.el9.x86_64 1. define and start a network with tftp setting, but no dhcp enabled: # virsh net-dumpxml net_boot <network> <name>net_boot</name> <uuid>bdaf91ff-5f91-4edb-ab9f-6ac6253cae31</uuid> <forward mode='nat'> <nat> <port start='1024' end='65535'/> </nat> </forward> <bridge name='virbr1' stp='on' delay='0'/> <mac address='52:54:00:10:0b:a1'/> <ip address='192.168.120.1' netmask='255.255.255.0'> <tftp root='/var/lib/tftpboot'/> </ip> </network> # cat /var/lib/libvirt/dnsmasq/net_boot.conf ##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE ##OVERWRITTEN AND LOST. Changes to this configuration should be made using: ## virsh net-edit net_boot ## or other application using the libvirt API. ## ## dnsmasq conf file created by libvirt strict-order pid-file=/run/libvirt/network/net_boot.pid except-interface=lo bind-dynamic interface=virbr1 addn-hosts=/var/lib/libvirt/dnsmasq/net_boot.addnhosts there is no tftp related settings in the conf file. Test on v8.4.0-83-g215b2466cd: When there is no tftp folder prepared, the network will fail to start: # virsh net-start net_boot error: Failed to start network net_boot error: internal error: Child process (VIR_BRIDGE_NAME=virbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/net_boot.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper) unexpected exit status 3: dnsmasq: TFTP directory /var/lib/tftpboot inaccessible: No such file or directory When the tftp folder prepared, start the network: # virsh net-start net_boot Network net_boot started # cat net_boot.conf ##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE ##OVERWRITTEN AND LOST. Changes to this configuration should be made using: ## virsh net-edit net_boot ## or other application using the libvirt API. ## ## dnsmasq conf file created by libvirt strict-order pid-file=/run/libvirt/network/net_boot.pid except-interface=lo bind-dynamic interface=virbr1 enable-tftp tftp-root=/var/lib/tftpboot addn-hosts=/var/lib/libvirt/dnsmasq/net_boot.addnhosts # netstat -anu | grep ":69 " udp 0 0 192.168.120.1:69 0.0.0.0:* try to get a file on the host: # tftp 192.168.120.1 -c get pxelinux.0 # ll pxelinux.0 -rw-r--r--. 1 root root 42681 Jun 2 06:06 pxelinux.0 Start a vm which connected to this network, configure a static ip like 192.168.120.20/24, and try to get a file: # tftp 192.168.120.1 -c get pxelinux.0 # ll pxelinux.0 -rw-r--r--. 1 root root 42681 Jun 2 14:18 pxelinux.0 Test on libvirt-8.5.0-1.el9.x86_64 with the same steps in comment 8, the result is as expected. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Low: libvirt security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:8003 |