[ovs-discuss] Exporting and importing configurations

Gurucharan Shetty shettyg at nicira.com
Fri Apr 11 15:04:04 UTC 2014


On Fri, Apr 11, 2014 at 3:22 AM, Brian Candler <b.candler at pobox.com> wrote:
> I'd like to export the configuration from openvswitch and restore it on
> other systems to use it there. I have not yet found a documented way of
> doing that.
>
> I'm testing with Ubuntu 14.04 beta, which has openvswitch 2.0.1
>
> I did find this posting:
> http://openvswitch.org/pipermail/discuss/2013-February/009129.html
> which simply says "You can just copy the configuration file that
> ovsdb-server is using"
I think Justin meant the conf.db
>
> Now, it appears that the configuration database consists of two files:
>
> $ ls /etc/openvswitch/
> conf.db  system-id.conf

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. system-id
itself is not used by Open vSwitch to do anything important. It can be
used by controllers to distinguish between multiple machines.

conf.db is the database file.

I think, copying conf.db from one machine to another is probably okay.
But, if you have a common controller connected to both the machines,
it will probably get confused because the UUIDs will be same.

I don't know what your intentions are, but if it is a basic
configuration, you may want to look at
debian/openvswitch-switch.README.Debian in the git repo that explains
how to configure Open vSwitch with 'interfaces'. That way, you can
just copy the interfaces file to a different machine.


>
> system-id.conf is just a GUID, but I see the same value exists (twice) in
> conf.db as well:
>
> brian at trusty:~$ cat /etc/openvswitch/system-id.conf
> a70e2d4f-e3b4-486e-b31c-a2dad03082b9
> brian at trusty:~$ grep $(cat /etc/openvswitch/system-id.conf)
> /etc/openvswitch/conf.db
> {"_date":1397209375991,"Open_vSwitch":{"4a644e11-5a08-41c5-b3f3-405f5d2981ef":{"system_version":"14.04-trusty","ovs_version":"2.0.1","system_type":"Ubuntu","external_ids":["map",[["system-id","a70e2d4f-e3b4-486e-b31c-a2dad03082b9"]]]}},"_comment":"ovs-vsctl:
> ovs-vsctl --no-wait set Open_vSwitch . ovs-version=2.0.1
> \"external-ids:system-id=\\\"a70e2d4f-e3b4-486e-b31c-a2dad03082b9\\\"\"
> \"system-type=\\\"Ubuntu\\\"\" \"system-version=\\\"14.04-trusty\\\"\""}
>
> Hence it's not clear whether it's safe to replace just conf.db, or whether
> system-id.conf needs replacing too.
>
> Clearly if system-id.conf is copied from another machine I could end up with
> multiple machines each with the same system ID - presumably not a good idea
> if these were to be controlled from the same point, e.g. with OpenFlow.
>
> But if I leave system-id.conf alone and import only conf.db, this means that
> conf.db will reference some other system's ID in the
> Open_vSwitch.external_ids.map and _comment fields. Is that a problem?
>
> Also: after importing one or both files, presumably it's necessary to
> restart openvswitch?
>
> Thanks,
>
> Brian.
>
> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> http://openvswitch.org/mailman/listinfo/discuss



More information about the discuss mailing list