The ovn-sim files were not updated for a very long time apart from treewide adjustments. We also have a sandbox support for running OVN testing environment which is very similar. Let's remove the ovn-sim utility files.
Signed-off-by: Ales Musil <[email protected]> --- Documentation/automake.mk | 7 +- Documentation/conf.py | 2 - .../contributing/documentation-style.rst | 4 +- Documentation/ref/index.rst | 1 - Documentation/ref/ovn-sim.1.rst | 126 ------- NEWS | 1 + utilities/.gitignore | 1 - utilities/automake.mk | 6 +- utilities/ovn-sim.in | 309 ------------------ 9 files changed, 5 insertions(+), 452 deletions(-) delete mode 100644 Documentation/ref/ovn-sim.1.rst delete mode 100755 utilities/ovn-sim.in diff --git a/Documentation/automake.mk b/Documentation/automake.mk index 685ba9588..b8187607e 100644 --- a/Documentation/automake.mk +++ b/Documentation/automake.mk @@ -68,7 +68,7 @@ DOC_SOURCE = \ Documentation/internals/contributing/documentation-style.rst \ Documentation/internals/contributing/submitting-patches.rst \ Documentation/requirements.txt \ - $(addprefix Documentation/ref/,$(RST_MANPAGES) $(RST_MANPAGES_NOINST)) + $(addprefix Documentation/ref/,$(RST_MANPAGES)) FLAKE8_PYFILES += Documentation/conf.py EXTRA_DIST += $(DOC_SOURCE) @@ -113,11 +113,6 @@ endif # rST formatted manpages under Documentation/ref. RST_MANPAGES = ovn-logical-flows.7.rst -# rST formatted manpages that we don't want to install because they -# document stuff that only works with a build tree, not with an -# installed OVS. -RST_MANPAGES_NOINST = ovn-sim.1.rst - # The GNU standards say that these variables should control # installation directories for manpages in each section. Automake # will define them for us only if it sees that a manpage in the diff --git a/Documentation/conf.py b/Documentation/conf.py index afbf9859b..e6159851c 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -108,8 +108,6 @@ html_static_path = ['_static'] _man_pages = [ ('ovn-logical-flows.7', u'OVN logical flow table reference'), - ('ovn-sim.1', - u'Open Virtual Network simulator environment'), ] # Generate list of (path, name, description, [author, ...], section) diff --git a/Documentation/internals/contributing/documentation-style.rst b/Documentation/internals/contributing/documentation-style.rst index ab34741ef..e8d35d999 100644 --- a/Documentation/internals/contributing/documentation-style.rst +++ b/Documentation/internals/contributing/documentation-style.rst @@ -341,8 +341,8 @@ In addition to the above, man pages have some specific requirements: - The man page must be included in the list of man page documents found in `conf.py`__ -Refer to existing man pages, such as :doc:`/ref/ovn-sim.1` for a worked -example. +Refer to existing man pages, such as :doc:`/ref/ovn-logical-flows.7` for a +worked example. __ http://www.sphinx-doc.org/en/stable/domains.html#directive-program __ http://www.sphinx-doc.org/en/stable/domains.html#directive-option diff --git a/Documentation/ref/index.rst b/Documentation/ref/index.rst index 06e32c1fa..3c4861b7b 100644 --- a/Documentation/ref/index.rst +++ b/Documentation/ref/index.rst @@ -40,7 +40,6 @@ time: :maxdepth: 3 ovn-logical-flows.7 - ovn-sim.1 The remainder are still in roff format can be found below: diff --git a/Documentation/ref/ovn-sim.1.rst b/Documentation/ref/ovn-sim.1.rst deleted file mode 100644 index 35abd39b1..000000000 --- a/Documentation/ref/ovn-sim.1.rst +++ /dev/null @@ -1,126 +0,0 @@ -======= -ovn-sim -======= - -Synopsis -======== - -``ovn-sim`` [*option*]... [*script*]... - -Description -=========== - -``ovn-sim`` is a wrapper script that adds ovn related commands on -top of ``ovs-sim``. - -``ovs-sim`` provides a convenient environment for running one or more Open -vSwitch instances and related software in a sandboxed simulation environment. - -To use ``ovn-sim``, first build Open vSwitch, then invoke it directly from the -build directory, e.g.:: - - git clone https://github.com/openvswitch/ovs.git - cd ovs - ./boot.sh && ./configure && make - cd .. - git clone https://github.com/ovn-org/ovn.git - cd ovn - ./boot.sh && ./configure --with-ovs-source=${PWD}/../ovs - make - utilities/ovn-sim - -See documentation on ``ovs-sim`` for info on simulator, including the -parameters you can use. - -OVN Commands ------------- - -These commands interact with OVN, the Open Virtual Network. - -``ovn_start`` [*options*] - Creates and initializes the central OVN databases (both - ``ovn-sb(5)`` and ``ovn-nb(5)``) and starts an instance of - ``ovsdb-server`` for each one. Also starts an instance of - ``ovn-northd``. - - The following options are available: - - ``--nbdb-model`` *model* - Uses the given database model for the northbound database. - The *model* may be ``standalone`` (the default), ``backup``, - or ``clustered``. - - ``--nbdb-servers`` *n* - For a clustered northbound database, the number of servers in - the cluster. The default is 3. - - ``--sbdb-model`` *model* - Uses the given database model for the southbound database. - The *model* may be ``standalone`` (the default), ``backup``, - or ``clustered``. - - ``--sbdb-servers`` *n* - For a clustered southbound database, the number of servers in - the cluster. The default is 3. - -``ovn_attach`` *network* *bridge* *ip* [*masklen*] - First, this command attaches bridge to interconnection network - network, just like ``net_attach`` *network* *bridge*. Second, it - configures (simulated) IP address *ip* (with network mask length - *masklen*, which defaults to 24) on *bridge*. Finally, it - configures the Open vSwitch database to work with OVN and starts - ``ovn-controller``. - -Examples -======== - -Simulating hypervisors, starting ovn controller (via ovn_attach) and -adding a logical port on each one of them:: - - ovn_start - ovn-nbctl ls-add lsw0 - net_add n1 - for i in 0 1; do - sim_add hv$i - as hv$i - ovs-vsctl add-br br-phys - ovn_attach n1 br-phys 192.168.0.`expr $i + 1` - ovs-vsctl add-port br-int vif$i -- \ - set Interface vif$i external-ids:iface-id=lp$i - ovn-nbctl lsp-add lsw0 lp$i - ovn-nbctl lsp-set-addresses lp$i f0:00:00:00:00:0$i - done - -Here’s a primitive OVN "scale test" (adjust the scale by changing -``n`` in the first line):: - - n=200; export n - ovn_start --sbdb-model=clustered - net_add n1 - ovn-nbctl ls-add br0 - for i in `seq $n`; do - (sim_add hv$i - as hv$i - ovs-vsctl add-br br-phys - y=$(expr $i / 256) - x=$(expr $i % 256) - ovn_attach n1 br-phys 192.168.$y.$x - ovs-vsctl add-port br-int vif$i -- \ - set Interface vif$i external-ids:iface-id=lp$i) & - case $i in - *50|*00) echo $i; wait ;; - esac - done - wait - for i in `seq $n`; do - yy=$(printf %02x $(expr $i / 256)) - xx=$(printf %02x $(expr $i % 256)) - ovn-nbctl lsp-add br0 lp$i - ovn-nbctl lsp-set-addresses lp$i f0:00:00:00:$yy:$xx - done - -When the scale test has finished initializing, you can watch the -logical ports come up with a command like this:: - - watch 'for i in `seq $n`; do \ - if test `ovn-nbctl lsp-get-up lp$i` != up; then echo $i; fi; done' diff --git a/NEWS b/NEWS index da9a077c1..3b41042b6 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Post v26.09.0 same priority as dynamic entries, making the preference option obsolete. - Removed OVN's ovs-bugtool plugin and helper scripts. + - Removed ovn-sim utility scripts. OVN v26.09.0 - xxx xx xxxx -------------------------- diff --git a/utilities/.gitignore b/utilities/.gitignore index 0ebeb2726..eb98594b7 100644 --- a/utilities/.gitignore +++ b/utilities/.gitignore @@ -19,4 +19,3 @@ /ovn-docker-overlay-driver /ovn-docker-underlay-driver /ovn-lib -/ovn-sim diff --git a/utilities/automake.mk b/utilities/automake.mk index af032d024..7d3f320dc 100644 --- a/utilities/automake.mk +++ b/utilities/automake.mk @@ -60,11 +60,7 @@ CLEANFILES += \ utilities/ovn-detrace \ utilities/ovn_detrace.py \ utilities/ovn-appctl.8 \ - utilities/ovn-appctl \ - utilities/ovn-sim - -EXTRA_DIST += utilities/ovn-sim.in -noinst_SCRIPTS += utilities/ovn-sim + utilities/ovn-appctl utilities/ovn-lib: $(top_builddir)/config.status diff --git a/utilities/ovn-sim.in b/utilities/ovn-sim.in deleted file mode 100755 index 96cee608c..000000000 --- a/utilities/ovn-sim.in +++ /dev/null @@ -1,309 +0,0 @@ -#! /usr/bin/env bash -# -# Copyright (c) 2019 Nicira, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -ovn_sim_builddir='@abs_builddir@'; export ovn_sim_builddir -ovn_sim_srcdir='@abs_top_srcdir@'; export ovn_sim_srcdir -ovs_sim_builddir='@OVSBUILDDIR@' - -# Check that we've got proper builddir and srcdir. -if test ! -e "$ovs_sim_builddir"/utilities/ovs-sim; then - echo "$ovs_sim_builddir/utilities/ovs-sim does not exist ($0 requires ovs-sim)" >&2 - exit 1 -fi -if test ! -e "$ovn_sim_builddir"/northd/ovn-northd; then - echo "$ovn_sim_builddir/northd/ovn-northd does not exist (need to run \"make\"?)" >&2 - exit 1 -fi -if test ! -e "$ovn_sim_srcdir"/README.rst; then - echo "$ovn_sim_srcdir/README.rst does not exist" >&2 - exit 1 -fi - -# Put built tools early in $PATH. -PATH=$ovn_sim_builddir/controller:$ovn_sim_builddir/northd:$ovn_sim_builddir/utilities:$PATH -export PATH - -ovn-nbctl () { command ovn-nbctl -vsyslog:off "$@"; }; export -f ovn-nbctl -ovn-sbctl () { command ovn-sbctl -vsyslog:off "$@"; }; export -f ovn-sbctl - -ovn_start_db() { - local db=$1 model=$2 servers=$3 schema=$4 - local DB=$(echo $db | tr a-z A-Z) - local schema_name=$(ovsdb-tool schema-name $schema) - - case $model in - standalone | backup) ;; - clustered) - case $servers in - [1-9] | [1-9][0-9]) ;; - *) echo "${db}db servers must be between 1 and 99" >&2 - exit 1 - ;; - esac - ;; - *) - echo "unknown ${db}db model \"$model\"" >&2 - exit 1 - ;; - esac - - ovn_start_ovsdb_server() { - local i=$1; shift - as ${db}$i ovsdb-server --detach --no-chdir --pidfile=$db.pid \ - -vsyslog:off -vconsole:off --log-file="$sim_base"/$db$i/$db.log \ - --remote=db:$schema_name,${DB}_Global,connections \ - --private-key=db:$schema_name,SSL,private_key \ - --certificate=db:$schema_name,SSL,certificate \ - --ca-cert=db:$schema_name,SSL,ca_cert \ - --ssl-protocols=db:$schema_name,SSL,ssl_protocols \ - --ssl-ciphers=db:$schema_name,SSL,ssl_ciphers \ - --ssl-ciphersuites=db:$schema_name,SSL,ssl_ciphersuites \ - --unixctl=${db} --remote=punix:$db.ovsdb \ - "$sim_base"/$db$i/$db.db "$@" - } - - ovn_prep_db() { - local i=$1 - mkdir "$sim_base"/${db}$i - touch "$sim_base"/${db}$i/.$db.db.~lock~ - } - - local n_remotes=1 - case $model in - standalone) - ovn_prep_db 1 - ovsdb-tool create "$sim_base"/${db}1/$db.db "$schema" - ovn_start_ovsdb_server 1 - ;; - backup) - for i in 1 2; do - ovn_prep_db $i - ovsdb-tool create "$sim_base"/$db$i/$db.db "$schema" - done - ovn_start_ovsdb_server 1 - ovn_start_ovsdb_server 2 --sync-from=unix:"$sim_base"/${db}1/$db.ovsdb - cat <<EOF -The backup server of OVN $DB can be accessed by: -* ovn-${db}ctl --db=unix:$sim_base/${db}2/$db.ovsdb -* ovs-appctl -t $sim_base/${db}2/${db} -The backup database file is $sim_base/${db}2/$db.db -EOF - ;; - clustered) - n_remotes=$servers - for i in $(seq $servers); do - ovn_prep_db $i - if test $i = 1; then - ovsdb-tool create-cluster "$sim_base"/$db$i/$db.db "$schema" unix:"$sim_base"/$db$i/db.raft - else - ovsdb-tool join-cluster "$sim_base"/$db$i/$db.db $schema_name unix:"$sim_base"/$db$i/db.raft unix:"$sim_base"/${db}1/db.raft - fi - ovn_start_ovsdb_server $i - done - for i in $(seq $servers); do - ovsdb-client wait unix:"$sim_base"/${db}$i/$db.ovsdb $schema_name connected - done - ;; - esac - - remote=unix:"$sim_base"/${db}1/$db.ovsdb - for i in `seq 2 $n_remotes`; do - remote=$remote,unix:"$sim_base"/${db}$i/$db.ovsdb - done - eval OVN_${DB}_DB=\$remote - eval export OVN_${DB}_DB -} -export -f ovn_start_db - -ovn_start() { - local nbdb_model=standalone - local nbdb_servers=3 - local sbdb_model=standalone - local sbdb_servers=3 - local prev= - for option; do - # This option-parsing mechanism borrowed from a Autoconf-generated - # configure script under the following license: - - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - # 2002, 2003, 2004, 2005, 2006, 2009, 2013 Free Software Foundation, Inc. - # This configure script is free software; the Free Software Foundation - # gives unlimited permission to copy, distribute and modify it. - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval $prev=\$option - prev= - continue - fi - case $option in - *=*) optarg=`expr "X$option" : '[^=]*=\(.*\)'` ;; - *) optarg=yes ;; - esac - - case $dashdash$option in - --) - dashdash=yes ;; - -h|--help) - cat <<EOF -$FUNCNAME: start OVN central databases and daemons -usage: $FUNCNAME [OPTION...] - -This creates and initializes the central OVN databases (northbound and -southbound), starts their ovsdb-server daemons, and starts the ovn-northd -daemon. - -Options: - --nbdb-model=standalone|backup|clustered northbound database model - --nbdb-servers=N number of servers in nbdb cluster (default: 3) - --sbdb-model=standalone|backup|clustered southbound database model - --sbdb-servers=N number of servers in sbdb cluster (default: 3) - -h, --help Print this usage message. -EOF - return - ;; - - --nbdb-s*=*) - nbdb_servers=$optarg - nbdb_model=clustered - ;; - --nbdb-s*) - prev=nbdb_servers - nbdb_model=clustered - ;; - --nbdb-m*=*) - nbdb_model=$optarg - ;; - --nbdb-m*) - prev=nbdb_model - ;; - --sbdb-s*=*) - sbdb_servers=$optarg - sbdb_model=clustered - ;; - --sbdb-s*) - prev=sbdb_servers - sbdb_model=clustered - ;; - --sbdb-m*=*) - sbdb_model=$optarg - ;; - --sbdb-m*) - prev=sbdb_model - ;; - -*) - echo "unrecognized option $option (use --help for help)" >&2 - return 1 - ;; - *) - echo "$option: non-option arguments not supported (use --help for help)" >&2 - return 1 - ;; - esac - shift - done - - if test -d ovn-sb || test -d ovn-nb; then - echo >&2 "OVN already started" - return 1 - fi - - ovn_sim_setvars $sandbox - - # Build ovn man pages as part of ovn_start - ovn_man_pages - - ovn_start_db nb "$nbdb_model" "$nbdb_servers" "$ovn_sim_srcdir"/ovn-nb.ovsschema - ovn_start_db sb "$sbdb_model" "$sbdb_servers" "$ovn_sim_srcdir"/ovn-sb.ovsschema - - ovn-nbctl init - ovn-sbctl init - - mkdir "$sim_base"/northd - as northd ovn-northd --detach --no-chdir --pidfile=ovn-northd.pid -vconsole:off \ - --log-file=ovn-northd.log -vsyslog:off \ - --ovnnb-db="$OVN_NB_DB" --ovnsb-db="$OVN_SB_DB" -} -export -f ovn_start - -ovn_attach() { - if test "$1" = --help; then - cat <<EOF -$FUNCNAME: attach default sandbox to an interconnection network for OVN -usage: $FUNCNAME NETWORK BRIDGE IP [MASKLEN] - -This starts by doing everything that net_attach does. Then it configures the -specified IP and MASKLEN (e.g. 192.168.0.1 and 24) on BRIDGE and starts -and configures ovn-controller. - -MASKLEN defaults to 24 if it is not specified. -EOF - return 0 - fi - if test $# != 3 && test $# != 4; then - echo >&2 "$FUNCNAME: wrong number of arguments (use --help for help)" - return 1 - fi - - local net=$1 bridge=$2 ip=$3 masklen=${4-24} - net_attach $net $bridge || return $? - - ovn_sim_setvars $sandbox - - ovs-appctl netdev-dummy/ip4addr $bridge $ip/$masklen >/dev/null - ovs-appctl ovs/route/add $ip/$masklen $bridge > /dev/null - ovs-vsctl \ - -- set Open_vSwitch . external-ids:system-id=$sandbox \ - -- set Open_vSwitch . external-ids:ovn-remote=$OVN_SB_DB \ - -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \ - -- set Open_vSwitch . external-ids:ovn-encap-ip=$ip\ - -- add-br br-int \ - -- set bridge br-int fail-mode=secure other-config:disable-in-band=true - ovn-controller --detach --no-chdir -vsyslog:off -vconsole:off \ - --log-file=ovn-controller.${sandbox}.log \ - --pidfile=ovn-controller.${sandbox}.pid -} -export -f ovn_attach - -ovn_sim_setvars() { - OVN_RUNDIR=$sim_base/$1; export OVN_RUNDIR - OVN_LOGDIR=$sim_base/$1; export OVN_LOGDIR - OVN_DBDIR=$sim_base/$1; export OVN_DBDIR - OVN_SYSCONFDIR=$sim_base/$1; export OVN_SYSCONFDIR -} -export -f ovn_sim_setvars - -ovn_as() { - if test -n "$1"; then - ovn_sim_setvars $1 - fi - as $@ -} -export -f ovn_as - -ovn_man_pages() { - # Easy access to OVN manpages. - mkdir -p $sim_base/man - mandir=`cd $sim_base/man && pwd` - (cd "$ovn_sim_builddir" && ${MAKE-make} install-man install-man-rst mandir=$mandir EXTRA_RST_MANPAGES=ovn-sim.1.rst >/dev/null) - # Note: MANPATH expected to be already exported by ovs-sim - #MANPATH=$mandir:; export MANPATH -} -export -f ovn_man_pages - -source ${ovs_sim_builddir}/utilities/ovs-sim -- 2.55.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
