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.

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.

"ovsdb-client dump" showed only the original UUID, not the one changed to aaaaaaaa.

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.
My intention is to develop an openvswitch configuration and then push it out to a large number of hosts so that they are all configured in the same way. If the template config changes, I want to be able to re-apply it to all hosts.

A specific example would be a computer lab, where I want to set up a bunch of machines identically, and each student is running a network simulation.

Looking at config management tools, I see that Ansible has a couple of modules for very basic configuration of bridges and port membership:
http://docs.ansible.com/openvswitch_bridge_module.html
http://docs.ansible.com/openvswitch_port_module.html
But it's very limited (e.g. I can't configure port X to be an access vlan on vlan N, or to be a trunk for VLANs A, B and C)

So I was hoping to handle this in the way I would manage "real" switches: just export the config file from the dev switch, and import it into all the other switches. I would have thought that was a very basic configuration management task, so I was surprised not to find it documented.

Anyway, it now looks like the answer is to push out conf.db, and when openvswitch restarts it will automatically overwrite the system ID in conf.db with the one from system-id.conf. That will do nicely.

Regards,

Brian.

_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to