[ovs-discuss] Exporting and importing configurations

Ben Pfaff blp at nicira.com
Fri Apr 11 18:12:53 UTC 2014


On Fri, Apr 11, 2014 at 05:10:08PM +0100, Brian Candler wrote:
> On 11/04/2014 16:04, Gurucharan Shetty wrote:
> >system-id.conf is created by the Open vSwitch startup script to store
> >a UUID generated through uuidgen. During the next startups, since
> >system-id.conf exists, the value inside it is used to fill
> >external-ids:system-id column.
> >
> >You can read about it in 'man ovs-ctl' and IntegrationGuide.
> This is hard to find in Ubuntu 14.04. Eventually I found the script
> itself at
> /usr/share/openvswitch/scripts/ovs-ctl
> but the manpage is not in the package, so I got it from the git repo
> in the "utilities" subdirectory.

It hadn't occurred to me that it would be useful to install the
ovs-ctl manpage, because it is not usually interesting to end users,
but I guess that since you're looking at it, it might be.  I'll send a
patch to start installing it.

> According to the manpage it looks like using ovs-ctl does have the
> ability to overwrite the UUID in the database with the UUID from the
> file where the random UUID was stored. And digging further,
> /etc/init.d/openvswitch-switch calls ovs_ctl() defined in
> /usr/share/openvswitch/scripts/ovs-lib, which does call ovs-ctl.
> 
> So I did some experiments. I modified the UUID in
> /etc/openvswitch/conf.db. When I realised that it was preceded by a
> header with sha1 hash, I was able to change it
> 
> sed -i'' s/a70e2d4f/aaaaaaaa/g conf.db   # a70e2d4f are the first 8
> characters of the ID in system-id.conf
> 
> recalculate the hash, and reboot.  At startup the conf.db got its
> UUID reset to the one in system-id.conf (actually it appened a new
> block of JSON to the conf.db) and the config was reloaded
> successfully.

The database isn't really meant to be edited by hand.  (The right way
to change the database is to use ovs-vsctl.)



More information about the discuss mailing list