Bug 1332758

Summary: deleting one interface from macvtap network resets connection count for other interfaces
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED WONTFIX QA Contact: Yanqiu Zhang <yanqzhan>
Severity: medium Docs Contact: Jiri Herrmann <jherrman>
Priority: low    
Version: 8.0CC: berrange, dyuan, jherrman, jsuchane, laine, mkletzan, mzhan, xuzhang
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
.Deleting a forward interface from a macvtap virtual network resets all connection counts of this network Currently, deleting a forward interface from a `macvtap` virtual network with multiple forward interfaces also resets the connection status of the other forward interfaces of the network. As a consequence, the connection information in the live network XML is incorrect. Note, however, that this does not affect the functionality of the virtual network. To work around the issue, restart the `libvirtd` service on your host.
Story Points: ---
Clone Of:
: 1952786 (view as bug list) Environment:
Last Closed: 2021-06-21 07:30:37 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1952786    

Description yalzhang@redhat.com 2016-05-04 02:29:51 UTC
Description of problem:
Connections for other interfaces will be gone in net-dumpxml when live delete physical interface in macvtap network

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

How reproducible:
100%

Steps to Reproduce:
1. start a macvtap network.
# virsh net-dumpxml direct-macvtap
<network>
  <name>direct-macvtap</name>
  <uuid>5940b358-d234-47f8-82e8-85d520800fb5</uuid>
  <forward dev='ens1f0' mode='bridge'>
    <interface dev='ens1f0'/>
    <interface dev='ens1f1'/>
    <interface dev='enp1s0'/>
  </forward>
</network>

2. start a guest with 4 network interfaces with source network=direct-macvtap.
# virsh start t_R7.2
Domain t_R7.2 started

# virsh net-dumpxml direct-macvtap
<network connections='4'>
  <name>direct-macvtap</name>
  <uuid>5940b358-d234-47f8-82e8-85d520800fb5</uuid>
  <forward dev='ens1f0' mode='bridge'>
    <interface dev='ens1f0' connections='2'/>
    <interface dev='ens1f1' connections='1'/>
    <interface dev='enp1s0' connections='1'/>
  </forward>
</network>

3. delete a physical interface dev in the macvtap network with net-update.
# virsh net-update direct-macvtap delete forward-interface "<interface dev='enp1s0'/>"
Updated network direct-macvtap live state

4. all the connections of other interfaces are gone.
# virsh net-dumpxml direct-macvtap<network>
  <name>direct-macvtap</name>
  <uuid>5940b358-d234-47f8-82e8-85d520800fb5</uuid>
  <forward dev='ens1f0' mode='bridge'>
    <interface dev='ens1f0'/>
    <interface dev='ens1f1'/>
  </forward>
</network>

#ip link show | grep macvtap
87: macvtap0@ens1f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 500
88: macvtap1@ens1f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state LOWERLAYERDOWN mode DEFAULT qlen 500
89: macvtap2@enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 500
90: macvtap3@ens1f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 500


Actual results:
step 4, When delete a interface dev in macvtap network with "net-update", the network connections of all the other interfaces will be gone and total connections will change to none.

Expected results:
All the connections of other interfaces should not be impacted.

Additional info:
N/A

Comment 3 Laine Stump 2017-03-27 00:53:55 UTC
A workaround for this - just restart libvirtd. That will reset all the connection counts.

Comment 5 yalzhang@redhat.com 2017-05-21 03:39:35 UTC
Test on below packages, net-update will bring broken settings as this connection issue.

libvirt-3.2.0-5.el7.x86_64
qemu-kvm-rhev-2.9.0-5.el7.x86_64

1. Start a macvtap network with passthrough mode. And 1 guest with 2 interface connected to the network.

# virsh net-dumpxml direct-macvtap
<network connections='1'>
  <name>direct-macvtap</name>
  <uuid>07d91730-8a76-432a-a7f2-bd3e0b650c98</uuid>
  <forward dev='p1p1_0' mode='passthrough'>
    <interface dev='p1p1_0' connections='1'/>
  </forward>
</network>

2. Use net-update to add 1 more interface dev to the network, the connections will gone, but the guest network works well.

# virsh net-update direct-macvtap add-last forward-interface "<interface dev='p1p1_2'/>"
Updated network direct-macvtap live state

# virsh net-dumpxml direct-macvtap                                                      
<network>
  <name>direct-macvtap</name>
  <uuid>07d91730-8a76-432a-a7f2-bd3e0b650c98</uuid>
  <forward dev='p1p1_0' mode='passthrough'>
    <interface dev='p1p1_0'/>
    <interface dev='p1p1_2'/>
  </forward>
</network>

#  ip a show | grep macvtap
61: macvtap0@p1p1_0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 500

3. Add 1 more interface to guest connecting to the network, there will be broken settings.

# virsh attach-interface rhel7.2 network direct-macvtap
Interface attached successfully

# virsh net-dumpxml direct-macvtap
<network connections='1'>
  <name>direct-macvtap</name>
  <uuid>07d91730-8a76-432a-a7f2-bd3e0b650c98</uuid>
  <forward dev='p1p1_0' mode='passthrough'>
    <interface dev='p1p1_0' connections='1'/>
    <interface dev='p1p1_2'/>
  </forward>
</network>

# ip a show | grep macvtap                             
63: macvtap1@p1p1_0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 500

expect there will be "macvtap1@p1p1_2" and "macvtap0@p1p1_0", but the original macvtap0 is gone.

Comment 7 Martin Kletzander 2020-02-18 13:18:57 UTC
Possible duplicates:

 - https://bugzilla.redhat.com/show_bug.cgi?id=1751580

 - https://bugzilla.redhat.com/show_bug.cgi?id=1745815

 - https://bugzilla.redhat.com/show_bug.cgi?id=1711180

Laine/Daniel, please have a look if it should be closed as duplicated or it is not relevant.  Thanks

Comment 8 Daniel Berrangé 2020-02-25 15:59:00 UTC
(In reply to Martin Kletzander from comment #7)
> Possible duplicates:
> 
>  - https://bugzilla.redhat.com/show_bug.cgi?id=1751580
> 
>  - https://bugzilla.redhat.com/show_bug.cgi?id=1745815

These two bugs are fixing a problem only introduced in 5.3.0, so not the same as this bug.

> 
>  - https://bugzilla.redhat.com/show_bug.cgi?id=1711180

I don't think this is the same bug either.

> Laine/Daniel, please have a look if it should be closed as duplicated or it
> is not relevant.  Thanks

I think this is a bug we need to investigate for RHEL-7. Possibly its already fixed upstream, since libvirt-3.2.0-5.el7.x86_64 is quite old now.

Comment 9 yalzhang@redhat.com 2020-05-12 03:31:10 UTC
Tested on below packages, for scenario in comment 0, it is the same. And the workaround that restart libvirtd did recover the connection counts as comment 3 suggested;

For scenario in comment 5, the behavior changes, and I think it is expected currently.
Check the details below:

# rpm -q libvirt qemu-kvm-rhev kernel
libvirt-4.5.0-35.el7.x86_64
qemu-kvm-rhev-2.12.0-47.el7.x86_64
kernel-3.10.0-1127.8.2.el7.x86_64

1. start a guest connecting the direct-passthrough network:
# virsh start rhel
Domain rhel started

# virsh net-dumpxml direct-passthrough
<network connections='1'>
  <name>direct-passthrough</name>
  <uuid>5a9ec3b8-428a-49f2-90c7-7c415a27848b</uuid>
  <forward dev='p4p2_0' mode='passthrough'>
    <interface dev='p4p2_0' connections='1'/>
  </forward>
</network>

2. Add one more forward interface:
# virsh net-update direct-passthrough add-last forward-interface "<interface dev='p4p2_1'/>"
Updated network direct-passthrough live state

# virsh net-dumpxml direct-passthrough
<network>
  <name>direct-passthrough</name>
  <uuid>5a9ec3b8-428a-49f2-90c7-7c415a27848b</uuid>
  <forward dev='p4p2_0' mode='passthrough'>
    <interface dev='p4p2_0'/>
    <interface dev='p4p2_1'/>
  </forward>
</network>

# ip a show | grep macvtap
23: macvtap0@p4p2_0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 500

# virsh attach-interface rhel network direct-passthrough
error: Failed to attach interface
error: error creating macvtap interface macvtap1@p4p2_0 (52:54:00:4e:86:9a): Invalid argument

After the net-update, the connections cleared as in comment 0. But the original macvtap device will not be override during next attach.

Comment 12 RHEL Program Management 2020-12-15 07:41:21 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 16 RHEL Program Management 2021-06-21 07:30:37 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.