H3C 命令行升級說明
標籤(空格分隔): 系統部 劉季瑋 H3C CLI 升級
下文關於通過命令行升級的內容均以兩臺設備形成IRF(Intelligent Resilient Framework,智能彈性架構)的情況爲例進行介紹。
- 如果用戶升級的是單臺設備,忽略有關Standby設備的配置即可;
- 如果用戶升級的IRF中包含兩臺以上成員設備,重複有關Standby設備的配置即可,實際配置過程中,請根據實際情況修改命令行參數中的成員編號。
1.1 升級前準備
- 用戶PC通過Telnet或者Console口登錄到IRF上,具體步驟略
- 在任意視圖下,執行
display irf
命令查看IRF信息,掌握本IRF的成員設備數量,各成員設備的角色以及成員編號等信息,對於這些信息的瞭解將便於執行後續的升級操作。
<Sysname> display irf
MemberID Role Priority CPU-Mac Description
*+1 Master 5 0023-8927-afdc ---
2 Standby 1 0023-8927-af43 ---
--------------------------------------------------
* indicates the device is the master.
+ indicates the device through which the user logs in.
The Bridge MAC of the IRF is: 0023-8927-afdb
Auto upgrade : no
Mac persistent : 6 min
Domain ID : 0
通過以上信息得出IRF中有兩臺成員設備,Master設備的成員編號爲1,Standby設備的成員編號爲2。
- 在用戶視圖下,執行
dir
命令逐一查看各成員設備存儲介質的剩餘空間大小。 - 查看Master設備的存儲介質(Flash)的剩餘空間大小
<Sysname> dir
Directory of flash:
0 -rw- 80264 Aug 23 2013 00:33:57 startup.mdb
1 -rw- 3523 Aug 23 2013 00:33:56 startup.cfg
2 -rw- 9959424 Aug 23 2013 16:04:08 boot.bin
3 -rw- 53555200 Aug 23 2013 16:04:08 system.bin
4 drw- - Aug 23 2013 00:03:07 seclog
5 drw- - Aug 23 2013 00:03:07 versionInfo
6 -rw- 91273216 Aug 21 2013 09:54:27 backup.bin
1048576 KB total (897252 KB free)
- 查看Standby設備(成員編號爲2)的存儲介質(Flash)的剩餘空間大小。
<Sysname> dir slot2#flash:/
Directory of slot2#flash:/
0 -rw- 80264 Aug 23 2013 00:33:57 startup.mdb
1 -rw- 3523 Aug 23 2013 00:33:56 startup.cfg
2 -rw- 13611008 Aug 23 2013 16:04:08 boot.bin
3 -rw- 93871104 Aug 23 2013 16:04:08 system.bin
4 drw- - Aug 23 2013 00:03:07 seclog
5 drw- - Aug 23 2013 00:03:07 versionInfo
6 -rw- 91273216 Aug 21 2013 09:54:27 backup.bin n
1048576 KB total (854397 KB free)
;
1.1.2 刪除無用文件
用戶可以將各成員設備的存儲介質剩餘空間大小與待升級啓動軟件包大小進行對比,如果剩餘空間不足,可在用戶視圖下使用delete
命令刪除該設備存儲介質中的無用軟件包,釋放存儲空間(建議用戶刪除不再使用的非本次啓動使用的軟件包)。本次啓動使用的軟件包可以在任意視圖下使用display boot-loader
命令查看。
說明:爲了避免配置丟失,請不要刪除設備的當前配置文件,設備的當前配置文件可以在任意視圖下使用
display startup
命令查看。
使用delete /unreserved file-url
命令刪除軟件包,被刪除的軟件包將被徹底刪除,不能再恢復。
使用delete file-url
命令刪除軟件包,被刪除的軟件包被保存在回收站中,仍會佔用存儲空間。如果要徹底刪除回收站中的某個廢棄軟件包,請執行undelete
命令恢復回收站裏的軟件包,再使用delete /unreserved file-url
命令徹底刪除軟件包。
- 在用戶視圖下,執行
delete
命令刪除成員設備存儲介質中的無用軟件包。 - 刪除Master存儲介質中的無用軟件包。
<Sysname> delete /unreserved flash:/backup.bin
The file cannot be restored. Delete flash:/backup.bin?[Y/N]:y
Deleting the file permanently will take a long time. Please wait...
Deleting file flash:/backup.bin...Done.
- 刪除Standby存儲介質中的無用軟件包
<Sysname> delete /unreserved slot2#flash:/backup.bin
The file cannot be restored. Delete slot2#flash:/backup.bin?[Y/N]:y
Deleting the file permanently will take a long time. Please wait...
Deleting file slot2#flash:/backup.bin...Done.
###1.2 下載待升級啓動軟件包/補丁包到Master設備
說明:
在執行升級操作之前,首先要將待升級啓動軟件包/補丁包下載並保存到Master設備存儲介質(Flash)的根目錄下。如果待升級啓動軟件包/補丁包已經保存到Master設備存儲介質(Flash)的根目錄下,可略過此步。
通過命令行進行啓動軟件包/補丁包升級時,啓動軟件包和補丁包的下載方法相同。用戶可以根據所要升級的軟件類型,下載正確的待升級啓動軟件包/補丁包。此處以下載啓動軟件包(IPE文件)爲例進行介紹。
將待升級啓動軟件包下載到Master設備存儲介質的根目錄下的方法有如下幾種,用戶可以根據具體情況選擇一種方法完成下載操作:
- 以交換機作爲FTP客戶端方式完成下載
- 以交換機作爲FTP服務器方式完成下載
- 以交換機作爲TFTP客戶端方式完成下載
- 通過USB口完成下載
1.2.1 以交換機作爲FTP客戶端方式完成下載
- 在用戶PC(假設IP地址爲10.10.110.1)上運行FTP服務器程序,設置用戶名和密碼,以及工作路徑,並把待升級啓動軟件包保存在FTP服務器的工作路徑下。
- 確保用戶PC和IRF之間路由可達。
- 將待升級啓動軟件包(以newest.ipe爲例)下載到Master存儲介質的根目錄下。
在用戶視圖下,執行ftp命令並根據系統提示輸入登錄用戶名和密碼,設備將作爲FTP 客戶端登錄到FTP 服務器。
<Sysname> ftp 10.10.110.1
Trying 10.10.110.1...
Press CTRL+K to abort
Connected to 10.10.110.1
220 FTP service ready.
User(10.10.110.1:(none)):username ---輸入用戶名
331 Password required for username.
Password: ---輸入用戶密碼
230 User logged in
在FTP客戶端視圖下,執行get命令將待升級啓動軟件包從FTP服務器下載到Master存儲介質(Flash)的根目錄下。
ftp> get newest.ipe
227 Entering Passive Mode (10,10,110,1,17,97).
125 BINARY mode data connection already open, transfer starting for /newest.ipe
226 Transfer complete.
32133120 bytes received in 35 seconds (896. 0 kbyte/s)
ftp> bye
221 Server closing.
1.2.2 通過USB口完成下載
S6800系列以太網交換機帶有USB口,用戶可以在用戶視圖下,執行copy命令把移動存儲設備(此處以U盤爲例)上的待升級啓動軟件包拷貝到Master的根目錄下。
將保存有待升級啓動軟件包(以newest.ipe爲例)的U盤插入交換機的USB口。
將待升級啓動軟件包從U盤拷貝到交換機的Flash中。
<Sysname> cd usba:
<Sysname> dir
<Sysname> cd flash:/dis
<Sysname> copy usba:/newest.ipe newest.ipe
Copy usba:/newest.ipe to flash:/newest.ipe?[Y/N]:y
Start to copy usba:/newest.ipe to flash:/newest.ipe... Done
1.3 升級啓動軟件包/補丁包
用戶可以根據所要升級的軟件類型,下載正確的待升級啓動軟件包,然後選擇執行對應的升級操作。
- 升級啓動軟件包
-
安裝補丁包
1.3.1. 升級啓動軟件包
指定Master的主用下次啓動軟件包爲newest.ipe
<Sysname> boot-loader file flash:/newest.ipe slot 1 main
Verifying image file....Done.
Images in IPE:
boot.bin
system.bin
This command will set the main startup software images. Continue? [Y/N]:y
Add images to target slot.
The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 1.
逐一指定各Standby均採用與Master相同的主用下次啓動軟件包(指定完成後,系統會自動將該啓動軟件包從Master上copy到Standby的存儲介質根目錄下)
<Sysname> boot-loader file flash:/newest.ipe slot 2 main
Verifying image file....Done.
Images in IPE:
boot.bin
system.bin
This command will set the main startup software images. Continue? [Y/N]:y
Add images to target slot.
The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 1.
在系統視圖下,執行irf auto-update enable
命令使能IRF系統啓動軟件包的自動加載功能。
<Sysname> system-view
[Sysname] irf auto-update enable
[Sysname] quit
說明:
開啓IRF系統啓動軟件包的自動加載功能,後面執行reboot命令重啓IRF時,若某個Standby檢測到主用下次啓動軟件包與Master上的主用下次啓動軟件包不一致時:
該Standby自動將Master的當前主用啓動軟件包copy到自己的存儲介質根目錄下,並將該軟件包設置爲自己的下次主用啓動軟件包;同時使用該啓動軟件包重啓。
IRF系統啓動軟件包的自動加載功能主要用於新加入IRF的成員設備的軟件版本與Master的軟件版本不一致時,新的成員設備自動從Master設備下載啓動軟件包,並使用新的啓動軟件包重啓,重新加入IRF。
在任意視圖下,執行save命令保存當前配置,防止設備重啓而造成配置丟失
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait.................
Saved the current configuration to mainboard device successfully.
Slot 2:
Save next configuration file successfully.
在用戶視圖下,執行reboot命令重啓IRF,完成對啓動軟件包的升級。
說明:
指定Master和各成員設備的下次主用啓動軟件包後,需要重啓設備新的啓動軟件包才能生效。在重啓的過程中,如果啓動軟件包中的BootRom文件存在更新,系統會提示用戶是否升級BootRom基本段和BootRom擴展段。
升級BootRom文件時,爲了避免兼容性問題,建議用戶同時升級BootRom基本段和BootRom擴展段。
如果用戶選擇不升級BootRom文件,在設備斷電後重新上電、通過命令行立即重啓或通過命令行定時重啓的過程中,系統都將再次提示用戶升級BootRom文件,如果用戶沒有及時作出選擇,設備仍將默認升級完整的BootRom文件。
1.3.2 安裝補丁包
逐一激活Master和Standby上的補丁包system-patch.bin。
<Sysname> install activate patch flash:/system-patch.bin slot 1
<Sysname> install activate patch flash:/system-patch.bin slot 2
查看已激活的軟件包(此時可看到補丁包已激活)。
<Sysname> display install active
Active packages on slot 1:
flash:/boot.bin
flash:/system.bin
flash:/system-patch.bin
Active packages on slot 2:
flash:/boot.bin
flash:/system.bin
flash:/system-patch.bin
確認補丁包更改,以保證補丁包在設備下次重啓後仍然有效。
<Sysname> install commit
查看已確認更改的軟件包(此時可看到補丁包已確認更改)。
<Sysname> display install committed
Committed packages on slot 1:
flash:/boot.bin
flash:/system.bin
flash:/system-patch.bin
Committed packages on slot 2:
flash:/boot.bin
flash:/system.bin
flash:/system-patch.bin