Professional Documents
Culture Documents
0
System Administration Guide
Version 1.0
Table of Contents
INTRODUCTION ................................................................................................................................................ 3
CHECKING THE CSM CONTAINER STATUS ......................................................................................................... 3
CHECKING THE CSM SUPERVISOR SERVICE STATUS .......................................................................................... 3
CSM SUPERVISOR CONTAINER API ................................................................................................................... 4
RESTARTING THE CSM SERVER CONTAINER ...................................................................................................... 5
STOPPING THE CSM SERVER CONTAINER ......................................................................................................... 5
STARTING THE CSM SERVER CONTAINER .......................................................................................................... 6
CSM SERVER BASIC CONFIGURATION ............................................................................................................... 6
CHANGING THE DEFAULT WEB FRONTEND PORT......................................................................................................... 7
ENABLING SSL.................................................................................................................................................. 7
MOUNTING LOCAL FOLDERS FOR CSM SERVER ......................................................................................................... 8
CONFIGURING PROXY ....................................................................................................................................... 9
CHECKING THE SYSTEM LOGS ......................................................................................................................... 10
CSM SERVER OFFLINE UPGRADE STEPS........................................................................................................... 10
1. STOP THE CSM-SUPERVISOR SERVICE ........................................................................................................... 10
2. STOP AND REMOVE ALL CSM DOCKER CONTAINERS ....................................................................................... 11
3. REMOVE CSM DOCKER IMAGES ................................................................................................................ 11
4. COPY THE NEW CSM PACKAGE TO THE LINUX HOST AND EXTRACT THE CONTENT .................................................. 11
5. LOAD NEW CSM DOCKER IMAGES ............................................................................................................. 12
6. COPY NEW JOSN CONFIGURATION FILES INTO PROPER LOCATIONS .................................................................... 12
7. RESTART THE CSM-SUPERVISOR SERVICE ...................................................................................................... 12
Introduction
This document provides description of basic administration operation for Cisco Software
Manager Server 4.0. The CSM 4.0 is a web-based application running in Docker
environment. The overall CSM application consists of three major components:
• CSM Supervisor
• CSM Database
• CSM Server
The installation script, described in the Installation Guide, also installs the systemd service
instantiating the CSM Supervisor docker container.
The CSM Supervisor container is required to maintain the other containers, restart them,
upgrade, and change the configuration. For the rest of the document it is assumed that CSM
Supervisor container is up and running,
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
0785f0511ce7 containers.cisco.com/spnscsm/qemux86-64-csm-server "/bin/entry.sh run.sh" 43 minutes
ago Up 43 minutes csm-server
36f30ef7fd2a containers.cisco.com/spnscsm/amd64-csm-supervisor "python3 -m csmcloud" 21 hours
ago Up 4 seconds csm-supervisor
01066d2795e5 containers.cisco.com/spnscsm/amd64-csm-db "/usr/bin/entry.sh" 5 days ago
Up 3 hours csm-database
$
$ docker ps
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS NAMES
0785f0511ce7 containers.cisco.com/spnscsm/qemux86-64-csm-server "/bin/entry.sh
run.sh" 5 hours ago Up 5 hours csm-server
01066d2795e5 containers.cisco.com/spnscsm/amd64-csm-db
"/usr/bin/entry.sh" 5 days ago Up 7 hours csm-
database
$
The CSM Supervisor container is not running however CSM Server and CSM Database
containers are still operating. This is intended and allows upgrading the CSM Supervisor
without interrupting the CSM Server functionality.
It is known that CSM Supervisor service does not automatically restart by systemd after
Docker is updated. According to Docker docs (https://docs.docker.com/config/containers/live-
restore/), By default, when the Docker daemon terminates, it shuts down running containers.
When this occurs, please manually start the CSM Supervisor service which will restart the
other containers such as CSM Server and CSM Database.
If you use the HTTP proxy, make sure that no_proxy environment variable also contains
172.33.32.2 IP address, otherwise the Supervisor API will not be reachable.
$ export no_proxy=$no_proxy,172.33.32.2
Now the status shows that the csm-server container is up for few seconds which mean has
been recently restarted:
$ docker ps
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS NAMES
0f2314ab0357 containers.cisco.com/spnscsm/qemux86-64-csm-server "/bin/entry.sh
run.sh" 2 seconds ago Up 1 second csm-server
36f30ef7fd2a containers.cisco.com/spnscsm/amd64-csm-supervisor "python3 -m
csmcloud" 26 hours ago Up 18 minutes csm-supervisor
01066d2795e5 containers.cisco.com/spnscsm/amd64-csm-db
"/usr/bin/entry.sh" 5 days ago Up 7 hours csm-
database
$
Please make sure there are no pending installation jobs before restarting the CSM Server
container.
$ curl -s http://172.33.32.2/csm/info | jq
{
"result": "ok",
"data": {
"version": "4.0.0-dev.56",
"last_version": "4.0.0-dev.56",
"machine": "qemux86-64",
"image": "containers.cisco.com/spnscsm/qemux86-64-csm-server",
"custom": false,
"boot": true,
"port": 5000,
"ssl": false,
"watchdog": true,
"wait_boot": 120,
"in_progress": false,
"volumes": {}
}
}
$
This output shows the current CSM Server container version and last available version for
upgrade. Moreover, there is information about several configuration options that can be
changed.
Changing the default web frontend port
Administrator can change the default port for the web frontend port by issuing the following
command:
$ curl -s http://172.33.32.2/csm/info | jq
{
"result": "ok",
"data": {
"version": "4.0.0-dev.56",
"last_version": "4.0.0-dev.56",
"machine": "qemux86-64",
"image": "containers.cisco.com/spnscsm/qemux86-64-csm-server",
"custom": false,
"boot": true,
"port": 5001,
"ssl": false,
"watchdog": true,
"wait_boot": 120,
"in_progress": false
}
}
$
The port configuration is changed to 5001 and then the CSM Server container must restarted
(see earlier in the document how to restart CSM Server container with REST API) to apply
this change.
Enabling SSL
To be able to use the SSL certificate two files must be uploaded to the /usr/share/csm/ssl
directory on the host server:
certificate.pem
key.pem
Please make sure that the exact filenames are used for the certificate and private key.
Then the CSM Server container must be reconfigured to use SSL certificate for web frontend.
The last step is to restart the CSM Server container using REST API (see earlier in the
document how to restart CSM Server container).
In some cases, specific host local folders should be accessible by the CSM Server. For
example, the TFTP repository may be mounted on the host server using any network file
system, i.e. NFS) and used by the TFTP local repository to allow the user to browse the
packages.
Let’s assume the local directory on the host is /mnt/tftp and it should be accessible inside the
CSM Server container with the same path.
$ curl -s http://172.33.32.2/csm/info | jq
{
"result": "ok",
"data": {
"version": "4.0.0",
"last_version": "4.0.0",
"machine": "qemux86-64",
"image": "devhub-docker.cisco.com/csm-docker/qemux86-64-csm-server",
"custom": false,
"boot": true,
"port": 5000,
"ssl": false,
"watchdog": true,
"wait_boot": 120,
"in_progress": false,
"volumes": {}
}
}
The volumes key has empty dictionary value which means there are no local folders mounted.
To make the local /mnt/tftp path accessible by the CSM Server the following command must
be issues:
Configuring PROXY
CSM Server requires Internet connection to be able to download the information about latest
packages and SMUs and the information about the latest version available for self-upgrade.
For the servers located behind the corporate proxy the HTTPS proxy setting is needed.
If the CSM Server was installed from the installation script in the Installation Guide there is
detailed description on how to setup a Proxy.
$ cat /etc/csm.json
{
"api_key": "AKCp5bBCwQFwXvfnC83HVsJVM77qedNm5m9bSsMGjhEVVFxtzjFuJa4us8ji6R8FUJF99yMrK",
"api_user": "csmserver.gen",
"csm_registry": "https://devhub-docker.cisco.com",
"supervisor": "devhub-docker.cisco.com/csm-docker/amd64-csm-supervisor",
"server": "devhub-docker.cisco.com/csm-docker/qemux86-64-csm-server",
"database": "devhub-docker.cisco.com/csm-docker/amd64-csm-db",
"channel": "stable",
"data": "/usr/share/csm"
}
$
To setup or change the proxy settings for CSM Server edit this file and add/modify the
following keys:
After adding/modifying those keys the existing containers should be removed and CSM
Server restarted.
cisco@netbrain:~$ docker ps -a | grep csm | awk '{print $1}' | xargs docker stop
b3f9fc0cb959
e7b08dc7ba80
7a2021f47379
cisco@netbrain:~/4.0.3$ docker ps -a | grep csm | awk '{print $1}' | xargs sudo docker rm
b3f9fc0cb959
e7b08dc7ba80
7a2021f47379
4. Copy the New CSM Package to the Linux Host and Extract the Content
Please copy the new CSM tar file to the Linux host with a USB stick or other methods. For
example,
Please step into the sub-directory and locate all the new Docker images and JSON
configuration files.
cisco@netbrain:~$ cd 4.0.3
cisco@netbrain:~/4.0.3$ ls -tl
total 635892
-rw-r--r-- 1 cisco cisco 88 Feb 28 23:07 updater.json
-rw-r--r-- 1 cisco cisco 562 Feb 28 23:07 csm.json
-rw------- 1 cisco cisco 169412096 Feb 28 22:28 amd64-csm-db.docker
-rw------- 1 cisco cisco 187491328 Feb 28 22:18 amd64-csm-supervisor.docker
-rw------- 1 cisco cisco 294225408 Feb 28 22:13 qemux86-64-csm-server.docker
cisco@netbrain:~/4.0.3$ l=`ls *.docker`; for f in $l; do sudo docker load < $f; done
Loaded image: devhub-docker.cisco.com/csm-docker/amd64-csm-db:1
Loaded image: devhub-docker.cisco.com/csm-docker/amd64-csm-db:latest
Loaded image: devhub-docker.cisco.com/csm-docker/amd64-csm-supervisor:20
Loaded image: devhub-docker.cisco.com/csm-docker/amd64-csm-supervisor:latest
Loaded image: devhub-docker.cisco.com/csm-docker/qemux86-64-csm-server:4.0.3
Loaded image: devhub-docker.cisco.com/csm-docker/qemux86-64-csm-server:latest