[ovs-discuss] ovsdb jsonrpc: referential integrity

Boris Tobotras tobotras at parallels.com
Wed Mar 27 07:25:14 UTC 2013


Hi Ben,

On 03/26/2013 08:45 PM, Ben Pfaff wrote:

> You can't use hard-coded uuids to refer to new rows, because you
> cannot know what the uuid of a new row is.  Use a named-uuid.

Looks like I'm almost there:

me>ovsdb: 
{"method":"transact","params":["Open_vSwitch",{"uuid-name":"paci1faced","op":"insert","row":{"name":"paci1face","type":"internal"},"table":"Interface"},{"uuid-name":"paci1portd","op":"insert","row":{"name":"paci1port","interfaces":["named-uuid","paci1faced"]},"table":"Port"},{"op":"insert","row":{"ports":["named-uuid","paci1portd"],"name":"paci1br"},"table":"Bridge"},{"op":"mutate","table":"Open_vSwitch","where":[],"mutations":[["next_cfg","+=",1]]},{"op":"commit","durable":true}],"id":4}

me<ovsdb: {:id 4, :error nil, :result [{:uuid ["uuid" 
"de96acc5-1984-4ff2-8e57-9b907cde2518"]} {:uuid ["uuid" 
"129ac068-24e3-418c-a7c9-7216c556762c"]} {:uuid ["uuid" 
"622a6216-7bd2-40ed-b530-7c2cfa980f7a"]} {:count 1} {}]}

But neither Interface, nor Port or Bridge table lists my new 
interface/port/bridge:

me>ovsdb: 
{"method":"transact","params":["Open_vSwitch",{"op":"select","where":[],"table":"Bridge"}],"id":5}

ovsdb>me: {:id 5, :error nil, :result [{:rows [{:status ["map" []], 
:datapath_type "", :mirrors ["set" []], :stp_enable false, :external_ids 
["map" []], :ports ["set" [["uuid" 
"334fd388-e308-488c-93a5-6a3bfc37e858"] ["uuid" 
"9bc142d9-bba8-4be2-b840-322e5de10ca9"] ["uuid" 
"cc4a65fe-b76c-472e-9288-c56d3fd55ce0"]]], :datapath_id 
"00000015587158a4", :name "bridge1", :flood_vlans ["set" []], 
:other_config ["map" []], :controller ["set" []], :netflow ["set" []], 
:sflow ["set" []], :_uuid ["uuid" 
"db55f02c-2d44-4356-a551-e70b9d63c11d"], :_version ["uuid" 
"d69f6391-ca36-418e-8f96-532702664634"], :fail_mode ["set" []]}]}]}

I'm event incrementing next_cfg in Open_vSwitch...
-- 
         Best regards, -- Boris.

Computer Science is the only discipline in which we view adding a new 
wing to a building as being maintenance. -- Jim Horning



More information about the discuss mailing list