@@ -722,8 +722,13 @@ build_datapaths(struct northd_context *ctx, struct hmap *datapaths)
sprintf(uuid_s, UUID_FMT, UUID_ARGS(&od->key));
const char *key = od->nbs ? "logical-switch" : "logical-router";
- /* Get name to set in external-ids. */
+ /* Get names to set in external-ids. */
const char *name = od->nbs ? od->nbs->name : od->nbr->name;
+ const char *name2 = (od->nbs
+ ? smap_get(&od->nbs->external_ids,
+ "neutron:network_name")
+ : smap_get(&od->nbr->external_ids,
+ "neutron:router_name"));
/* Set external-ids. */
struct smap ids = SMAP_INITIALIZER(&ids);
@@ -731,6 +736,9 @@ build_datapaths(struct northd_context *ctx, struct hmap *datapaths)
if (*name) {
smap_add(&ids, "name", name);
}
+ if (name2 && name2[0]) {
+ smap_add(&ids, *name ? "name2" : "name", name2);
+ }
sbrec_datapath_binding_set_external_ids(od->sb, &ids);
smap_destroy(&ids);
@@ -1644,12 +1644,28 @@ tcp.flags = RST;
the <ref db="OVN_Northbound"/> database.
</column>
- <column name="external_ids" key="name">
- <code>ovn-northd</code> copies this from the <ref
- table="Logical_Router" db="OVN_Northbound"/> or <ref
- table="Logical_Switch" db="OVN_Northbound"/> table in the <ref
- db="OVN_Northbound"/> database, when that column is nonempty.
- </column>
+ <group title="Naming">
+ <p>
+ <code>ovn-northd</code> copies these from the name fields in the <ref
+ db="OVN_Northbound"/> database, either from <ref
+ table="Logical_Router" db="OVN_Northbound" column="name"/> and <ref
+ table="Logical_Router" db="OVN_Northbound" column="external_ids"
+ key="neutron:router_name"/> in the <ref table="Logical_Router"
+ db="OVN_Northbound"/> table or from <ref table="Logical_Switch"
+ db="OVN_Northbound" column="name"/> and <ref table="Logical_Switch"
+ db="OVN_Northbound" column="external_ids"
+ key="neutron:network_name"/> in the <ref table="Logical_Switch"
+ db="OVN_Northbound"/> table.
+ </p>
+
+ <column name="external_ids" key="name">
+ A name for the logical datapath.
+ </column>
+
+ <column name="external_ids" key="name2">
+ Another name for the logical datapath.
+ </column>
+ </group>
</group>
<group title="Common Columns">
It's much easier to see what's going on in the southbound database if human-friendly names are available. Really it's too bad that we didn't put the human-friendly name in "name" and the UUID in something like "external_ids:neutron-uuid", but it'll take more coordination to change that at this point and it may not be worth it. Signed-off-by: Ben Pfaff <blp@ovn.org> --- ovn/northd/ovn-northd.c | 10 +++++++++- ovn/ovn-sb.xml | 28 ++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-)