diff options
author | Han Zhou <hzhou8@ebay.com> | 2018-10-04 13:01:09 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-10-08 10:39:58 -0700 |
commit | 298115b94b881146fb82abc4e64d0e4f668d20e4 (patch) | |
tree | 9d983f5b6eb4b5747cc79654a99c4f5ee55dae88 /utilities | |
parent | ca545a787ac03fdfd36fd5bef4e6986624250cf3 (diff) | |
download | openvswitch-298115b94b881146fb82abc4e64d0e4f668d20e4.tar.gz |
ovs-ctl: Add new option to use short hostname.
Current ovs-ctl forces to set full hostname in external-ids. In
some situation users may want to set short hostname. For example,
in OpenStack - OVN integration, Neutron uses the host-id provided
by Nova, which is usually short hostname, to set "requested-chassis"
in OVN. The mismatch in hypervisor's external-ids:hostname setting
causes OVN port binding failure. It can be overridden to short name
but a openvswitch restart using ovs-ctl would again set it to full
hostname. This patch ensures in such use cases --no-full-hostname
can be specified to ovs-ctl to set short hostname instead.
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-ctl.in | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 749de999f..2d01c7553 100644 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -38,7 +38,11 @@ insert_mod_if_required () { 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)" + hn="$(hostname -f)" + if test X$FULL_HOSTNAME = Xno; then + hn="$(hostname)" + fi + ovs_vsctl set Open_vSwitch . external-ids:hostname="$hn" } set_system_ids () { @@ -289,6 +293,8 @@ enable_protocol () { set_defaults () { SYSTEM_ID= + FULL_HOSTNAME=yes + DELETE_BRIDGES=no DELETE_TRANSIENT_PORTS=no @@ -374,6 +380,7 @@ Less important options for "start", "restart" and "force-reload-kmod": --no-mlockall do not lock all of ovs-vswitchd into memory --ovsdb-server-priority=NICE set ovsdb-server's niceness (default: $OVSDB_SERVER_PRIORITY) --ovs-vswitchd-priority=NICE set ovs-vswitchd's niceness (default: $OVS_VSWITCHD_PRIORITY) + --no-full-hostname set short hostname instead of full hostname Debugging options for "start", "restart" and "force-reload-kmod": --ovsdb-server-wrapper=WRAPPER |