ONOS uses several files in the the
/root/onos/config directory within the running Docker container to establish an initial configuration:
network-cfg.json- the initial
netcfgvalues, including configuration for the applications that can be established via this file
component-cfg.json- the initial component configuration options that can be set via the
cfg setcommand from the ONOS CLI
cluster.json- the cluster configuration for ONOS
NOTE: For the purposes of this guide the
cluster.json file will be ignored. There are several ways to establish a cluster in ONOS and that is outside the scope of this guide.
Establishing A Configuration Volume
The best practice for sharing file system information into a Docker container is to do so via a Docker Volume. As ONOS will be running in a Docker Swarm cluster, the node on which ONOS is executing cannot be determined as such to use a volume to configure ONOS a distributed volume should be used. By default VOLTHA installs with
glusterfs installed, so within an "installed" VOLTHA instance a glusterfs volume can be used. Docker supports many additional Volume Plugins that could be leveraged as well.
glusterfs is not used in VOLTHA via the glusterfs volume plugin, instead it is used by providing mount points on the hosts through which containers can access the distributed file system.
NOTE: while glusterfs is available on a VOLTHA cluster, the rest of this guide will use an NFS mounted volume. Installing and setting up NFS is left as an exercise for the reader as many Google pages describe how to configure NFS.
For the purpose of this guide we will create the directory structure we wish to export as
/var/onos_config and populate it with a
The local directory
/var/onos_config then needs to be exported so that it can be nfs mounted on other systems.
The first step when working with volume is making sure that the volume is available on every node in the cluster. When working with several volume plugins this involves installing and running daemon processes to manage volume across the cluster. When working with NFS you can simply create a local volume on each node in the cluster that represents an NFS mount. The following can be executed on each node in the cluster:
NOTE: the IP address,
220.127.116.11, should be the IP address of the NFS server
Configure Volume on ONOS