Getting Started
This page describes commands required to install, start and monitor the application on Cat9K.
Install, Activate and Start App
IOS CLI commands which "must" be followed in the given order:
- Copy application tarball to flash on Cat9k. If you don't have App tarball, refer Docker App Development. When install command is executed, App tarball is extracted.
cat9k# app-hosting install appid MYAPP package flash:myapp.tar
MYAPP installed successfully
Current state is: DEPLOYED
Basic Configuration for App networking is needed before App is activated. The detailed networking config and different scenarios, refer to Application Hosting Configuration.
interface AppGigabitEthernet 1/0/1
swithport mode trunk
app-hosting appid MYAPP
app-vnic AppGigabitEthernet trunk
guest-interface <guest-interface-number>
- During activation, cpu/memory/disk resources are allocated, rootfs, /data persistent dir and app volumes mounted. For activating App execute following commands:
cat9k# app-hosting activate appid MYAPP
MYAPP activated successfully
Current state is: ACTIVATED
- During start, App is booted up executing startup target.
cat9k# app-hosting start appid MYAPP
MYAPP started successfully
Current state is: RUNNING
Note: the above commands might take several minutes to complete depending upon various factors like Speed of the USB Flash Disk, switch/Router activity load. Boot-up time of the application
- Check App Status
This command shows the application operational state. ``` cat9k# show app-hosting list App id State
MYAPP RUNNING
- **Check App Resources**
This command shows the resources allocated to the given appid.
The app MYAPP docker resources such as system memory, vcpus, cpu resources, etc are shown below.
cat9k# show app-hosting detail appid MYAPP State : RUNNING Author : Cisco Application Type : docker App id : MYAPP Name : MYAPP-docker Version : 1.0.0 Activated profile name : custom Description : Cisco IOx Docker Resource reservation Memory : 2048 MB Disk : 10 MB CPU : 7400 units VCPU : 2 Attached devices Type Name Alias
Serial/shell Serial/aux Serial/Syslog serial2 Serial/Trace serial3
Network interfaces
eth0: MAC address : 52:54:dd:be:a5:7f IPv4 address : 172.19.198.83
# Connect to App
- To Connect to App Session (Ex. MYAPP) that does not have any login authentication:
cat9k# app-hosting connect appid MYAPP session sh-4.2# sh-4.2# uname -a Linux ce886678ce85 4.4.172 #1 SMP Sat Apr 6 15:21:46 PDT 2019 x86_64 x86_64 x86_64 GNU/Linux
- To Connect to App console
It requires login authentication
NOTE: to exit MYAPP's console mode, use "^c^c^c".
cat9k# app-hosting connect appid MYAPP console Connected to appliance. Exit using ^c^c^c
CentOS Linux 7 (Core) Kernel 4.4.86 on an x86_64
CAT9K_1_RP_0 login: root Password: cisco Last login: Tue Oct 31 23:29:44 on ttyS0 [root@CAT9K_1_RP_0 ~]#
# Transferring Files between App and Host (Catalyst 9000)
Before Starting the app, if there is data or config files needs to be updated for app to start, following CLI will be used. This will copy data inside application container in /data directory.
app-hosting data appid MYAPP copy <sourcepath> <destination path in container>
- ** Transferring logs and cores from App **
To move logs and core file from applications, following commands are used:
app-hosting move appid MYAPP core
app-hosting move appid MYAPP log
# Stop, Deactivate and Uninstall App
The following sequence order must be followed:
- The stop command, stops App execution and moves in "shutdown" state, but cpu/memory/disk resources still allocated and rootfs, volume mounts and changes remain persistent
app-hosting stop appid MYAPP
- When deactivated, App removed with cpu/memory/disk resources all released, but rootfs files, volume mounts and changes remain persistent
app-hosting deactivate appid MYAPP
- When uninstalled, App image completely removed and all rootfs files, volume mounts and persistent changes are lost
app-hosting uninstall appid MYAPP
NOTE: If there are "any" app-hosting configuration changes for a given app, the app must cycle through the "activate" command for the changes to take effect. In other words if the app is in a start/running state and an app-hosting configuration change is made, the app must "stop" and "deactivate" first, then restarted by using the "activate" and "start" commands.
# IOS CLI and Docker Commands
Following table describes the IOS CLI which are equivalent to Docker commands.
| IOS CLI | Docker Commands |
|-----------------------------------------------------|-----------------------|
| app-hosting connect appid MYAPP session | docker exec /bin/sh |
| app-hosting data appid MYAPP copy | docker cp |
| app-hosting activate appid MYAPP | docker create |
| app-hosting connect appid MYAPP session CMD | docker exec |
| app-hosting install appid MYAPP package <MYAPP.tar> | docker load |
| app-hosting move appid MYAPP log | docker logs |
| show app-hosting list | docker ps |
| app-hosting deactivate appid MYAPP | docker rm |
| app-hosting uninstall appid MYAPP | docker rmi |
| app-hosting start appid MYAPP | docker start |
| show app-hosting detail appid MYAPP | docker stats |
| app-hosting stop appid MYAPP | docker stop |