简介
本文档介绍如何将Field Network Director(FND)Open Virtualization Appliance(OVA)docker容器升级到更新版本。
将FND OVA分发与PostgreSQL配合使用时,FND和Fog Director实例在Docker容器中运行。容器映像不包含存储在主机本身并与容器共享的永久信息。
问题
缺少用于升级FND/Fog Director容器的文档和分步指南。
解决方案
以下是升级容器的步骤。
先决条件
- 确保OVA部署的计算机是基于PostgreSQL的FND OVA部署。
从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
如上输出所示,两个容器正在使用fogd和fnd映像运行,这确认您有正确的OVA部署来使用此升级路径。
- 确保计算机具有互联网访问权限且已配置DNS。
为了测试此项,请对公共主机名执行ping操作。
[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
如果此操作失败,很可能/etc/resolv.conf中未配置DNS。
- 如果需要代理来允许HTTPS流量(如思科实验),可将其添加到以下文件:
[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"
添加此配置后,请刷新systemd-services并重新启动Docker:
[root@iot-fnd ~]# systemctl daemon-reload
[root@iot-fnd ~]# systemctl restart docker
查找版本映像标签
要选择要升级到的版本,最简单的方法是检查FND的CCO下载页:https://software.cisco.com/download/home/286287993/type/286320249/
如您所见,文件名包含版本号。
例如,对于写入时的最新文件CISCO-IOTFND-VPI-K9-4.7.0-101.zip,版本号为:4.7.0-101
这是下一步需要提供的映像标签。
执行升级
要升级,在满足先决条件后,您只需在以下位置运行该脚本:/opt/fnd/scripts/upgrade.sh
运行脚本时,首先选择选项1)加载容器映像
作为devhub-docker.cisco.com的凭据,您可以使用以下:
username:fnd-upgrade.gen
密码(令牌):AKCp5fUYZxwj7geWcaEbyKShGtyNxzA3ijWzzXdhuWY7GoR5RVYru2zcAta81fcV4Jndbjq31
作为映像标签,请使用前面介绍的版本号(例如4.7.0-101)。
下载映像后,使用选项2)容器重新加载加载映像
示例输出:
[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
完成后,您可以使用以下命令检查升级是否成功:
[root@iot-fnd ~]# docker exec -it fnd-container cat /opt/cgms/bin/version
4.7.0-101