I have created a pull request on git for adding db commands help
and I want to change the output of "/ovn-nbctl show/"
1: "ovn-nbctl show" will print all switch and all router like this:
lswitch 363cf780-c233-4cbd-a9b3-57bfad8dc907
(neutron-9822d5dd-017c-4c82-92d8-8b71f7d55255)
lport 9e8378b9-80b2-4d6a-864a-6d378bcc4a66
addresses: fa:16:3e:4c:3b:fc 1.1.1.1
lport 9f36e7fc-372f-45c4-bca5-aac172bd4ac6
addresses: fa:16:3e:74:6a:65 1.1.1.2
lswitch 654c9341-e29b-4575-af9a-8f3a698ba8b4
(neutron-8b3dbb6d-2dab-41c9-9c1f-66e0a489484b)
lport f9becbbb-fbdf-49bb-92fc-25fc2aacf019
addresses: fa:16:3e:6d:55:00 2.2.2.1
lport 2af73da5-c1f1-4d78-9997-3e6be6d8a36a
addresses: fa:16:3e:f0:96:0d 2.2.2.2
lrouter fb3b447d-b287-46c4-a663-1a5cb95b42f2
(neutron-17941229-a31e-4033-a845-5fada1922325)
lport 9e8378b9-80b2-4d6a-864a-6d378bcc4a66
network: 1.1.1.1/24
mac: fa:16:3e:4c:3b:fc
lport f9becbbb-fbdf-49bb-92fc-25fc2aacf019
network: 2.2.2.1/24
mac: fa:16:3e:6d:55:00
2: delete "/show LSWITCH/" use "/list TBL [REC]/" for specified one
is ok?
在 2015/12/3 22:24, Russell Bryant 写道:
On 12/03/2015 03:54 AM, Wei Li wrote:
ovn-nbctl -h
General commands:
show print overview of database contents
show LSWITCH print overview of database contents for LSWITCH
How to show LROUTER?
ovn-nbctl supports the same general database commands as ovs-vsctl,
though it's missing from the help text.
ovn-nbctl list Logical_Router
ovn-nbctl get Logical_Router ...
I think it'd be nice to list logical routers along with the logical
switches in "ovn-nbctl show".
Add a keywork like "ovn-nbctl show /router /LROUTER"?
Since you can do "show LSWITCH", we could make it also accept "show
LROUTER" by checking the name or uuid against both tables. I'm tempted
to just drop "show LSWITCH" instead, though.
and "lport-add LSWITCH LPORT" has same problem, it looks like not scalabel
I think
"ovn-nbctl lrouter-show"
"ovn-nbctl lswitch-show"
"ovn-nbctl lrouter-add-port"
"ovn-nbctl lswtich-add-port"
is better.
or any better idear?
Most things, including the above, can be done with the general database
commands. We should at least fix the help text to document those
commands. Including examples for really common use cases in the help
text would be nice, too.
If there are cases where the general db commands become painful or
friendly output is helpful, we can add new commands.
Some example commands for creating a logical router with 2 logical
switches with 1 logical port on each switch. This originally came from
Justin on IRC one day.
ovn-nbctl lswitch-add sw0
ovn-nbctl lport-add sw0 sw0-port1
ovn-nbctl lport-set-addresses sw0-port1 "50:54:00:00:00:01 192.168.0.2"
ovn-nbctl lswitch-add sw1
ovn-nbctl lport-add sw1 sw1-port1
ovn-nbctl lport-set-addresses sw1-port1 "50:54:00:00:00:03 11.0.0.2"
ovn-nbctl create Logical_Router name=lr0
lrp_uuid=`ovn-nbctl \
-- --id=@lrp create Logical_Router_port name=lrp0 \
network=192.168.0.1/24 mac='"00:00:00:00:ff:01"' \
-- add Logical_Router lr0 ports @lrp \
-- lport-add sw0 lrp0-attachment`
ovn-nbctl set Logical_port lrp0-attachment type=router \
options:router-port=$lrp_uuid \
addresses='"00:00:00:00:ff:01"'
lrp_uuid=`ovn-nbctl \
-- --id=@lrp create Logical_Router_port name=lrp1 \
network=11.0.0.1/24 mac='"00:00:00:00:ff:02"' \
-- add Logical_Router lr0 ports @lrp \
-- lport-add sw1 lrp1-attachment`
ovn-nbctl set Logical_port lrp1-attachment type=router \
options:router-port=$lrp_uuid \
addresses='"00:00:00:00:ff:02"'
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev