Sunday, July 7, 2024

[Nexus] Khắc phục Cisco NXOS lỗi vào mode loader

-

Khi bạn thực hiện nâng cấp NX-OS trên nexus có lỗi xảy ra, hoặc khi bạn xóa config mà không cập nhật boot dẫn tới lỗi như sau, sau khi reload thiết bị nó sẽ đưa bạn vào mode loader> như dưới.

...Loader Version pr-1.3
loader>

Switch đã không khởi động vào image, vậy làm như nào để boot vào image.

1. Trường hợp trong có image trong bootflash.

Đầu tiên hãy xem qua một số lệnh trong mode loader>

loader> ?
?               Print the command list
boot            Boot an image
bootmode                set bootmode
dir             List the directory contents or specific file
help            Print the command list or the specific command usage
reboot          Reboot the system
resetbioscmos           Reset bios info to factory defaults
resetcmos       Reset CMOS to factory defaults
serial          Serial console settings
set             Set network configuration
show            Show loader configuration

Mình sử dụng lênh dir để list các file có trong bootflash, ở đây mình nhìn thấy có file image tên là nxos.7.0.3.I7.3.bin, mình sử dụng file này để boot vào os.

loader> dir
bootflash:
  logflash
  sprom_3_0_0
  sprom_2_0_1
  license_FOC1552R0JU_16.lic
  eem_snapshots
  scripts
  poap_retry_debugs.log
  virtual-instance
  platform-sdk.cmd
  nxos.7.0.3.I7.3.bin
  n3000-uk9-kickstart.6.0.2.U6.3ab.bin
  bios_daemon.dbg
  sprom_cstruct_2_0_0
  sprom_cstruct_3_0_0

loader>

Hãy sử dụng lệnh boot bootflash:<image_name> để boot vào os mà bạn muốn.

loader> boot bootflash:nxos.7.0.3.I7.3.bin
Booting kickstart image: bootflash:nxos.7.0.3.I7.3.bin
CardIndex = 11060
 Image valid
graphics_set_kernel_params enter:
Installing klm_card_index
done
INIT: version 2.88 booting
Skipping ata_piix install for n3k.
Unsquashing rootfs ...
Removing libcrdcfgdata and linking libcrdcfgdata3nk
Installing isan procfs ... done.
Installing SSE module with card index 11060 ... done.
Creating SSE device node 246 ... done.
Loading I2C driver ... done.
Installing CCTRL driver for card_type 30 without NEED_GEM ... done.
9.67: Interrupt throttling disabled. No cctrl irq detected.
Loading IGB driver ... done.

Sau khi vào được OS, bạn hãy show boot lên và bạn thấy rõ nguyên nhân không boot được vào OS là do phần NXOS variable not set tức là chưa có image nào được cài đặt khi khởi động.

StorageCA-SW01# show boot
Current Boot Variables:

sup-1
NXOS variable not set
Boot POAP Disabled


Boot Variables on next reload:

sup-1
NXOS variable not set
Boot POAP Disabled

Hãy show các file có trong bootflash, mình thấy có image nxos.7.0.3.I7.3.bin mà lúc nãy mình vừa boot xong.

StorageCA-SW01# dir bootflash:
        945    Nov 15 13:41:09 2022  bios_daemon.dbg
       4096    Nov 01 10:30:05 2022  eem_snapshots/
        640    Apr 30 21:34:37 2012  license_FOC1552R0JU_16.lic
       4096    Nov 15 11:53:34 2022  logflash/
   37853184    Nov 15 13:31:47 2022  n3000-uk9-kickstart.6.0.2.U6.3ab.bin
  206762702    Nov 15 13:32:44 2022  n3000-uk9.6.0.2.U6.3a.bin
  962771456    Nov 15 11:50:58 2022  nxos.7.0.3.I7.3.bin
       4131    Nov 15 06:42:34 2022  patch_debug.log
          0    Nov 14 03:08:23 2022  platform-sdk.cmd
       4096    Nov 14 02:58:42 2022  scripts/
       1024    Nov 16 02:38:47 2022  sprom_2_0_1
       1024    Nov 16 02:38:47 2022  sprom_3_0_0
       1024    Nov 15 13:43:59 2022  sprom_cstruct_2_0_0
       1024    Nov 15 13:44:33 2022  sprom_cstruct_3_0_0
       4096    Oct 07 17:10:56 2021  virtual-instance/

Usage for bootflash://sup-local
 1270349824 bytes used
  378273792 bytes free
 1648623616 bytes total

Hãy dùng lệnh dưới để cài đặt boot cho image này nhé.

StorageCA-SW01(config)# boot nxos bootflash:/nxos.7.0.3.I7.3.bin
Performing image verification and compatibility check, please wait....

Và đây là kết quả khi show boot, phần NXOS variable đã được cài đặt boot vào image nxos.7.0.3.I7.3.bin.

StorageCA-SW01(config)# show boot
Current Boot Variables:

sup-1
NXOS variable = bootflash:/nxos.7.0.3.I7.3.bin
Boot POAP Disabled


Boot Variables on next reload:

sup-1
NXOS variable not set
Boot POAP Disabled

2. Trường hợp boot os từ thiết bị ngoài.

Trường hợp bạn muốn boot os từ thiết bị ngoài từ mode loader ví dụ như usb thì bạn làm như sau.

Hãy cắm usb vào thiết bị và show các file có trong usb, ví dụ của mình đang là usb1. Mình thấy file image tên là nxos.7.0.3.I7.3.bin, mình sẽ boot vào thiết bị bằng image này.

loader> dir usb1:
usb1:
  System Volume Information
  nxos.7.0.3.I7.3.bin
  n3000-uk9-kickstart.6.0.2.U6.3ab.bin
  n3000-uk9.6.0.2.U6.7.bin
  n3000-uk9-kickstart.6.0.2.U6.7.bin
  n3000-uk9.6.0.2.U6.3a.bin
  bootflash_sync_list
  license_FOC1722R0ZG_4_1.lic
  n3000-uk9-kickstart.6.0.2.U6.3a.bin
  patch_control.log
  patch_debug.log
  platform-sdk.cmd
  sprom_2_0_1
  sprom_3_0_0

Hãy gõ lệnh dưới và chờ đợi quá trình load vào os. Sau ít phút sau khi load xong os bạn sẽ thấy màn hình đăng nhập như dưới.

loader> boot usb1:/nxos.7.0.3.I7.3.bin
Booting kickstart image: usb1:/nxos.7.0.3.I7.3.bin
CardIndex = 11060
 Image valid
graphics_set_kernel_params enter:
Installing klm_card_index
done
umount: /torissusda5: not mounted
INIT: version 2.88 booting
Skipping ata_piix install for n3k.
Unsquashing rootfs ...
Removing libcrdcfgdata and linking libcrdcfgdata3nk
Installing isan procfs ... done.
Installing SSE module with card index 11060 ... done.
Creating SSE device node 246 ... done.
Loading I2C driver ... done.
Installing CCTRL driver for card_type 30 without NEED_GEM ... done.
14.09: Interrupt throttling disabled. No cctrl irq detected.
Loading IGB driver ... done.
Checking for eUSB firmware upgrade..
eUSB firmware upgrade not required

Checking all filesystems.External drive attached, setting sdb as boot disk.
Current boot disk sdb3..

Installing SPROM driver ... IS_N3K done.
Skipping installing default sprom values for N3k...
Installing pfmsvcs module with SPROM card index 11060 ... done.
Installing nvram module ... done.
Installing if_index module with port mode 1 ... done.
Installing fcfwd stub
Installing RNI lcnd ... done
Installing LC netdev ... done
Installing psdev module ... done.
Installing veobc module ... done.
Inserting OBFL module ... done.
Making OBFL character devices
Mounting OBFL pstore for mtd
invalid group file entry
delete line 'aaa-db-operator:508:'? No
grpck: no changes
exit code: 1
Starting OpenBSD Secure Shell server: sshd ... done.
Trim files after extracting TOR files ...
tune2fs 1.42.1 (17-Feb-2012)
Setting reserved blocks percentage to 0% (0 blocks)
Starting portmap daemon...
creating NFS state directory: done
starting 8 nfsd kernel threads: done
starting mountd: done
starting statd: done
Saving image for img-sync ...
Loading system software
Installing local RPMS
Patch Repository Setup completed successfully
Creating /dev/mcelog
Starting mcelog daemon
Removing dme lib
Moving N3K specific syslog config file
INIT: Entering runlevel: 3
Running S93thirdparty-script...

Populating conf files for hybrid sysmgr ...
Removing bios-imgs and /lcimages
Starting hybrid sysmgr ...
inserting /isan/lib/modules/klm_cisco_nb.o ... done
Executing Prune clis.


StorageCA-SW02 login: admin
Password:

Sau khi vào tới đây bạn hãy thực hiện copy flash từ usb1 sang bootflash nếu trong bootflash không tồn tại image nào.

copy usb1:/nxos.7.0.3.I7.3.bin bootflash:

Sau khi copy xong bạn có thể cài đặt boot bình thường như ở phần trên.

3. Boot cisco từ kickstart NX-OS.

Chú ý: kickstart file chỉ tồn tại trên NX-OS version < 7.0 với version > 7.0 bỏ qua bước này

Để khắc phục trước hết cần tìm file  kickstart xem có tồn tại hay không,  (NX-OS version thấp hơn 7.0 sẽ có file kickstart, đối với switch NX-OS version cao hơn sẽ boot trực tiếp vào image)

loader> dir
bootflash:
lost+found
assoc_mgr_cnv.log
mts.log
vfc_cnv.log
vlan.dat
admin.rc.cli
n5000-uk9.5.0.2.N2.1.bin
n5000-uk9-kickstart.5.0.2.N2.1.bin

Sử dụng lệnh dưới để boot vào os.

loader> boot n5000-uk9-kickstart.5.0.2.N2.1.bin
Booting kickstart image: n5000-uk9-kickstart.5.0.2.N2.1.bin....
...............................................................................
...Image verification OK

Starting kernel...
Usage: init 0123456SsQqAaBbCcUu
INIT: version 2.85 booting
platform_type cmdline parameter not found. Asssuming Oregon.
I2C - Mezz absent
sprom_drv_init_platform: nuova_i2c_register_get_card_index
blogger: /var/log/isan.log: No such file or directory (2).
Starting Nexus5010 POST...
Executing Mod 1 1 SEEPROM Test......done
Executing Mod 1 1 GigE Port Test.......^@done
Executing Mod 1 1 Inband GigE Test.....done
Executing Mod 1 1 NVRAM Test....done
Executing Mod 1 1 PCIE Test...............................done
Mod 1 1 Post Completed Successfully
POST is completed
autoneg unmodified, ignoring
autoneg unmodified, ignoring
Checking all filesystems..... done.
.
Loading system software
No system exporting directories for NFS kernel daemon...done.
INIT: Sending processes the KILL signal
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2010, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under
license. Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or the GNU
Lesser General Public License (LGPL) Version 2.1. A copy of each
such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://www.opensource.org/licenses/lgpl-2.1.php
switch(boot)#

Sau khi boot xong bạn hãy tìm file system image boot từ boot disk.

switch(boot)# dir
47 Nov 03 2010 15:21:20 ..tmp-kickstart
37 Nov 03 2010 15:21:21 ..tmp-system
20816384 Nov 03 2010 15:21:20 .tmp-kickstart
182863950 Nov 03 2010 15:21:21 .tmp-system
0 Nov 11 2010 10:44:25 admin.rc.cli
362 Mar 08 2011 16:09:26 assoc_mgr_cnv.log
49152 Mar 08 2011 15:15:41 lost+found/
7986 Mar 16 2011 13:59:36 mts.log
25164288 Dec 30 2010 11:42:38 n5000-uk9-kickstart.5.0.2.N2.1.bin
156932426 Dec 30 2010 11:41:52 n5000-uk9.5.0.2.N2.1.bin
362 Dec 30 2010 12:18:25 vfc_cnv.log
508 Jun 05 2011 13:24:58 vlan.dat

Usage for bootflash: filesystem
450199552 bytes total used
433152000 bytes free
883351552 bytes available

File ở trên là : n5000-uk9.5.0.2.N2.1.bin

switch(boot)# load bootflash:n5000-uk9.5.0.2.N2.1.bin
Uncompressing system image: bootflash:/n5000-uk9.5.0.2.N2.1.bin
...
System booting up.

Sau khi boot xong quý khách có thể truy cập được os như bình thường

Tiếp theo quý khách cần thêm cấu hình vào startup để khi reboot lại sẽ không bị lỗi

switch# configure terminal
switch(config)# boot kickstart bootflash:/n5000-uk9-kickstart.5.0.2.N2.1.bin
switch(config)# boot system bootflash:/n5000-uk9.5.0.2.N2.1.bin
switch(config)# copy running-config startup-config

Trong trường hợp các file trên không tồn tại bạn có thể download file và boot từ usb, hoặc tftp.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

4,956FansLike
256FollowersFollow
223SubscribersSubscribe
spot_img

Related Stories