H3C 交換機升級說明

H3C 命令行升級說明

下文關於通過命令行升級的內容均以兩台設備形成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客戶端方式完成下載

  1. 在用戶PC(假設IP地址為10.10.110.1)上運行FTP伺服器程式,設置用戶名和密碼,以及工作路徑,並把待升級啟動軟體包保存在FTP伺服器的工作路徑下。
  2. 確保用戶PC和IRF之間路由可達。
  3. 將待升級啟動軟體包(以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