Bug 1309529 - The domain can not ping outside or get IP after the network (route or nat mode) destroy and start during the domain running
The domain can not ping outside or get IP after the network (route or nat mod...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-17 22:25 EST by yalzhang@redhat.com
Modified: 2016-02-18 03:29 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-18 03:29:00 EST
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)

  None (edit)
Description yalzhang@redhat.com 2016-02-17 22:25:57 EST
Description of problem:
The domain can not ping outside or get IP after the network (route or nat mode) destroy and start during the domain running

Version-Release number of selected component (if applicable):
# rpm -q libvirt
libvirt-1.2.17-13.el7_2.3.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.3.0-31.el7_2.5.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Start a guest use default nat network.

[root@localhost tmp]# virsh start r7
Domain r7 started

[root@localhost tmp]# virsh dumpxml r7 | grep /interface -B8
    </controller>
    <interface type='network'>
      <mac address='52:54:00:48:ef:a8'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </interface>

2. On guest, check it can get dhcp ip and ping outside.
# ifconfig
ens11: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.122.192  netmask 255.255.255.0  broadcast 192.168.122.255
        inet6 fe80::5054:ff:fe48:efa8  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:48:ef:a8  txqueuelen 1000  (Ethernet)
.............
# ping www.baidu.com
PING www.a.shifen.com (119.75.217.109) 56(84) bytes of data.
64 bytes from 119.75.217.109: icmp_seq=1 ttl=48 time=31.0 ms
...........

3. On host, destroy and start the default network.
[root@localhost tmp]# arp | grep 192
192.168.122.192          ether   52:54:00:48:ef:a8   C                     virbr0

[root@localhost tmp]# virsh net-destroy default
Network default destroyed

[root@localhost tmp]# virsh net-start default
Network default started

[root@localhost tmp]# arp | grep 192
[root@localhost tmp]#

4. on guest, the network can not ping outside then even after restart.
guest# ping www.baidu.com
ping: unknown host www.baidu.com

guest# ping 10.66.5.120
PING 10.66.5.120 (10.66.5.120) 56(84) bytes of data.
From 192.168.122.192 icmp_seq=1 Destination Host Unreachable
From 192.168.122.192 icmp_seq=2 Destination Host Unreachable
^C

guest# ping 192.168.122.1
PING 192.168.122.1 (192.168.122.1) 56(84) bytes of data.
From 192.168.122.192 icmp_seq=1 Destination Host Unreachable
From 192.168.122.192 icmp_seq=2 Destination Host Unreachable
...

guest# ifconfig
ens11: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.122.192  netmask 255.255.255.0  broadcast 192.168.122.255
...

guest# service network restart
Restarting network (via systemctl):  Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.
                                                           [FAILED]


5. On the guest, restart it by ctrl+alt+del.The guest can not get ip.
guest# dhclient
guest# ifconfig
ens11: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 52:54:00:48:ef:a8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 2052 (2.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

6. Only after "virsh destroy r7" "virsh start r7", the guest can get ip and ping outside.
7. try other type of network in this scenario.


Actual results:
The guest can not ping outside after the nat network destroy and start during the guest running.
Routed network's performance is the same as nat in this scenario.
Other network type related with macvtap, the guest's network work well even after network on the host destroyed during the guest running.


Expected results:
The guest's network should work normally after host network restart.

Additional info:
N/A
Comment 2 yalzhang@redhat.com 2016-02-18 02:17:23 EST
1. Correct the "Expected restults"
Expected results:
The guest's network should work normally after virtual network restart on host.

2. Add additional info for step 4 in reproduce steps,
[root@test Desktop]# service network restart
Restarting network (via systemctl):  Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.
                                                           [FAILED]
[root@test Desktop]# systemctl status network.service
network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network)
   Active: failed (Result: exit-code) since Thu 2016-02-18 14:55:42 CST; 1min 17s ago
  Process: 3432 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
  Process: 3620 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Feb 18 14:54:56 test network[3620]: Bringing up loopback interface:  Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Feb 18 14:54:56 test network[3620]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Feb 18 14:54:56 test network[3620]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Feb 18 14:54:57 test network[3620]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Feb 18 14:54:57 test network[3620]: [  OK  ]
Feb 18 14:55:42 test network[3620]: Bringing up interface eth0:  Error: Connection activation failed.
Feb 18 14:55:42 test network[3620]: [FAILED]
Feb 18 14:55:42 test systemd[1]: network.service: control process exited, code=exited status=1
Feb 18 14:55:42 test systemd[1]: Failed to start LSB: Bring up/down networking.
Feb 18 14:55:42 test systemd[1]: Unit network.service entered failed state.
[root@test Desktop]# 
[root@test Desktop]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5054:ff:feff:75af  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:ff:75:af  txqueuelen 1000  (Ethernet)
        RX packets 61  bytes 4559 (4.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 83  bytes 10456 (10.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

After the host's virtual network restart during guest running, the guest can not get IP even after guest restart(do not use "virsh destroy" && "virsh start").
Comment 3 Jiri Denemark 2016-02-18 03:29:00 EST
Yeah, destroying a network will disconnect all domains attached to it. If you want to change configuration of a running network with attached domain, use virsh net-update command (of course, there's only a limited set of parameters which can be set this way).

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