cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
282
Views
2
Helpful
5
Replies

POAP USB N9K

georg-seidl
Level 1
Level 1

Hi everbody,

i try poap usb with a N9k 10.3.5m NXOS. With paop script from git.

nexus9000/nx-os/poap/poap.py at master · datacenter/nexus9000 (github.com)

After some troubleshooting i have changed poap sript

line 1075 copy_src=os.path.join("/usbslot%s" % (options["usb_slot"]), source)

to

line 1075 copy_src=os.path.join("/usb%s" % (options["usb_slot"]), source

and follwing lines. But i have always the same problem conf.FDO24320BVX does NOT exist.

Have anybody working example with N9K?

Thanks & best regards

 

 

 

2024 Nov 14 07:57:39 switch %$ VDC-1 %$ %VMAN-2-ACTIVATION_STATE: Successfully activated virtual service 'guestshell+'
2024 Nov 14 07:57:39 switch %$ VDC-1 %$ %VMAN-2-GUESTSHELL_ENABLED: The guest shell has been enabled. The command 'guestshell' may be used to access it, 'guestshell destroy' to remove it.
2024 Nov 14 07:57:40 switch %$ VDC-1 %$ %USER-2-SYSTEM_MSG: Thirdparty RPMs installation succeeded - /thirdparty_install.py
2024 Nov 14 07:57:42 switch %$ VDC-1 %$ %POAP-2-POAP_INFO: [FDO24320BVX-E4:1F:7B:B7:14:67] - USB Initializing Success
2024 Nov 14 07:57:42 switch %$ VDC-1 %$ %POAP-2-POAP_INFO: [FDO24320BVX-E4:1F:7B:B7:14:67] - USB disk detected
2024 Nov 14 07:57:42 switch %$ VDC-1 %$ %POAP-2-POAP_INFO: [FDO24320BVX-E4:1F:7B:B7:14:67] - Python Script found on USB disk
2024 Nov 14 07:57:42 switch %$ VDC-1 %$ %POAP-2-POAP_INFO: [FDO24320BVX-E4:1F:7B:B7:14:67] - Python Script is copied successfuly
2024 Nov 14 07:57:42 switch %$ VDC-1 %$ %POAP-2-POAP_INFO: [FDO24320BVX-E4:1F:7B:B7:14:67] - script timeout value:5400 sec
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: - Logfile name: /bootflash/20241114075744_poap_23177_usb_script.log - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: - Found 5 POAP script logs - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: - Setting source cfg filename based-on serial number - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: - serial number FDO24320BVX - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: - Selected conf file name : conf.FDO24320BVX - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - Verifying freespace in bootflash - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - Free bootflash space is 103954524.0 - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - Single image is set - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - Copying config file - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - INFO: Starting Copy of Config File to /bootflash/poap_conf.cfg - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - Copying file options source=baseline/FDO24320BVX/conf.FDO24320BVX destination=/bootflash/poap_conf.cfg login_timeout=120 destination_tmp=poap_conf.cfg.tmp - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - /usb1/baseline/FDO24320BVX/conf.FDO24320BVX does NOT exist - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[FDO24320BVX]-MAC[E41F7BB71460] - Cleanup all files - /script.sh
2024 Nov 14 07:57:44 switch %$ VDC-1 %$ %POAP-2-POAP_FAILURE: [FDO24320BVX-E4:1F:7B:B7:14:67] - POAP USB Script execution failed

But the file exist on system:

switch# cd usb1:

switch# dir /baseline/FDO24320BVX/conf.FDO24320BVX
2430 Nov 12 16:34:10 2024 baseline/FDO24320BVX/conf.FDO24320BVX

 

 

 

 

5 Replies 5

georg-seidl
Level 1
Level 1

I think the problem is that usbstick is in guestshell not mounted

I start default guestshell, i could find usbstick directory like as /bootflash

[t00000skea@guestshell ~]$ cd /
[t00000skea@guestshell /]$ ls
afs boot cisco cscogsart-1.0-0.x86_64.rpm etc isan lib64 lost+found mnt proc run selinux sys usr volatile
bin bootflash created.2023-12-08.11:19:14 dev home lib logflash media opt root sbin srv tmp var
[t00000skea@guestshell /]$ cd media
[t00000skea@guestshell media]$ ls
[t00000skea@guestshell media]$

Not found any docs on this, but do you use guestshell run mount /dev/sdb1 /media/usb for this? I think you can see the USB in guestshell via mount | grep usb - not tried this in ages however...

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

thats the problem no good documentation is available

i have tried this

[user01@guestshell /]$ sudo fdisk -l   -> no stick to see? in nxos cd usb1: is possible

[user01@guestshell /]$ sudo mount /dev/sdb1 /media/usb1
mount: /media/usb1: permission denied.

 

@georg-seidl might have gotten lucky with this find https://github.com/ndelecro/nx-os-programmability/blob/master/Guest_Shell/PXE_Server/README.md

bash-4.2$ sudo su
bash-4.2# mount --make-shared /usbslot1
bash-4.2# mkdir /var/run/netns/usbslot1
bash-4.2# mount --bind /usbslot1 /var/run/netns/usbslot1

  

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Based on this info, i have changed the poap_script.py back.

If i do this manuelly (bash mount) so i can access the usbstick my guestshell.

So i have found my failure.

"config_path": "/baseline" the slash was the problem "config_path": "baseline" works.