簡介
本文檔介紹Cisco IOS® XR 7軟件版本的升級和使用儲存庫的安裝操作。
必要條件
需求
思科建議您瞭解以下主題:
- Cisco IOS XR軟體
- Cisco IOS XR軟體安裝和升級程式
採用元件
本文檔不限於特定硬體版本,適用於運行IOS XR7的所有路由器。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
相關產品
IOS XR7(也稱為Lindt)是XR軟體在Linux 9發行版之上構建的演化版本。
一個重大變化是完全刪除了管理平面。此外,IOS XR控制平面進程現在在主機上本機運行。
本檔案目前適用於以下硬體裝置:
- 思科540路由器
- 8000系列路由器
- Cisco 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 |
檢視安裝操作的狀態 |
顯示版本 |
檢視當前安裝版本的狀態 |
系統上的當前活動軟體可以用指定的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>]/<路徑 — 儲存庫>
- 本地:file:///<路徑到儲存庫>。儲存庫的路徑必須位於/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的儲存庫。您必須是有權訪問路由器shell的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
,並使安裝持久。使用next命令驗證程序包的正確安裝
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#