简介
本文档介绍如何升级Cisco IOS® XR 7软件版本和使用存储库进行安装操作。
先决条件
要求
Cisco 建议您了解以下主题:
- Cisco IOS XR 软件
- Cisco IOS XR软件安装和升级过程
使用的组件
本文档不限于特定硬件版本,适用于运行IOS XR7的所有路由器。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
相关产品
IOS XR7(也称为Lindt)是XR软件在Linux 9发行版之上构建的演进版本。
一个主要更改是完全删除管理平面。此外,IOS XR控制平面进程现在在主机上本地运行。
本文档当前适用于以下硬件设备:
- Cisco 540 路由器
- 8000 系列路由器
- 思科NCS 57B1系列路由器
注:软件版本可以包含数字7,但仍代表eXR软件体系结构(例如,ASR 9000 XR 7.5.2版本不是XR7体系结构)
IOS XR7安装增强功能。
要在XR7中安装软件包(RPM)、代码升级和更新,您需要一个RPM存储库,以便路由器下载RPM进行安装。存储库可以是路由器本地存储库,也可以通过FTP、HTTP或HTTPS远程访问。
我们有一组命令,可以在不同的场景中帮我们,而且可以在XR7的所有安装活动中提供帮助。
安装替换 |
升级到新版本 |
安装源 |
在版本和可选软件包之间安装漏洞修复RPM |
install commit(安装提交) |
提交更改以持续重新加载 |
show install active |
查看活动包 |
show install committed |
查看提交的包 |
show install request |
查看安装操作的状态 |
show version |
查看当前安装版本的状态 |
当前活动的软件可在您的系统上替换为指定的ISO映像或Golden ISO(GISO)映像中的软件。升级至新软件只需要最少的一组更改。如果软件包的名称和版本相同,则不会删除并重新安装它们。
RP/0/RP0/CPU0:R0(config)# install repository local-repo | remote-repo
RP/0/RP0/CPU0:R0(config)# install package replace
RP/0/RP0/CPU0:R0# install apply {reload | restart} [noprompt]
RP/0/RP0/CPU0:R0# install commit
配置
本节介绍并展示如何在路由器中配置存储库,建议已创建HTTP/FTP服务器并且运行正常。
远程存储库
远程访问存储库时,必须提供从中获取安装文件的存储库URL。该URL包含:
-
服务器的IP地址
-
服务器的端口号
-
(可选)虚拟路由和转发(VRF)名称
可以使用非默认VRF表将存储库配置为可访问。如果通过VRF中的地址可以访问存储库,请指定VRF的名称。
存储库URL的格式如下:
- FTP:ftp://<server>[;<vrf>]/<path-to-repository>
- HTTP: http://<server>[;<vrf>]/<path-to-repository>
- HTTPS:https://<server>[;<vrf>]/<path-to-repository>
- 本地:file:///<path-to-repository>。存储库的路径必须位于/harddisk:/位置下。
在路由器中配置远程存储库。
RP/0/RP0/CPU0:R0# configure
RP/0/RP0/CPU0:R0(config)# install repository remote_repo url http://192.168.122.1/
RP/0/RP0/CPU0:R0(config)# commit
RP/0/RP0/CPU0:R0(config)# end
RP/0/RP0/CPU0:R0#
如前所述,必须提供用于获取安装文件的存储库URL。
- 验证我们的远程存储库或以前配置的任何存储库中可用的修补程序。
RP/0/RP0/CPU0:R0#sh install fixes available
Wed Jan 31 22:32:39.477 UTC
Trying to access repositories...
Available Fixes (count: 1):
Bug Id Packages Repository Cached
----------- ----------------------------------------------------------- ---------------------------------------- ------
CSCvz57398 xr-ospf-7.3.2v1.0.1-1 remote_repo
安装操作
RP/0/RP0/CPU0:R0#install package upgrade xr-ospf-7.3.2v1.0.1-1 synchronous
Wed Jan 31 22:34:16.220 UTC
Starting:
install package upgrade xr-ospf-7.3.2v1.0.1-1
Packaging operation 1.1.1
Press Ctrl-C to return to the exec prompt. This will not cancel the install operation
Current activity: Initializing ...
Current activity: Veto check ..
Current activity: Package add or other package operation ..
Packaging operation 1.1.1: 'install package upgrade xr-ospf-7.3.2v1.0.1-1' completed without error
远程存储库可显示路由器请求某些文件的部分日志。在本例中,HTTP服务器显示了一些HTTP成功请求。
成功请求的HTTP服务器日志
使配置生效。
RP/0/RP0/CPU0:R0#sh install fixes active
Wed Jan 31 22:39:54.987 UTC
There are currently no fixes active.
RP/0/RP0/CPU0:R0#install apply
Wed Jan 31 22:40:16.628 UTC
Once the packaging dependencies have been determined, the install operation may have to reload the system.
If you want more control of the operation, then explicitly use 'install apply restart' or 'install apply reload' as reported by 'show install request'.
Continue? [yes/no]:[yes] yes
Install apply operation 1.1 has started
Install operation will continue in the background
使用show install request
命令,可以监控安装进度。第二次运行该命令时,安装请求已完成。
RP/0/RP0/CPU0:R0#sh install request
Wed Jan 31 22:41:07.649 UTC
User request: install apply restart
Operation ID: 1.1
State: In progress since 2024-01-31 22:40:19 UTC
Current activity: Apply by restarting processes
Next activity: Await user input
Time started: 2024-01-31 22:40:19
No per-location information.
RP/0/RP0/CPU0:R0#sh install request
Wed Jan 31 22:43:51.577 UTC
User request: install apply restart
Operation ID: 1.1
State: Success since 2024-01-31 22:41:10 UTC <<<<
Current activity: Await user input
Time started: 2024-01-31 22:41:10
此时,修复处于活动状态,但不持久。
RP/0/RP0/CPU0:R0#sh install fixes active
Wed Jan 31 22:46:33.940 UTC
Active Fixes (count: 1):
Bug Id Packages
----------- -----------------------------------------------------------
CSCvz57398 xr-ospf-7.3.2v1.0.1-1
Install Commit(安装提交)
此时,提交安装并收到0个错误后,安装即告结束。
RP/0/RP0/CPU0:R0#install commit synchronous
Wed Jan 31 22:47:38.676 UTC
Starting:
install commit
Transaction 1
Press Ctrl-C to return to the exec prompt. This will not cancel the install operation
Current activity: Initializing
Current activity: Commit transaction .
Transaction 1: 'install commit' completed without error
RP/0/RP0/CPU0:R0#
本地存储库
路由器可以用作托管RPM的存储库。您必须是有权访问路由器外壳的root-lr用户。远程存储库是访问RPM的推荐方法。但是,如果远程存储库不是您的首选选项,则您可以将路由器用作存储库来托管RPM。
本地存储库方法与远程存储库几乎相同,但在开始阶段略有差异。
先决条件
软件包需要位于硬盘中,才能将其添加到我们的存储库。
例如,下一个TAR文件:
RP/0/RP0/CPU0:R0#dir harddisk:
Wed Jan 31 23:07:15.476 UTC
Directory of harddisk:
12 -rw-rw-rw-. 1 8388681 Jan 31 22:55 nvgen_bkup.log
2097153 drwxrwxrwx. 2 4096 Jan 31 22:19 .sppdc
524289 drwxrwxrwx. 3 4096 Oct 18 2021 mirror
2228225 drwxrwxrwx. 2 4096 Oct 18 2021 .sppdc_new
3932161 drwxrwxrwx. 3 4096 Oct 18 2021 ztp
3276801 drwxr-xr-x. 3 4096 Jun 16 2022 pam
13 -rw-rw-rw-. 1 600 Jan 31 22:18 debug_shell_client.log
3407873 drwxrwxrwx. 2 4096 Oct 18 2021 shutdown
1835009 drwxrwxrwx. 2 4096 Oct 18 2021 nvram
14 -rw-r--r--. 1 911360 Jan 31 23:06 8000-optional-rpms.7.3.2.tar <<<<<<<
262145 drwxr-xr-x. 2 4096 Jun 16 2022 showtech
11 drwx------. 2 16384 Oct 18 2021 lost+found
655361 drwx------. 3 4096 Jan 31 22:20 ima
15 -rw-rw-rw-. 1 2 Jan 31 22:25 feature_list
786433 drwxrwxrwx. 2 4096 Jun 16 2022 dumper
1048577 drwxrwxrwx. 5 4096 Jan 31 22:24 cisco_support
3145729 drwxrwxrwx. 2 4096 Jan 31 22:18 npu_sdk_logs
65908476 kbytes total (62474792 kbytes free)
RP/0/RP0/CPU0:R0#
建议解压缩路由器外壳中的文件。
RP/0/RP0/CPU0:R0#run
Wed Jan 31 23:08:20.380 UTC
[node0_RP0_CPU0:/]$cd harddisk\:
[node0_RP0_CPU0:/harddisk:]$tar -xvf 8000-optional-rpms.7.3.2.tar
配置本地存储库
RP/0/RP0/CPU0:R0# configure
RP/0/RP0/CPU0:R0(config)# install repository local-repo url file:///harddisk:/optional-rpms
RP/0/RP0/CPU0:R0(config)# commit
RP/0/RP0/CPU0:R0(config)# end
RP/0/RP0/CPU0:R0#
验证已添加到本地存储库的包
RP/0/RP0/CPU0:R0#sh install available
Wed Jan 31 23:14:52.788 UTC
Trying to access repositories...
Package Architecture Version Repository Cached
---------------------------------------------------- ---------------- --------------------------- ----------------------------------- ------
xr-cdp x86_64 7.3.2v1.0.0-1 local-repo
xr-healthcheck x86_64 7.3.2v1.0.0-1 local-repo
xr-telnet x86_64 7.3.2v1.0.0-1 local-repo
RP/0/RP0/CPU0:R0#
安装操作
为了在此时安装和验证与远程存储库选项中的过程完全相同,我们可以尝试安装其中的任何软件包,例如telnet one。
RP/0/RP0/CPU0:R0#install source local-repo xr-telnet
Wed Jan 31 23:20:28.252 UTC
Once the packaging dependencies have been determined, the install operation may have to reload the system.
If you want to control the timing of system reload, you must not continue, but use the 'install package add' command instead, followed by 'install apply'.
Continue? [yes/no]:[yes] yes
Install source operation 3.1 has started
Install operation will continue in the background
RP/0/RP0/CPU0:R0#sh install request
Wed Jan 31 23:24:45.907 UTC
User request: install source local-repo xr-telnet
Operation ID: 3.1
State: Success since 2024-01-31 23:22:58 UTC
使配置生效并提交安装
与在远程方法中一样,我们需要运行install apply
,以使配置有效install commit
,并使安装持续进行。使用下一命令检验软件包的正确安装
RP/0/RP0/CPU0:R0#sh install committed summary
Wed Jan 31 23:28:15.923 UTC
Committed Packages: XR: 181 All: 1283
Label: 7.3.2
Software Hash: bfe1bf8477ebb422e0eaf5c23358fcb1
Optional Packages Version
---------------------------------------------------- ---------------------------
xr-8000-mcast 7.3.2v1.0.0-1
xr-8000-netflow 7.3.2v1.0.0-1
xr-bgp 7.3.2v1.0.0-1
xr-ipsla 7.3.2v1.0.0-1
xr-is-is 7.3.2v1.0.0-1
xr-lldp 7.3.2v1.0.0-1
xr-mcast 7.3.2v1.0.0-1
xr-mpls-oam 7.3.2v1.0.0-1
xr-netflow 7.3.2v1.0.0-1
xr-ospf 7.3.2v1.0.0-1
xr-perfmgmt 7.3.2v1.0.0-1
xr-telnet 7.3.2v1.0.0-1 <<<<<<
xr-track 7.3.2v1.0.0-1
RP/0/RP0/CPU0:R0#