Bug 1009586

Summary: libvirtd created openvswitch ports (vnetX) may not be removed on graceful or improper shutdown
Product: [Community] Virtualization Tools Reporter: Peter Kieser <peter>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-26 22:18:00 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:

Description Peter Kieser 2013-09-18 16:22:29 UTC
Description of problem:
libvirt integration with openvswitch will issue an add-port request with an incremented vnet interface numbering. If the host system is incorrectly shutdown, or openvswitch-switch is shut down before libvirtd (for example, if the distribution does not specify openvswitch-switch as a startup/shutdown dependency for libvirtd - none currently do) then the vnet port will not be removed and on startup of the host system or domain the vnet port will be arbitrarily assigned.

Version-Release number of selected component (if applicable):

How reproducible:
Most of the time

Steps to Reproduce:
1. Have libvirtd, libvirt-guests and openvswitch-switch enabled on system startup.
2. Create two or more domains with openvswitch interfaces defined to two different VLANs or openvswitch bridges
3. Startup the domains you have created with openvswitch interfaces
4. Restart the system gracefully or improperly

Actual results:
The vnet interfaces will not be removed from the openvswitch bridge on shutdown by libvirtd, if openvswitch-switch is shutdown before libvirtd (usually the default on distributions) or if the system is shutdown incorrectly. openvswitch keeps a persistent configuration of added ports. You can observe this behaviour by observing (after a restart):

# ovs-vsctl show 

You will see the vnet interfaces are defined, even with no domains started. If you start the domains, the vnet ports will not be removed and will be assigned randomly based on startup order.

Expected results:
* When libvirt starts a domain, with openvswitch interfaces the vnet interfaces should first be removed and then added to prevent this issue from occurring (especially on incorrect system shutdown.)
* libvirtd should require openvswitch-switch as a startup dependency at the distribution level.

Additional info:

Comment 1 Steve Jobs 2013-09-18 16:38:56 UTC
Who does this Peter guy think he is?

Comment 2 Peter Kieser 2014-04-25 16:50:11 UTC
This issue is still present in 1.2.2.