Hello, so I want to be able to use the ovsdb-client to directly modify the
contents of the table, to add a bridge for example.
To see what this should look like in json, I run:
sudo ovs-vsctl --verbose add-br br0
and get
2013-02-15T22:00:23Z|00008|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock:
send request, method="monitor",
params=["Open_vSwitch",null,{"Port":{"columns":["fake_bridge","interfaces","name","tag"]},"Controller":{"columns":[]},"Interface":{"columns":["name"]},"Open_vSwitch":{"columns":["bridges","cur_cfg"]},"Bridge":{"columns":["controller","fail_mode","name","ports"]}}],
id=0
2013-02-15T22:00:23Z|00009|poll_loop|DBG|wakeup due to [POLLIN] on fd 4
(<->/usr/local/var/run/openvswitch/db.sock) at lib/stream-fd.c:143
2013-02-15T22:00:23Z|00010|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock:
received reply,
result={"Open_vSwitch":{"fcafa6a0-115a-4b85-8284-462115b1f812":{"new":{"cur_cfg":6,"bridges":["set",[]]}}}},
id=0
*2013-02-15T22:00:23Z|00011|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock:
send request, method="transact",
params=["Open_vSwitch",{"rows":[{"bridges":["set",[]]}],"until":"==","where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"timeout":0,"op":"wait","table":"Open_vSwitch","columns":["bridges"]},{"where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"op":"update","table":"Open_vSwitch","row":{"bridges":["named-uuid","row0d31a353_d899_4bb3_aac9_1046721aaec8"]}},{"uuid-name":"rowd4da1634_5114_489a_9a87_79d1f401fc16","op":"insert","table":"Interface","row":{"name":"br0","type":"internal"}},{"uuid-name":"row0d31a353_d899_4bb3_aac9_1046721aaec8","op":"insert","table":"Bridge","row":{"name":"br0","ports":["named-uuid","row819c9a13_1d42_466b_94c6_ec2fdc8162e6"]}},{"uuid-name":"row819c9a13_1d42_466b_94c6_ec2fdc8162e6","op":"insert","table":"Port","row":{"interfaces":["named-uuid","rowd4da1634_5114_489a_9a87_79d1f401fc16"],"name":"br0"}},{"mutations":[["next_cfg","+=",1]],"where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"op":"mutate","table":"Open_vSwitch"},{"where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"op":"select","table":"Open_vSwitch","columns":["next_cfg"]},{"comment":"ovs-vsctl:
ovs-vsctl --verbose add-br br0","op":"comment"}], id=1*
2013-02-15T22:00:23Z|00012|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock:
received notification, method="update",
params=[null,{"Port":{"db4b3d80-21c7-4051-a34d-6c43cbaf1973":{"new":{"interfaces":["uuid","0b9fbda3-7772-41c6-84aa-520856d638a2"],"name":"br0","fake_bridge":false,"tag":["set",[]]}}},"Interface":{"0b9fbda3-7772-41c6-84aa-520856d638a2":{"new":{"name":"br0"}}},"Open_vSwitch":{"fcafa6a0-115a-4b85-8284-462115b1f812":{"old":{"bridges":["set",[]]},"new":{"cur_cfg":6,"bridges":["uuid","63079abc-22be-4dac-b6f7-86ba92580a59"]}}},"Bridge":{"63079abc-22be-4dac-b6f7-86ba92580a59":{"new":{"name":"br0","ports":["uuid","db4b3d80-21c7-4051-a34d-6c43cbaf1973"],"fail_mode":["set",[]],"controller":["set",[]]}}}}]
2013-02-15T22:00:23Z|00013|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock:
received reply,
result=[{},{"count":1},{"uuid":["uuid","0b9fbda3-7772-41c6-84aa-520856d638a2"]},{"uuid":["uuid","63079abc-22be-4dac-b6f7-86ba92580a59"]},{"uuid":["uuid","db4b3d80-21c7-4051-a34d-6c43cbaf1973"]},{"count":1},{"rows":[{"next_cfg":7}]},{}],
id=1
2013-02-15T22:00:23Z|00014|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock:
received notification, method="update",
params=[null,{"Open_vSwitch":{"fcafa6a0-115a-4b85-8284-462115b1f812":{"old":{"cur_cfg":6},"new":{"cur_cfg":7,"bridges":["uuid","63079abc-22be-4dac-b6f7-86ba92580a59"]}}}}]
You can see the transact request that is sent. When I try to run:
sudo ovsdb-client transact
["Open_vSwitch",{"rows":[{"bridges":["set",[]]}],"until":"==","where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"timeout":0,"op":"wait","table":"Open_vSwitch","columns":["bridges"]},{"where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"op":"update","table":"Open_vSwitch","row":{"bridges":["named-uuid","row0d31a353_d899_4bb3_aac9_1046721aaec8"]}},{"uuid-name":"rowd4da1634_5114_489a_9a87_79d1f401fc16","op":"insert","table":"Interface","row":{"name":"br0","type":"internal"}},{"uuid-name":"row0d31a353_d899_4bb3_aac9_1046721aaec8","op":"insert","table":"Bridge","row":{"name":"br0","ports":["named-uuid","row819c9a13_1d42_466b_94c6_ec2fdc8162e6"]}},{"uuid-name":"row819c9a13_1d42_466b_94c6_ec2fdc8162e6","op":"insert","table":"Port","row":{"interfaces":["named-uuid","rowd4da1634_5114_489a_9a87_79d1f401fc16"],"name":"br0"}},{"mutations":[["next_cfg","+=",1]],"where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"op":"mutate","table":"Open_vSwitch"},{"where":[["_uuid","==",["uuid","fcafa6a0-115a-4b85-8284-462115b1f812"]]],"op":"select","table":"Open_vSwitch","columns":["next_cfg"]},{"comment":"ovs-vsctl:
ovs-vsctl --verbose add-br br0","op":"comment"}]
It just hangs. Would I need to generate my own uuid somehow? Also, do i
need to append ',id=some_number' to the end of the command?Any help is greatly appreciated!
_______________________________________________ discuss mailing list [email protected] http://openvswitch.org/mailman/listinfo/discuss
