Introduction
This document describes how to upgrade the Field Network Director (FND) Open Virtualization Appliance (OVA) docker container to a newer version.
Using FND OVA distribution with PostgreSQL comes with FND and Fog Director instances running in a Docker container. The container images contain no persistent information as that is stored on the host itself and shared with the containers.
Problem
Documentation and step by step guide to upgrade the FND/Fog Director containers is missing.
Solution
These are the steps to upgrade the containers.
Prerequisites
- Ensure that the OVA-deployed machine is a PostgreSQL-based FND OVA deployment.
Run this command from the CLI:
[root@iot-fnd ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7c32830fa5d9 fogd-image:active "/bin/sh -c '/var/ci…" 5 months ago Up 18 hours fogd-container
5251f66ef0cc fnd-image:active "/bin/sh -c /opt/fnd…" 5 months ago Up 18 hours 0.0.0.0:80->80/tcp, 0.0.0.0:162->162/udp, 0.0.0.0:443->443/tcp, 0.0.0.0:9120-9121->9120-9121/tcp, 0.0.0.0:5683->5683/udp, 0.0.0.0:61624-61626->61624-61626/udp, 0.0.0.0:9124-9125->9124-9125/tcp, 0.0.0.0:61628->61628/udp fnd-container
As you can see in the above output, two containers are running using a fogd and fnd image, which confirms that you have the correct OVA deployment to use this upgrade path.
- Ensure that the machine has internet access and DNS is configured.
In order to test this, perform a ping to a public hostname.
[root@iot-fnd ~]# ping cisco.com -c1
PING cisco.com (72.163.4.161) 56(84) bytes of data.
64 bytes from www1.cisco.com (72.163.4.161): icmp_seq=1 ttl=239 time=152 ms
--- cisco.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 152.709/152.709/152.709/0.000 ms
If this fails, most likely there is no DNS configured in /etc/resolv.conf
- In case you need a proxy to allow HTTPS traffic (as is the case for Cisco labs), you can add it in the following file:
[root@iot-fnd ~]# vi /etc/systemd/system/docker.service.d/http-proxy.conf
You have mail in /var/spool/mail/root
[root@iot-fnd ~]# cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTPS_PROXY=http://proxy.esl.cisco.com:80"
After you added this configuration, refresh the systemd-services and restart Docker:
[root@iot-fnd ~]# systemctl daemon-reload
[root@iot-fnd ~]# systemctl restart docker
Find the Version Image Tag
In order to select a version to upgrade to, the easiest way is to check the CCO Download page for FND: https://software.cisco.com/download/home/286287993/type/286320249/
As you can see, the filename contains the version number.
For example for the latest file at the time of writing: CISCO-IOTFND-VPI-K9-4.7.0-101.zip, the version number would be: 4.7.0-101
This is the image tag that needs to be provided in the next step.
Perform the Upgrade
In order to upgrade, once the prerequisites have been met, you can simply run the script in: /opt/fnd/scripts/upgrade.sh
When you run the script, first choose the option 1) Load Container Images
As credentials for devhub-docker.cisco.com, you can use these:
Username: fnd-upgrade.gen
Password (token): AKCp5fUYZxwj7geWcaEbyKShGtyNxzA3ijWzzXdhuWY7GoR5RVYru2zcAta81fcV4Jndbjq31
As the image tag, use the version number as explained earlier (for example 4.7.0-101).
Once the images are downloaded, load them with the use of option 2) Container Reload
Example output:
[root@iot-fnd ~]# /opt/fnd/scripts/upgrade.sh
This script must be run with root privileges.
Usage: Load container images: No resource required
For container reload: No resource required
1) Load container images
2) Container reload
3) Quit
Enter your choice: 1
Do you want to download docker image from registry (y/n)?y
Enter docker registry [devhub-docker.cisco.com]:
For FND Docker image upgrade you will need access to Cisco CCO docker registry.
Username: fnd-upgrade.gen
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
Enter docker image tag: 4.7.0-101
Downloading FND docker image...
4.7.0-101: Pulling from field-network-director-docker/fnd-image
f34b00c7da20: Already exists
9c542cd3c18f: Pull complete
b0929d67d1de: Pull complete
e82d75ddb5ee: Pull complete
95df7d16861d: Pull complete
184d612a5ba6: Pull complete
90d6558240a2: Pull complete
81a31ac85436: Pull complete
Digest: sha256:b7ef566386d318a2e186350077970a9b4f0019d455521c053cdd75c139f5627c
Status: Downloaded newer image for devhub-docker.cisco.com/field-network-director-docker/fnd-image:4.7.0-101
Downloading Fog Director docker image...
4.7.0-101: Pulling from fog-director-docker/fogd-image
ed6e0ec6b337: Pull complete
2c42dd52f029: Pull complete
6b4fd7880141: Pull complete
7d56b7ff004c: Pull complete
c719de3d527a: Pull complete
ccca86184ecc: Pull complete
b45dc2906bcc: Pull complete
e4f23b432923: Pull complete
Digest: sha256:39f3a30c63a06f0909337ffb9fa503d642e6c567343a04edb8f58b3a6962eced
Status: Downloaded newer image for devhub-docker.cisco.com/fog-director-docker/fogd-image:4.7.0-101
1) Load container images
2) Container reload
3) Quit
Enter your choice: 2
Stopping FND container...
fnd-container
Remove FND container...
fnd-container
Prune Docker container...
Starting FND container...
75c7d97e775d6345114ad940652ff80cbaf5dabbbf9e23e549202d6fe5e96b11
Stopping Fog Director container...
fogd-container
Remove Fog Director container...
fogd-container
Prune Docker container...
Starting Fog Director container...
1ca848a1b14155c8358eb0ff70fc7b0a55810743c531c4770f6e471e343f91ad
1) Load container images
2) Container reload
3) Quit
Enter your choice: 3
Once completed, you can check if the upgrade was successful with this command:
[root@iot-fnd ~]# docker exec -it fnd-container cat /opt/cgms/bin/version
4.7.0-101