[ovs-dev] [PATCH 2/2] ovs-sandbox: Support starting multiple ovn-northds.

Ben Pfaff blp at ovn.org
Thu Apr 5 00:41:12 UTC 2018


On Wed, Apr 04, 2018 at 05:32:42PM -0700, aginwala wrote:
> On Wed, Apr 4, 2018 at 3:56 PM, Ben Pfaff <blp at ovn.org> wrote:
> 
> > This allows testing ovn-northd behavior when it is run in an HA
> > configuration.
> >
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > ---
> >  tutorial/ovs-sandbox | 17 ++++++++++++++---
> >  1 file changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox
> > index 730f32290f72..7a9c19539b83 100755
> > --- a/tutorial/ovs-sandbox
> > +++ b/tutorial/ovs-sandbox
> > @@ -71,6 +71,7 @@ ovn=false
> >  ovnsb_schema=
> >  ovnnb_schema=
> >  ovn_rbac=true
> > +n_northds=1
> >  nbdb_model=standalone
> >  nbdb_servers=3
> >  sbdb_model=backup
> > @@ -129,6 +130,7 @@ General options:
> >  OVN options:
> >    -o, --ovn            enable OVN
> >    --no-ovn-rbac        disable role-based access control for OVN
> > +  --n-northds=NUMBER   run NUMBER copies of northd (default: 1)
> >    --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
> > @@ -204,6 +206,12 @@ EOF
> >          --no-ovn-rbac)
> >              ovn_rbac=false
> >              ;;
> > +        --n-northd*=*)
> > +            n_northds=$optarg
> > +            ;;
> > +        --n-northd*)
> > +            prev=n_northds
> > +            ;;
> >          --nbdb-s*=*)
> >              nbdb_servers=$optarg
> >              nbdb_model=clustered
> > @@ -508,9 +516,12 @@ if $ovn; then
> >          ovs-vsctl set open . external-ids:ovn-remote=$OVN_SB_DB
> >          OVN_CTRLR_PKI=""
> >      fi
> > -    rungdb $gdb_ovn_northd $gdb_ovn_northd_ex ovn-northd --detach \
> > -        --no-chdir --pidfile -vconsole:off --log-file \
> > -        --ovnsb-db="$OVN_SB_DB" --ovnnb-db="$OVN_NB_DB"
> >
> >>> Running default usage make sandbox SANDBOXFLAGS="--ovn" will not create
> northd instance controller will complain with RBAC errors and chassis
> registration fails.
> So I added below lines to make it work:
>  if [ -z "$n_northds" ]; then
>         n_northds=1
>  fi

Thank you for testing.

I don't understand why there is a problem.  If you look upward at the
patch, you can see that it sets n_northds=1 near the top.  Do you have
an idea why this does not work for you?

> You might have a better approach too for default ovn setup case or update
> usage to pass n_northds ?
> 
> > +    for i in $(seq $n_northds); do
> > +        rungdb $gdb_ovn_northd $gdb_ovn_northd_ex ovn-northd --detach \
> > +               --no-chdir --pidfile=ovn-northd$i.pid -vconsole:off \
> > +               --log-file=ovn-northd$i.log \
> > +               --ovnsb-db="$OVN_SB_DB" --ovnnb-db="$OVN_NB_DB"
> > +    done
> >      rungdb $gdb_ovn_controller $gdb_ovn_controller_ex ovn-controller \
> >          $OVN_CTRLR_PKI --detach --no-chdir --pidfile -vconsole:off
> > --log-file
> >      rungdb $gdb_ovn_controller_vtep $gdb_ovn_controller_vtep_ex \
> > --
> > 2.16.1
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
> 
> Also just realized below command was wrongly pushed.
> 
> wait=hv is not valid for ovn-sbctl
> 
> diff --git a/tutorial/ovn-setup.sh b/tutorial/ovn-setup.sh
> index 9a725cf..969b233 100755
> --- a/tutorial/ovn-setup.sh
> +++ b/tutorial/ovn-setup.sh
> @@ -35,5 +35,3 @@ printf "\n=== ovn-nbctl show with wait hv ===\n\n"
>  ovn-nbctl --wait=hv show
>  printf "\n=== ovn-sbctl show ===\n\n"
>  ovn-sbctl show
> -printf "\n=== ovn-sbctl show with wait hv ===\n\n"
> -ovn-sbctl --wait=hv show
> 
> Can you also include above in the commit or want to have a separate patch?

Because it addresses a separate issue, please do submit a separate
patch.

Thanks,

Ben.


More information about the dev mailing list