[ovs-discuss] [OVN] DB backup and restore

2020-07-29 Thread Tony Liu
Hi,

There is any guidance to backup and restore OVN nb-db and sb-db?

Is /var/lib/openvswitch/ovn-[ns]b/ovn[ns]b.db the only database file?

For 3-node DB cluster, is replication 3 (the data is replicated onto
All 3 nodes)?

Are DB files on 3 nodes identical?

If I stop a DB follower and empty the DB file on the follower node,
when I start it back, is the whole DB going to be replicated to it?

To backup the DB, is it OK to copy the DB file from any node, assuming
no transaction ongoing?

Is the following going to work to restore the DB?
* Stop all 3 DBs.
* Copy backup DB file to one node, empty DB file on the rest two nodes.
* Bootstrap the node with DB file.
* Start the rest two nodes to join the cluster.

Do I need to restore sb-db as well? Or restore nb-db only and let
ovn-northd to sync data from nb-db to sb-db. Chassis data should be
updated by onv-controller?

I am running scaling test. It takes quite a lot of time to build
Configurations. Wondering if I can back and restore DB to rollback
to some checkpoint to avoid restart all over.


Thanks!

Tony

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


[ovs-discuss] Error installation

2020-07-29 Thread JORGE ELIECER GOMEZ GOMEZ
Hello

I have a problem with installation of Openvswitch  in Welcome to Ubuntu
20.04.1 LTS (GNU/Linux 5.4.0-26-generic x86_64)

error: Linux kernel in /lib/modules/5.4.0-26-generic/build is version
5.4.30, but version newer than 4.3.x is not supported (please refer to the
FAQ for advice) 

What do I have to do with this error?

Thank

Jorge

-- 

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] [ovs-dev] OVN: configuration in Neutron DB?

2020-07-29 Thread Tony Liu
Hi Lucas,

Is it OK to discuss OpenStack integration here? Otherwise, please let
me know which OpenStack email list we can use.

I am running networking scaling test. The target is 4K isolated private
networks with external/public access via logical routers. The test in
my previous email is to add 256 routers and set them as gateway. When I
use openstack cli to create a router and set it as gateway immediately,
it doesn’t work some times, Neutron complaints that the router is not
found.

for c in `seq 0 1 255`; do
echo "INFO: $op router-$c..."
openstack router $op router-$c
if [ "$op" == "create" ]; then
openstack router set \
--external-gateway public \
--fixed-ip ip-address=10.6.33.$c \
--disable-snat \
router-$c
fi
done

I thought Neutron API call is synchronous, which means when the client
gets the response for a creation request, the object is created. But
OVN part is async. Is that right? That’s why I was asking reading is
from Neutron DB or OVN DB. If the reading is from Neutron DB, I don’t
understand why the router can not be found when client sets it?
Any thought here?

I changed test script to create all 256 routers first, then set them.
It works fine. It kind of proves that it’s not guaranteed that the
object is ready after receiving the response. I don’t believe this is
expected.

Now, I am adding subnets to router, 16 subnets to 1 router. It’s 4096
networks on 256 routers. It’s quit slow and I am getting some errors.

INFO: Add subnet-1-0 to router-1...
BadRequestException: 400: Client Error for url: 
http://10.6.20.200:9696/v2.0/routers/3d9bff46-4eba-4621-b7c4-3c3062ab8d6e/add_router_interface,
 Bad router request: Router already has a port on subnet 
9d8d1f2d-a401-4ad9-9a72-0d530fba2085.
INFO: Add subnet-1-16 to router-1...
INFO: Add subnet-1-32 to router-1...
ConflictException: 409: Client Error for url: 
http://10.6.20.200:9696/v2.0/routers/3d9bff46-4eba-4621-b7c4-3c3062ab8d6e/add_router_interface,
 IP address 192.168.1.33 already allocated in subnet 
e44dee36-0ee4-4c23-91cf-1ac5b9ee07e0
INFO: Add subnet-1-48 to router-1...
INFO: Add subnet-1-64 to router-1...
HttpException: 500: Server Error for url: 
http://10.6.20.200:9696/v2.0/routers/3d9bff46-4eba-4621-b7c4-3c3062ab8d6e/add_router_interface,
 Request Failed: internal server error while processing your request.

I am not sure if that’s because I add subnets to one router back to back.
I will try another way to add subnet to avoid such back to back requests
to the same router. Will see if that helps.


Thanks!

Tony

From: Lucas Alvares Gomes
Sent: Wednesday, July 29, 2020 2:22 AM
To: Numan Siddique
Cc: Tony Liu; 
ovs-...@openvswitch.org; Lucas Alvares Gomes 
Martins; 
ovs-discuss@openvswitch.org
Subject: Re: [ovs-dev] [ovs-discuss] OVN: configuration in Neutron DB?

Hi,

On Wed, Jul 29, 2020 at 7:42 AM Numan Siddique  wrote:
>
> Adding Daniel and Lucas. Maybe you can also include opendev ML to get
> appropriate responses from the OpenStack side.
>
> Please see below for few comments.
>
>
> On Wed, Jul 29, 2020 at 12:02 PM Tony Liu  wrote:
>
> > Quick update. I changed the script to create 256 routers first, then set
> > each of them as gateway.
> > There is no create and set back to back. It seems working fine now.
> >
> > It would be good someone can clarify my questions. It seems that it's
> > not guaranteed that the
> > object is ready when client get OK response of creation request. Is this
> > expected?
> >
> >
> > Thanks!
> >
> > Tony
> >
> > --
> > *From:* dev  on behalf of Tony Liu <
> > tonyliu0...@hotmail.com>
> > *Sent:* July 28, 2020 10:37 PM
> > *To:* ovs-discuss@openvswitch.org ;
> > ovs-...@openvswitch.org 
> > *Subject:* [ovs-dev] OVN: configuration in Neutron DB?
> >
> > Hi,
> >
> > In case of integration with OpenStack, for example, when a client requests
> > to create a network,
> > is this network configuration saved in both Neutron DB and OVN DB, or OVN
> > DB only?
> >
>
> The neutron API first saves in the neutron db and the neutron OVN mechanism
> driver will talk
> to the Northbound ovsdb-server and create corresponding OVN logical
> resources.
>

Both as numans said, it's first created in the Neutron database and
then the OVN plugin is invoked to create that resource in the OVN NB
database. We usually use the "name" column in the OVN NB DB to store
the correspondent Neutron UUID, if the resource has no "name" column
we then use the external_ids columns to do it.

In your example, a Neutron network corresponds to a Logical_Switch in OVN:

stack@lucas-devstack-2:~/neutron$ openstack network create test
| id| 702c4ccd-2f9e-43c8-99a8-4b07a509e105 |
...


Re: [ovs-discuss] [ovs-dev] OVN: configuration in Neutron DB?

2020-07-29 Thread Lucas Alvares Gomes
Hi,

On Wed, Jul 29, 2020 at 7:42 AM Numan Siddique  wrote:
>
> Adding Daniel and Lucas. Maybe you can also include opendev ML to get
> appropriate responses from the OpenStack side.
>
> Please see below for few comments.
>
>
> On Wed, Jul 29, 2020 at 12:02 PM Tony Liu  wrote:
>
> > Quick update. I changed the script to create 256 routers first, then set
> > each of them as gateway.
> > There is no create and set back to back. It seems working fine now.
> >
> > It would be good someone can clarify my questions. It seems that it's
> > not guaranteed that the
> > object is ready when client get OK response of creation request. Is this
> > expected?
> >
> >
> > Thanks!
> >
> > Tony
> >
> > --
> > *From:* dev  on behalf of Tony Liu <
> > tonyliu0...@hotmail.com>
> > *Sent:* July 28, 2020 10:37 PM
> > *To:* ovs-discuss@openvswitch.org ;
> > ovs-...@openvswitch.org 
> > *Subject:* [ovs-dev] OVN: configuration in Neutron DB?
> >
> > Hi,
> >
> > In case of integration with OpenStack, for example, when a client requests
> > to create a network,
> > is this network configuration saved in both Neutron DB and OVN DB, or OVN
> > DB only?
> >
>
> The neutron API first saves in the neutron db and the neutron OVN mechanism
> driver will talk
> to the Northbound ovsdb-server and create corresponding OVN logical
> resources.
>

Both as numans said, it's first created in the Neutron database and
then the OVN plugin is invoked to create that resource in the OVN NB
database. We usually use the "name" column in the OVN NB DB to store
the correspondent Neutron UUID, if the resource has no "name" column
we then use the external_ids columns to do it.

In your example, a Neutron network corresponds to a Logical_Switch in OVN:

stack@lucas-devstack-2:~/neutron$ openstack network create test
| id| 702c4ccd-2f9e-43c8-99a8-4b07a509e105 |
...

stack@lucas-devstack-2:~/neutron$ ovn-nbctl list logical_switch
external_ids: {"neutron:mtu"="1442",
"neutron:network_name"=test, "neutron:revision_number"="1"}
name: neutron-702c4ccd-2f9e-43c8-99a8-4b07a509e105\
...

So the correspondent Logical Switch in OVN is named as "neutron-"

>
> > Also, when a client gets a network from Neutron API, is the configuration
> > read from Neutron DB
> > or OVN DB?
> >
>
> I think its read from the neutron DB.
>

That's right, it reads from the Neutron database.

>
>
> >
> > Other than coding, is there any doc about how Neutron OVN ML2 driver works?
> >
>
> You can refer here -
> https://docs.openstack.org/neutron/latest/admin/ovn/refarch/refarch.html
>

Yeah that's the part of the documentation we have that matches with
your questions, let us know if you have more questions and perhaps we
can enhance that document with the answers.


>
> >
> > I have this script to create 256 routers and set each of them as gateway.
> > router()
> > {
> > local op=$1
> >
> > for c in `seq 0 1 255`; do
> > echo "INFO: $op router-$c..."
> > openstack router $op router-$c
> > if [ "$op" == "create" ]; then
> > openstack router set \
> > --external-gateway public \
> > --fixed-ip ip-address=10.6.33.$c \
> > --disable-snat \
> > router-$c
> > fi
> > done
> > }
> > I see lots failures from Neutron log when get/show a router. It seems like
> > that, when setting a router,
> > the router is not completely ready yet. Is it possible?
> >
> > After running that script, I see some logical routers in ovn-nb-db don't
> > have gw_port_id. And there
> > are some duplications. Here is an example. Each of them has unique UUID.
> >
> > external_ids: {"neutron:gw_port_id"="",
> > "neutron:revision_number"="1", "neutron:router_name"=router-255}
> > external_ids: {"neutron:gw_port_id"="",
> > "neutron:revision_number"="1", "neutron:router_name"=router-232}
> > external_ids: {"neutron:gw_port_id"="",
> > "neutron:revision_number"="0", "neutron:router_name"=router-158}
> > external_ids: {"neutron:gw_port_id"="",
> > "neutron:revision_number"="0", "neutron:router_name"=router-158}
> > external_ids:
> > {"neutron:gw_port_id"="e52dda53-c914-4ea7-840b-8632a5770680",
> > "neutron:revision_number"="2", "neutron:router_name"=router-158}
> >
> > I enabled nb-db debug logging and searched, eg. router-158, it only shows
> > in a jsonrpc reply message
> > including 3 router-158, as the above.
> >
> > Any clues?
> >
> >
> Maybe Daniel/Lucas can comment.
>
> Thanks
> Numan
>
>
> >
> > Thanks!
> >
> > Tony
> >
> >
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> > ___
> > discuss mailing list
> > disc...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
> >
> 

Re: [ovs-discuss] OVN: configuration in Neutron DB?

2020-07-29 Thread Tony Liu
Thanks Numan!

Tony

From: Numan Siddique 
Sent: July 28, 2020 11:41 PM
To: Tony Liu 
Cc: ovs-discuss@openvswitch.org ; 
ovs-...@openvswitch.org ; Daniel Alvarez Sanchez 
; Lucas Alvares Gomes Martins 
Subject: Re: [ovs-discuss] OVN: configuration in Neutron DB?


Adding Daniel and Lucas. Maybe you can also include opendev ML to get 
appropriate responses from the OpenStack side.

Please see below for few comments.


On Wed, Jul 29, 2020 at 12:02 PM Tony Liu 
mailto:tonyliu0...@hotmail.com>> wrote:
Quick update. I changed the script to create 256 routers first, then set each 
of them as gateway.
There is no create and set back to back. It seems working fine now.

It would be good someone can clarify my questions. It seems that it's not 
guaranteed that the
object is ready when client get OK response of creation request. Is this 
expected?


Thanks!

Tony


From: dev 
mailto:ovs-dev-boun...@openvswitch.org>> on 
behalf of Tony Liu mailto:tonyliu0...@hotmail.com>>
Sent: July 28, 2020 10:37 PM
To: ovs-discuss@openvswitch.org 
mailto:ovs-discuss@openvswitch.org>>; 
ovs-...@openvswitch.org 
mailto:ovs-...@openvswitch.org>>
Subject: [ovs-dev] OVN: configuration in Neutron DB?

Hi,

In case of integration with OpenStack, for example, when a client requests to 
create a network,
is this network configuration saved in both Neutron DB and OVN DB, or OVN DB 
only?

The neutron API first saves in the neutron db and the neutron OVN mechanism 
driver will talk
to the Northbound ovsdb-server and create corresponding OVN logical resources.

Also, when a client gets a network from Neutron API, is the configuration read 
from Neutron DB
or OVN DB?

I think its read from the neutron DB.



Other than coding, is there any doc about how Neutron OVN ML2 driver works?

You can refer here - 
https://docs.openstack.org/neutron/latest/admin/ovn/refarch/refarch.html



I have this script to create 256 routers and set each of them as gateway.
router()
{
local op=$1

for c in `seq 0 1 255`; do
echo "INFO: $op router-$c..."
openstack router $op router-$c
if [ "$op" == "create" ]; then
openstack router set \
--external-gateway public \
--fixed-ip ip-address=10.6.33.$c \
--disable-snat \
router-$c
fi
done
}
I see lots failures from Neutron log when get/show a router. It seems like 
that, when setting a router,
the router is not completely ready yet. Is it possible?

After running that script, I see some logical routers in ovn-nb-db don't have 
gw_port_id. And there
are some duplications. Here is an example. Each of them has unique UUID.

external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="1", 
"neutron:router_name"=router-255}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="1", 
"neutron:router_name"=router-232}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="0", 
"neutron:router_name"=router-158}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="0", 
"neutron:router_name"=router-158}
external_ids: 
{"neutron:gw_port_id"="e52dda53-c914-4ea7-840b-8632a5770680", 
"neutron:revision_number"="2", "neutron:router_name"=router-158}

I enabled nb-db debug logging and searched, eg. router-158, it only shows in a 
jsonrpc reply message
including 3 router-158, as the above.

Any clues?


Maybe Daniel/Lucas can comment.

Thanks
Numan


Thanks!

Tony



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: configuration in Neutron DB?

2020-07-29 Thread Numan Siddique
Adding Daniel and Lucas. Maybe you can also include opendev ML to get
appropriate responses from the OpenStack side.

Please see below for few comments.


On Wed, Jul 29, 2020 at 12:02 PM Tony Liu  wrote:

> Quick update. I changed the script to create 256 routers first, then set
> each of them as gateway.
> There is no create and set back to back. It seems working fine now.
>
> It would be good someone can clarify my questions. It seems that it's
> not guaranteed that the
> object is ready when client get OK response of creation request. Is this
> expected?
>
>
> Thanks!
>
> Tony
>
> --
> *From:* dev  on behalf of Tony Liu <
> tonyliu0...@hotmail.com>
> *Sent:* July 28, 2020 10:37 PM
> *To:* ovs-discuss@openvswitch.org ;
> ovs-...@openvswitch.org 
> *Subject:* [ovs-dev] OVN: configuration in Neutron DB?
>
> Hi,
>
> In case of integration with OpenStack, for example, when a client requests
> to create a network,
> is this network configuration saved in both Neutron DB and OVN DB, or OVN
> DB only?
>

The neutron API first saves in the neutron db and the neutron OVN mechanism
driver will talk
to the Northbound ovsdb-server and create corresponding OVN logical
resources.


> Also, when a client gets a network from Neutron API, is the configuration
> read from Neutron DB
> or OVN DB?
>

I think its read from the neutron DB.



>
> Other than coding, is there any doc about how Neutron OVN ML2 driver works?
>

You can refer here -
https://docs.openstack.org/neutron/latest/admin/ovn/refarch/refarch.html



>
> I have this script to create 256 routers and set each of them as gateway.
> router()
> {
> local op=$1
>
> for c in `seq 0 1 255`; do
> echo "INFO: $op router-$c..."
> openstack router $op router-$c
> if [ "$op" == "create" ]; then
> openstack router set \
> --external-gateway public \
> --fixed-ip ip-address=10.6.33.$c \
> --disable-snat \
> router-$c
> fi
> done
> }
> I see lots failures from Neutron log when get/show a router. It seems like
> that, when setting a router,
> the router is not completely ready yet. Is it possible?
>
> After running that script, I see some logical routers in ovn-nb-db don't
> have gw_port_id. And there
> are some duplications. Here is an example. Each of them has unique UUID.
>
> external_ids: {"neutron:gw_port_id"="",
> "neutron:revision_number"="1", "neutron:router_name"=router-255}
> external_ids: {"neutron:gw_port_id"="",
> "neutron:revision_number"="1", "neutron:router_name"=router-232}
> external_ids: {"neutron:gw_port_id"="",
> "neutron:revision_number"="0", "neutron:router_name"=router-158}
> external_ids: {"neutron:gw_port_id"="",
> "neutron:revision_number"="0", "neutron:router_name"=router-158}
> external_ids:
> {"neutron:gw_port_id"="e52dda53-c914-4ea7-840b-8632a5770680",
> "neutron:revision_number"="2", "neutron:router_name"=router-158}
>
> I enabled nb-db debug logging and searched, eg. router-158, it only shows
> in a jsonrpc reply message
> including 3 router-158, as the above.
>
> Any clues?
>
>
Maybe Daniel/Lucas can comment.

Thanks
Numan


>
> Thanks!
>
> Tony
>
>
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> ___
> discuss mailing list
> disc...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: configuration in Neutron DB?

2020-07-29 Thread Tony Liu
Quick update. I changed the script to create 256 routers first, then set each 
of them as gateway.
There is no create and set back to back. It seems working fine now.

It would be good someone can clarify my questions. It seems that it's not 
guaranteed that the
object is ready when client get OK response of creation request. Is this 
expected?


Thanks!

Tony


From: dev  on behalf of Tony Liu 

Sent: July 28, 2020 10:37 PM
To: ovs-discuss@openvswitch.org ; 
ovs-...@openvswitch.org 
Subject: [ovs-dev] OVN: configuration in Neutron DB?

Hi,

In case of integration with OpenStack, for example, when a client requests to 
create a network,
is this network configuration saved in both Neutron DB and OVN DB, or OVN DB 
only?
Also, when a client gets a network from Neutron API, is the configuration read 
from Neutron DB
or OVN DB?

Other than coding, is there any doc about how Neutron OVN ML2 driver works?

I have this script to create 256 routers and set each of them as gateway.
router()
{
local op=$1

for c in `seq 0 1 255`; do
echo "INFO: $op router-$c..."
openstack router $op router-$c
if [ "$op" == "create" ]; then
openstack router set \
--external-gateway public \
--fixed-ip ip-address=10.6.33.$c \
--disable-snat \
router-$c
fi
done
}
I see lots failures from Neutron log when get/show a router. It seems like 
that, when setting a router,
the router is not completely ready yet. Is it possible?

After running that script, I see some logical routers in ovn-nb-db don't have 
gw_port_id. And there
are some duplications. Here is an example. Each of them has unique UUID.

external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="1", 
"neutron:router_name"=router-255}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="1", 
"neutron:router_name"=router-232}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="0", 
"neutron:router_name"=router-158}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="0", 
"neutron:router_name"=router-158}
external_ids: 
{"neutron:gw_port_id"="e52dda53-c914-4ea7-840b-8632a5770680", 
"neutron:revision_number"="2", "neutron:router_name"=router-158}

I enabled nb-db debug logging and searched, eg. router-158, it only shows in a 
jsonrpc reply message
including 3 router-158, as the above.

Any clues?


Thanks!

Tony



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


[ovs-discuss] OVN: configuration in Neutron DB?

2020-07-29 Thread Tony Liu
Hi,

In case of integration with OpenStack, for example, when a client requests to 
create a network,
is this network configuration saved in both Neutron DB and OVN DB, or OVN DB 
only?
Also, when a client gets a network from Neutron API, is the configuration read 
from Neutron DB
or OVN DB?

Other than coding, is there any doc about how Neutron OVN ML2 driver works?

I have this script to create 256 routers and set each of them as gateway.
router()
{
local op=$1

for c in `seq 0 1 255`; do
echo "INFO: $op router-$c..."
openstack router $op router-$c
if [ "$op" == "create" ]; then
openstack router set \
--external-gateway public \
--fixed-ip ip-address=10.6.33.$c \
--disable-snat \
router-$c
fi
done
}
I see lots failures from Neutron log when get/show a router. It seems like 
that, when setting a router,
the router is not completely ready yet. Is it possible?

After running that script, I see some logical routers in ovn-nb-db don't have 
gw_port_id. And there
are some duplications. Here is an example. Each of them has unique UUID.

external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="1", 
"neutron:router_name"=router-255}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="1", 
"neutron:router_name"=router-232}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="0", 
"neutron:router_name"=router-158}
external_ids: {"neutron:gw_port_id"="", "neutron:revision_number"="0", 
"neutron:router_name"=router-158}
external_ids: 
{"neutron:gw_port_id"="e52dda53-c914-4ea7-840b-8632a5770680", 
"neutron:revision_number"="2", "neutron:router_name"=router-158}

I enabled nb-db debug logging and searched, eg. router-158, it only shows in a 
jsonrpc reply message
including 3 router-158, as the above.

Any clues?


Thanks!

Tony



___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss