Run an ODL cluster on a single machine with these scripts.
Each ODL instance will run in its own docker container. Each container will mount its own
overlay mount of your netvirt/karaf/target/assembly directory. This means that (a) all three
containers share your single set of files comprising for e.g., the netvirt distribution, (b) the changes
that each container makes to these files will not be propagated back to your assembly directory,
(c) changes that each container makes are stored separately, on the host filesystem so that they
can easily be inspected. Each container's files are stored ./mounts/[1|2|3]/assembly
where
[1|2|3] corresponds to the index of each container.
Three running (and empty) netvirt containers have been observed to occupy about 1.3GB of memory each.
Currently following projects are supported:
- Netvirt
- Genius
- OVSDB Southbound
- HWVTEP Southbound
- Neutron
Script Name | Description |
---|---|
build | builds the overlay mounts for each container and the Docker image |
up | configures the dedicated docker network used by the ODL containers (if it does not already exist) and launches the containers (but does not run ODL) |
start | starts the ODL instances inside the containers |
wait-for-active | Wait for the cluster to be active |
wipe | completely deletes the docker containers |
diagstatus | Convenience script to check whether an ODL is up and running using the diagstatus URL |
shell | Convenience script to run commands or a shell on one of the containers |
karaf-client | Convenience script to run karaf commands or a karaf shell on one of the containers |
These scripts will create and configure three containers:
Name | IP | Overlay Directory |
---|---|---|
odl_172.28.5.1 | 172.28.5.1 | ./mounts/1/assembly |
odl_172.28.5.2 | 172.28.5.2 | ./mounts/2/assembly |
odl_172.28.5.3 | 172.28.5.3 | ./mounts/3/assembly |
The containers are networked together like this:
+----------------------------------------------------+
| HOST MACHINE |
| |
| +------------+ |
| | odl_ | |
| | 172.28.5.1 |----+ |
| +------------+ | |
| | |
| +------------+ | |
| | odl_ |----+--bridge: 172.28.5.254 |
| | 172.28.5.2 | | |
| +------------+ | |
| | |
| +------------+ | |
| | odl_ |----+ |
| | 172.28.5.1 | |
| +------------+ |
+----------------------------------------------------+
- You must have docker installed
- pull the fedora image,
docker pull fedora:latest
- You must have your project cloned and project/karaf fully built (but not run)
- Make sure selinux is temporarily disabled via
sudo setenforce 0
(check withsestatus | grep mode
; re-enable later withsudo setenforce 1
)
Note that all scripts must be run from the root directory of this project (where this README file is).
-
Build the overlay mounts and docker image:
./build <path to your project clone>
. For OVSDB Southbound or HWVTEP the path should be '/southbound|hwvtepsouthbound', for other projects incl. netvirt it is the ODL project's root directory (NOT karaf/ or even karaf/target/assembly).N.B. that running this script will remove and erase any mount directories from previous runs. If you want to save logs, copy them aside.
-
Launch the docker containers:
./up
To start all ODLs running simply say:
./start
Then just wait for ./wait-for-active
to exit.
However, since the initialization of ODL/karaf is extremely heavy it is best to just bring up two containers at first and only once they're up and running the third.
./start 1 2
Then wait for diagstatus to be ACTIVE (this can take a while):
./diagstatus 1
./diagstatus 2
N.B. that OVSDB projects currently don't support diagstatus, so you will have to check for OVSDB port [6640].
Only then should you
./start 3
You can enter the shell of a running container like this:
./shell 1
(or 2 or 3...you get the idea)
Execute a command on a running container:
./shell 1 ps ax
to execute a command on all three containers use the letter 'a' instead of a container index:
./shell a find --name karaf.log
./karaf-client 1
(or 2 or 3)`
./karaf-client 1 feature:list
./karaf-client a log:set DEBUG org.opendaylight.genius
To completely kill and wipe your running containers simply say "./wipe"