Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1341460 - update dns settings in network by net-update will not take effect immediately
update dns settings in network by net-update will not take effect immediately
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-01 02:25 EDT by yalzhang@redhat.com
Modified: 2016-11-03 14:46 EDT (History)
2 users (show)

See Also:
Fixed In Version: libvirt-1.3.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:46:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description yalzhang@redhat.com 2016-06-01 02:25:45 EDT
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-02 21:21:42 EDT
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 07:42:17 EDT
Upstream commit (will be in 1.3.5)

commit 93b59fcff60ee3e2ac3e67164b992d1335e9d0a2
Author: Laine Stump <laine@laine.org>
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 01:59:15 EDT
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 14:46:15 EDT
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.