[ovs-dev] [ovs-git] Open vSwitch: xenserver: Make RPM install work again. (master)

Ian Campbell Ian.Campbell at eu.citrix.com
Tue Sep 15 09:11:30 UTC 2009

On Mon, 2009-09-14 at 20:36 +0100, Ben Pfaff wrote:
> Ben Pfaff <blp at nicira.com> writes:
> > Ian Campbell <Ian.Campbell at citrix.com> writes:
> >
> >> On Fri, 2009-09-11 at 22:49 +0100, dev at openvswitch.org wrote:
> >>> commit ac9634f0af8d2cf8259a3cf7d7d6e19cc0d67457
> >>> Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ac9634f0af8d2cf8259a3cf7d7d6e19cc0d67457
> >>> Author: Ben Pfaff <blp at nicira.com>
> >>>                 
> >>> xenserver: Make RPM install work again.
> >>>                 
> >>> The RPM install was generating a database cache in Python pickle format in
> >>> /etc/ovs-vswitchd.conf, but interface-reconfigure was looking for it in
> >>> XML format in /var/lib/openvswitch/dbcache.  This fixes the problem, by
> >>> adding an init-dbcache command to interface-reconfigure and then using that
> >>> at RPM install time.
> >>> 
> >>> This moves the database cache creation from %pre to %post.  This is
> >>> necessary so that interface-reconfigure is available from the install
> >>> script.
> >>
> >> FWIW the "rewrite-configuration" action for the management PIF should
> >> have been sufficient for this.  [...]
> >
> > Oh, definitely.  It just wasn't obvious to me how to find a PIF
> > name from an installation script.  Now that I look again, I could
> > do it easily by sourcing /etc/xensource-inventory.  I'll make a
> > note to change the way I do this.
> So I took a closer look and that isn't good enough.  "rewrite"
> requires either a session and a PIF or a PIF UUID.  %post doesn't
> have a session, and I don't see a way to easily get a PIF UUID.

You can get $INSTALLATION_UUID from xensource-inventory and then
        xe pif-list host-uuid="${INSTALLATION_UUID}" management=true --minimal
gets you the management PIF UUID for this host.

> "--force rewrite" does take a bridge name but it wants to
> reconfigure that bridge, which %post doesn't want to do.
> Can you suggest a way to do this then?

If this was just for trunk I would suggest making rewrite not need a PIF
at all, since it doesn't really have meaning with the all-in-one
dbcache. However for the version which is used in your add-on it needs
to fit in with the existing usage in George (e.g. the
mangagement-interface initscript).

How about making passing a PIF optional when using rewrite? So rewrite
would unconditionally write dbcache but would rewrite the ifcfg files
only if a PIF was supplied. This would allow us to start transitioning
away from passing a PIF in trunk and still works for supporting rpm -e
of your add-on.


More information about the dev mailing list