...
The admin tools are available for download as a compressed tar from Maven central or from Google drive. The onos-admin-<version>.tar.gz
file can be unrolled at a desired location on the machine(s) from which the ONOS cluster will be remotely administered. The PATH environment variable should be set to include the ONOS admin tools directory, e.g:
Code Block | ||
---|---|---|
| ||
# This is just an example; use actual path where you unpacked the tools export PATH=$PATH:~/onos-admin-1.12.1-SNAPSHOT/ |
...
To simplify the remote administration it is recommended to capture the details about the ONOS cluster being managed by creating a file that will hold definitions of the ONOS cluster instances:
Code Block | ||
---|---|---|
| ||
# IP addresses of the ONOS cluster nodes export OC1=10.192.19.101 export OC2=10.192.19.102 export OC3=10.192.19.103 export OC4=10.192.19.104 export OC5=10.192.19.105 # Provide a list of all ONOS instances using the above variables export ONOS_INSTANCES=“$OC1 $OC2 $OC3 $OC4 $OC5" # Optionally export ONOS web user/password if non-default ones are used export ONOS_WEB_USER=onos export ONOS_WEB_PASS=rocks |
...
Then to set the environment to point to that ONOS pod, simply source in the file, e.g.:
Code Block | ||
---|---|---|
| ||
$ source ~/pod42 # source in pod42 from home directory |
After this, and after exporting the PATH
environment variable as indicated above, you should be able to type in the following commands to manage the cluster, e.g.:
Code Block | ||
---|---|---|
| ||
$ onos # CLI to the first instance $OC1 $ onos 3 # CLI to the third instance $OC3 $ onos ipaddress # CLI to the ONOS at the given IP $ onos 2 summary # execute “summary” CLI on 2nd instance $OC2 $ onos-diagnostics # collect ONOS diagnostics on the entire cluster ... |
...
To configure passwordless CLI access, the operator must run onos-user-key
tool as follows from each machine in the cluster. This tool is available under the ONOS bin
directory.
Code Block | ||
---|---|---|
| ||
# Usage$ is onos-user-key username key, e.g. onos-user-key onos AAAAB3NzaC1yc2EAAAADAQABAAABAQC4pL/Jzlm/jq7ltDVIb4CEIUXxYEK... |
Similarly, it is recommended to change the default username and password for the REST API using onos-user-password
tool on each ONOS cluster node as follows:
Code Block | |||
---|---|---|---|
| |||
$# Usage is onos-user-password username password onos-user-password onos superSecretPasswordonos superSecretPassword |
By configuring the ONOS cluster in this manner, not only it will become more secure, it will also become more convenient to manage using automated tools without having to enter credentials each time.
...
Since the tools contacts all ONOS node cluster instances, it needs to know the IP addresses of those machines. To avoid having to specify these IP addresses as part of the command, you can export the ONOS_INSTANCES environment variable to specify the addresses as a space-separated list. Here’s an example of how to set the variable:
Code Block | |||
---|---|---|---|
| |||
# The list of IP addresses is given as a space separated list
$ export ONOS_INSTANCES="10.192.19.111 10.192.19.112 10.192.19.113" |
...
Once enabled, the onos-diagnostics tool can be run as follows:
Code Block | ||
---|---|---|
| ||
$ onos-diagnostics |
There is an option that allows for naming the resulting archive file for differentiation between different cluster instances, e.g.
Code Block | ||
---|---|---|
| ||
# This will produce archive file /tmp/delta-pod-diags.tar.gz $ onos-diagnostics -n delta-pod |
...
The following is the usage help for the onos-diagnostics tool:
Code Block | ||
---|---|---|
| ||
usage: onos-diagnostics [-x] [-n name] [-u user] [-p password] [ip1 ip2...] Environment Variables: ONOS_INSTANCES IPs or hostnames of ONOS cluster machines ONOS_WEB_USER username for REST API ONOS_WEB_PASS password for REST API Example Usages: # Collect compressed diagnostics for the cluster. # REST API user and password are drawn from environment variables. # Collection archive will be named /tmp/onos-diags.tar.gz # The cluster node IPs will be drawn from ONOS_INSTANCES variable. $ onos-diagnostics # Collect diagnostics for the cluster and leave them extracted. # Collection directory will be named /tmp/prague-diags/ # Collection archive will be named /tmp/prague-diags.tar.gz. # REST API user name is 'onos' and password is 'rules'. # The cluster node IPs will be drawn from ONOS_INSTANCES variable. $ onos-diagnostics -x -n prague -u onos -p rules # Collect compressed diagnostics for a cluster. # REST API user name is 'onos' and password is 'rules'. # Collection archive will be named /tmp/onos-diags.tar.gz # The cluster node IPs are listed explicitly. $ onos-diagnostics -u onos -p rules 172.17.0.11 172.17.0.12 172.17.0.1 |
...
The simplest way to run the tool is from the root of the directory produced by unrolling the ONOS diagnostics archive, which is where the node-level directories are. For example, to stitch and filter the logs to only focus on the specific duration of output, you could do the following:
Code Block | ||
---|---|---|
| ||
$ onos-log-query -x -f "2018-04-25 13:04:30" -t "2018-04-25 13:10:00" -n anomaly |
...
The following is the usage:
Code Block | ||
---|---|---|
| ||
usage: onos-app [options] <node-ip> list onos-app [options] <node-ip> {install|install!} <app-file> onos-app [options] <node-ip> {reinstall|reinstall!} [<app-name>] <app-file> onos-app [options] <node-ip> {activate|deactivate|uninstall} <app-name> options: [-P port] [-u user] [-p password] [-v] |
For example, to upload a super duper ONOS app, whose binaries are located locally in a file ~/onos/apps/super-duper-6.28.oar
file, to the ONOS cluster through one of its instances at 10.45.32.69
, you would use the following command:
Code Block | ||
---|---|---|
| ||
$ onos-app 10.45.32.69 install! ~/onos/apps/super-duper-6.28.oar |
...
For example, to upload, compile and register some-funky-model.yang
file, one could do the following:
Code Block | ||
---|---|---|
| ||
$ onos-compile-yang 10.45.32.69 ~/models/some-funky-model.yang |
Notice that the ONOS cluster does not need to be rebuilt, stopped or reconfigured in any way. Once can simply dynamically add and remove YANG models at will.
onos
...
The onos command is simply a convenience wrapper that allows the administrator to securely open the ssh session to any of the ONOS cluster nodes. As with all the admin commands, one can use either the DNS name, IP address or a numeric index of the ONOS node - provided the OC# environment variables have been properly setup. The following are examples of usage:
Code Block | ||
---|---|---|
| ||
$ onos 1 summary # Invoke summary command on the first ONOS instance
$ onos 10.45.32.69 # Open interactive CLI session on the ONOS instance at the specified IP
Welcome to Open Network Operating System (ONOS)!
____ _ ______ ____
/ __ \/ |/ / __ \/ __/
/ /_/ / / /_/ /\ \
\____/_/|_/\____/___/
Documentation: wiki.onosproject.org
Tutorials: tutorials.onosproject.org
Mailing lists: lists.onosproject.org
Come help out! Find out how at: contribute.onosproject.org
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown ONOS.
onos> |
onos-cfg
......
onos-netcfg
...