Skip to content

Commit

Permalink
ovs-ctl.in: Call 'hostname -f' after vswitchd starts.
Browse files Browse the repository at this point in the history
Currently we call 'hostname -f' when ovs-vswitchd is not
running. If you are using ovs-vswitchd to provide your
primary networking, then 'hostname -f' will "hang" till it
times out. On the system this issue was discovered, this was
as long as 40 seconds. This is a problem during OVS restarts
or upgrades.

This commit calls 'hostname -f' after ovs-vswitchd has started.

VMware-BZ: #1972026
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
shettyg committed Oct 6, 2017
1 parent f9471e7 commit 0a286da
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions utilities/ovs-ctl.in
Expand Up @@ -75,6 +75,12 @@ ovs_vsctl () {
ovs-vsctl --no-wait "$@"
}

set_hostname () {
# 'hostname -f' needs network connectivity to work. So we should
# call this only after ovs-vswitchd is running.
ovs_vsctl set Open_vSwitch . external-ids:hostname="$(hostname -f)"
}

set_system_ids () {
set ovs_vsctl set Open_vSwitch .

Expand Down Expand Up @@ -108,8 +114,6 @@ set_system_ids () {
esac
set "$@" external-ids:system-id="\"$SYSTEM_ID\""

set "$@" external-ids:hostname="\"$(hostname -f)\""

if test X"$SYSTEM_TYPE" != X; then
set "$@" system-type="\"$SYSTEM_TYPE\""
else
Expand Down Expand Up @@ -246,6 +250,7 @@ start_forwarding () {
if test X"$OVS_VSWITCHD" = Xyes; then
do_start_forwarding
fi
set_hostname &
}

## ---- ##
Expand Down

0 comments on commit 0a286da

Please sign in to comment.