[ovs-dev] [PATCH 1/2] ovs-ctl: Store hostname as an external-id.

Russell Bryant russell at ovn.org
Fri Mar 25 00:40:49 UTC 2016


Update ovs-ctl to store the system hostname as an external-id, similar
to the system-id.  This is largely for convenience.  ovn-controller
will make use of it in a future commit.  Someone in the OpenDaylight
community requested the same thing in a discussion earlier this week.

While we're at it, set external-ids:hostname in ovs-sandbox as well.

Suggested-by: Justin Pettit <jpettit at ovn.org>
Suggested-at: http://openvswitch.org/pipermail/dev/2016-March/068225.html
Signed-off-by: Russell Bryant <russell at ovn.org>
---
 tutorial/ovs-sandbox | 1 +
 utilities/ovs-ctl.in | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox
index f331a00..412c982 100755
--- a/tutorial/ovs-sandbox
+++ b/tutorial/ovs-sandbox
@@ -356,6 +356,7 @@ rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile
 
 if $ovn; then
     ovs-vsctl set open . external-ids:system-id=56b18105-5706-46ef-80c4-ff20979ab068
+    ovs-vsctl set open . external-ids:hostname=sandbox
     ovs-vsctl set open . external-ids:ovn-remote=unix:"$sandbox"/ovnsb_db.sock
     ovs-vsctl set open . external-ids:ovn-encap-type=geneve
     ovs-vsctl set open . external-ids:ovn-encap-ip=127.0.0.1
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 7354a47..d2872ef 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -108,6 +108,8 @@ set_system_ids () {
     esac
     set "$@" external-ids:system-id="\"$SYSTEM_ID\""
 
+    set "$@" external-ids:hostname="\"$(hostname)\""
+
     if test X"$SYSTEM_TYPE" != X; then
         set "$@" system-type="\"$SYSTEM_TYPE\""
     else
-- 
2.5.5




More information about the dev mailing list