RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1341460 - update dns settings in network by net-update will not take effect immediately
Summary: update dns settings in network by net-update will not take effect immediately
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-01 06:25 UTC by yalzhang@redhat.com
Modified: 2016-11-03 18:46 UTC (History)
2 users (show)

Fixed In Version: libvirt-1.3.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:46:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description yalzhang@redhat.com 2016-06-01 06:25:45 UTC
Description of problem:
update dns settings in network will not take effect immediately. 

Version-Release number of selected component (if applicable):
libvirt-1.3.4-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
# virsh net-dumpxml network
<network>
  <name>network</name>
  <uuid>2531df5b-adf0-471f-95f7-68d627053342</uuid>
  <bridge name='virbr2' stp='on' delay='0'/>
  <mac address='52:54:00:90:a1:29'/>
  <domain name='example.com'/>
  <dns>
    <txt name='example' value='example value'/>
    <srv service='name' protocol='tcp' domain='test-domain-name' target='englab.nay.redhat.com' port='1024' priority='10' weight='10'/>
    <host ip='192.168.10.2'>
      <hostname>myhost</hostname>
      <hostname>myhostalias</hostname>
    </host>
  </dns>
  <ip address='192.168.10.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.10.2' end='192.168.10.254'/>
    </dhcp>
  </ip>
</network>
# virsh net-update network delete dns-srv "<srv service='name' protocol='tcp'/>"
Updated network network live state
# virsh net-update network delete dns-txt "<txt name='example'/>"
Updated network network live state
# virsh net-dumpxml network
<network>
  <name>network</name>
  <uuid>2531df5b-adf0-471f-95f7-68d627053342</uuid>
  <bridge name='virbr2' stp='on' delay='0'/>
  <mac address='52:54:00:90:a1:29'/>
  <domain name='example.com'/>
  <dns>
    <host ip='192.168.10.2'>
      <hostname>myhost</hostname>
      <hostname>myhostalias</hostname>
    </host>
  </dns>
  <ip address='192.168.10.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.10.2' end='192.168.10.254'/>
    </dhcp>
  </ip>
</network>
# cat /var/lib/libvirt/dnsmasq/network.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 network
## or other application using the libvirt API.
##
## dnsmasq conf file created by libvirt
strict-order
domain=example.com
expand-hosts
pid-file=/var/run/libvirt/network/network.pid
except-interface=lo
bind-dynamic
interface=virbr2
dhcp-option=3
no-resolv
txt-record=example,example value
srv-host=_name._tcp.test-domain-name,englab.nay.redhat.com,1024,10,10
dhcp-range=192.168.10.2,192.168.10.254
dhcp-no-override
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/network.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/network.addnhosts


Actual results:
The txt and srv still exists in the network.conf file after delete. And still can parse correctly in the guest.

Expected results:
dnsmasq should restart to get the change about dns.

Additional info:
N/A

Comment 2 yalzhang@redhat.com 2016-06-03 01:21:42 UTC
There is already a patch from laine for this problem.
https://www.redhat.com/archives/libvir-list/2016-May/msg02122.html

Comment 3 Laine Stump 2016-06-03 11:42:17 UTC
Upstream commit (will be in 1.3.5)

commit 93b59fcff60ee3e2ac3e67164b992d1335e9d0a2
Author: Laine Stump <laine>
Date:   Tue May 31 11:51:29 2016 -0400

    network: restart dnsmasq after adding/removing txt and srv records

Comment 5 yalzhang@redhat.com 2016-06-08 05:59:15 UTC
verified on libvirt-1.3.5-1.el7.x86_64, the result is as expected.Move it to verified.

1. start a network with srv txt and host defined in dns section.

2. start a guest using this network, and use dig to check all the srv, txt, host record works fine.

3. check the network's conf file and the pid of dnsmasq 

4. delete the txt, srv, and host in dns section
# virsh net-update network add dns-txt "<txt name='example' value='example-test'/>"
Updated network network live state

5.On the guest, check 
#dig -t txt example ----->will get no answer.
check the config file on the host, the txt record is deleted.
# cat /var/lib/libvirt/dnsmasq/network.conf
check the pid of dnsmasq, it is different with step 3.
6. same steps for dns-srv, dns-host
7. same with step5 to check "add dns-txt" "add dns-srv"
# virsh net-update network add dns-txt "<txt name='example1' value='example-test1'/>"
Updated network network live state
8. for add dns-host
# cat net.xml
<host ip='192.168.10.3'>
      <hostname>mynewhost</hostname>
      <hostname>mynewhostalias</hostname>
    </host>

# virsh net-update  network add dns-host --xml net.xml
Updated network network live state
# cat /var/lib/libvirt/dnsmasq/network.addnhosts
192.168.10.3	mynewhost	mynewhostalias	

9. these section can not be modified
# virsh net-update network modify dns-srv "<srv service='name' protocol='tcp' domain='test' target='tessdfdf'/>"
error: Failed to update network network
error: Operation not supported: DNS SRV records cannot be modified, only added or deleted
# virsh net-update network modify dns-txt "<txt name='example' value='example-'/>"
error: Failed to update network network
error: Operation not supported: DNS TXT records cannot be modified, only added or deleted

10. add same record will report error
# cat /var/lib/libvirt/dnsmasq/network.addnhosts
192.168.10.3	mynewhost	mynewhostalias	
# cat net.xml
<host ip='192.168.10.3'>
      <hostname>myneeeewhost</hostname>
      <hostname>myneeeewhostalias</hostname>
    </host>
# virsh net-update  network add dns-host --xml net.xml
error: Failed to update network network
error: Requested operation is not valid: there is already at least one DNS HOST record with a matching field in network network

Comment 7 errata-xmlrpc 2016-11-03 18:46:15 UTC
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, 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://rhn.redhat.com/errata/RHSA-2016-2577.html


Note You need to log in before you can comment on or make changes to this bug.