3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 # This script simulates 2 chassis connected to a physical switch,
17 # which we call "physnet1". We have two logical ports, one on each hypervisor,
18 # that OVN will connect to physnet1.
20 # The way to accomplish this in OVN is to create a logical switch for each
21 # logical port. In addition to the normal logical port, each logical switch
22 # has a special "localnet" port, which represents the connection to physnet1.
24 # In this setup we see the view of this environment from one of the hypervisors.
28 ovn-sbctl chassis-add fakechassis geneve 127.0.0.1
31 ovn-nbctl lswitch-add provnet1-$n
33 ovn-nbctl lport-add provnet1-$n provnet1-$n-port1
34 ovn-nbctl lport-set-addresses provnet1-$n-port1 00:00:00:00:00:0$n
35 ovn-nbctl lport-set-port-security provnet1-$n-port1 00:00:00:00:00:0$n
37 ovn-nbctl lport-add provnet1-$n provnet1-$n-physnet1
38 ovn-nbctl lport-set-addresses provnet1-$n-physnet1 unknown
39 ovn-nbctl lport-set-type provnet1-$n-physnet1 localnet
40 ovn-nbctl lport-set-options provnet1-$n-physnet1 network_name=physnet1
43 ovs-vsctl add-port br-int lport1 -- set Interface lport1 external_ids:iface-id=provnet1-1-port1
44 ovs-vsctl add-port br-int lport2 -- set Interface lport2 external_ids:iface-id=provnet1-2-port1
46 ovn-sbctl lport-bind provnet1-3-port1 fakechassis
47 ovn-sbctl lport-bind provnet1-4-port1 fakechassis