On Mon, Sep 15, 2014 at 11:47 AM, Pedersen, Sean <[email protected]> wrote:
> Upon shutdown (incorrect or otherwise), the persistent OVS database tends to
> cause issues with libvirt. If libvirt is shut down after OVS, and/or the
> host is shut down incorrectly, "stale" vnet interfaces will remain in the
> OVS database. If you try to restart an instance out of order (i.e. the
> instance that owned vnetX the last time the host was up), you run into
> "Operation not permitted" errors at the shell and something like this in
> /var/log/libvirt/libvirtd.log:
>
>
>
> 2014-09-15 18:12:37.494+0000: 4926: error : virCommandWait:2348 : internal
> error: Child process (ovs-vsctl --timeout=5 -- --may-exist add-port api
> vnet29 -- set Interface vnet29
> 'external-ids:attached-mac="52:54:00:bd:61:13"' -- set Interface vnet29
> 'external-ids:iface-id="35a16504-5ab0-4652-80c8-e5cac36c8c03"' -- set
> Interface vnet29 'external-ids:vm-id="96f13fa5-3d72-43b5-bb98-182c808d5570"'
> -- set Interface vnet29 external-ids:iface-status=active) unexpected exit
> status 1: ovs-vsctl: "--may-exist add-port api vnet29" but vnet29 is
> actually attached to bridge dmz
>
>
>
> If you look at OVS, the vnet(s) are still present. If you look at the host's
> interface list, the vnet(s) in question above a certain number do not exist.
> In my most recent example, it was vnet29 through vnet52. One workaround is
> to delete all of the "stale" interfaces in OVS. I also found this
> workaround:
> https://peterkieser.com/2014/06/22/openvswitch-and-libvirt-vnet-port-russian-roulette-on-restart-solution/
> as well as a bug filed with RedHat:
> https://bugzilla.redhat.com/show_bug.cgi?id=1009586
>
>
>
> This seems to be a known issue; is there an "official" workaround, best
> practice, or a permanent fix available?

I do not have a correct answer to your question and I am not a regular
user of libvirt to understand all the possibilities. Reading through
your mail, I think, if you do the following steps, you can solve your
problem.

* Assuming you are using a RHEL based distribution, you should read
/usr/share/doc/openvswitch-%{version}/README.RHEL that explains how to
configure OVS using ifcfg-* scripts. If you configure your bridges
using ifcfg-*, they will be deleted and recreated during a normal
restart process. This way, the stale interfaces will disappear
(debian/ubuntu has similar integration with 'interfaces', but it was
not fully integrated with OVS 1.10)

*  Change your startup scripts for OVS and libvirt to make them
dependent on each other in a way that OVS starts before libvirt and
stops after it.

* For the cases of abnormal shutdown, I think you do not have a choice
other than deleting all vnet* interfaces through a startup hook as of
now.
I guess, unless libvirt keeps track of its old interfaces, it would be
hard for it to delete its stale interfaces. One way to correctly fix
this would be for OVS bridges configured through ifcfg-*  or
'interfaces' to be deleted and recreated during startup (this will
need code change in OVS repo).



>
>
>
> This example is on OVS 1.10.2 / libvirt 1.1.1.
>
>
>
> --
>
>
>
> Sean
>
>
>
>
>
> Founded in 2007, IO is a worldwide leader in software defined data center
> technology, services and solutions that enable businesses and governments to
> intelligently control their information.
>
> The communication contained in this e-mail is confidential and is intended
> only for the named recipient(s) and may contain information that is
> privileged, proprietary, attorney work product or exempt from disclosure
> under applicable law. If you have received this message in error, or are not
> the named recipient(s), please note that any form of distribution, copying
> or use of this communication or the information in it is strictly prohibited
> and may be unlawful. Please immediately notify the sender of the error, and
> delete this communication including any attached files from your system.
> Thank you for your cooperation.
>
> _______________________________________________
> discuss mailing list
> [email protected]
> http://openvswitch.org/mailman/listinfo/discuss
>
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to