Upgrade failed, script: download failed

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Exos auto Upgrade script using TCL.

I wanted to upgrade the OS automatically using default.xsf.
The script information seems to be correct, but the log is generated in the last download command and can not be processed.

The TFTP server is OK.
Upgrading to command works well.

I need help. please help me.

script description " default.xsf"////

enable dhcp vlan mgmt
enable cli scripting

set var CLI.OUT " "

set var wait $TCL(after 10)

set var TFTPserver "10.1.112.129"
set var Switchtype "{X440-8p} {X440-48p}"
set var UpgradeOS "summitX-16.1.4.2-patch1-9.xos"

show switch
set var Temp1 $TCL(split ${CLI.OUT} "\n")
set var Temp2 $tcl(lindex $Temp1 1)
set var Temp3 $tcl(split $Temp2 " ")
set var Switch $tcl(lindex $Temp3 10)
delete var Temp2
delete var Temp3

set var Temp2 $tcl(lindex $Temp1 20)
set var Temp3 $tcl(split $Temp2 " ")
set var BootPartition $tcl(lindex $temp3 6)
delete var Temp1
delete var Temp2
delete var Temp3

if ({$BootPartition} == "primary") then
show version image primary
set var temp1 $tcl(split ${CLI.OUT} "\n")
set var temp2 $tcl(lindex $temp1 2)
set var BootpriOS $tcl(lindex $temp2 9)
delete var temp1
delete var temp2
endif
if ({$BootpriOS} == {$UpgradeOS}) then
use image secondary
reboot
endif
if ({$BootPartition} == "secondary") then
show version image secondary
set var temp1 $tcl(split ${CLI.OUT} "\n")
set var temp2 $tcl(lindex $temp1 2)
set var BootsecOS $tcl(lindex $temp2 9)
delete var temp1
delete var temp2
endif
if ({$BootsecOS} == {$UpgradeOS}) then
use image primary
reboot
endif


set var SwitchNum $tcl(llength $Switchtype)

set var i 0

while ($i < $SwitchNum) do
set var switchlist $tcl(lindex $Switchtype $i)
if ({$switchlist} == {$Switch}) then
download image {$TFTPserver} {$downOS} vr vr-mgmt
yes
yes
endif
set var i ($i + 1)
endwhile

if ($i == $SwitchNum) then
disable cli scripting
endif

/// show logs
04/14/2017 02:09:01.60 <Noti:EPM.download_status> Download of image finished with status failure -tftp: server error: (2) Could not open requested file for reading   

04/14/2017 02:09:01.44 <Erro:EPM.Upgrade.Fail> Upgrade failed, script: download failed
04/14/2017 02:09:01.17 <Noti:EPM.Upgrade.DnldImg> Download image from hostname  ip address 10.1.112.129 file name summitX-16.1.4.2-patch1-9.xos VR VR-Mgmt
Photo of KD

KD

  • 150 Points 100 badge 2x thumb
  • ㅠ_ㅠ

Posted 1 year ago

  • 0
  • 1
Photo of Grosjean, Stephane

Grosjean, Stephane, Employee

  • 12,592 Points 10k badge 2x thumb
Hi,

are you sure you already have an ip on the Mgmt vlan from DHCP? Try to write logs with some info like that to be sure... check also if there's no funny character in the filename (looks the same but ascii code different...).
Photo of KD

KD

  • 150 Points 100 badge 2x thumb
hi,

Yes, MGMT vlan have ip address from dhcp server.

--- log
X440-8p.32 # show vlan-----------------------------------------------------------------------------------------------
Name            VID  Protocol Addr       Flags                         Proto  Ports  Virtual   
                                                                              Active router
                                                                              /Total
-----------------------------------------------------------------------------------------------
Default         1    --------------------------------T---------------- ANY    0 /12  VR-Default 
Mgmt            4095 10.1.112.120   /24  ----------------------------- ANY    1 /1   VR-Mgmt    
-----------------------------------------------------------------------------------------------

and I guess there is a problem with this syntax.
if ({$switch} == {$Switchtype}) then
download image $TFTPserver $UpgradeOS vr vr-mgmt
end if

because .....

--- log
440-8p.37 # show var----------------------------------------
Count : 15                              
----------------------------------------

------------------------------------------------------------------
variableName                      variableValue                   
--------------------------------  --------------------------------
BootPartition                     secondary                       
BootpriOS                         SIGNATURE_NOT_CHECKED_summitX-15.1.2.12-patch1-6.xos
BootsecOS                         summitX-15.6.4.2-patch1-7.xos   
CLI.ARGC                          0                               
CLI.ARGV0                         default.xsf                     
CLI.OUT                           No log messages were displayed.

CLI.SCRIPT_TIME_REMAINING         0                               
CLI.SESSION_TYPE                  serial                          
CLI.USER                          admin                           
STATUS                            0                               
Switch                            X440-8p                         
Switchtype                        X440-8p                         
TFTPserver                        10.1.112.129                    
UpgradeOS                         summitX-16.1.4.2-patch1-9.xos   
wait                                                              
------------------------------------------------------------------


// From "show var" the values ​​seem to be ok. So i think that the last part of the command is not working properly. But typing command runs ok.

--- log
X440-8p.38 # download image $TFTPserver $UpgradeOS vr vr-mgmt
Note: The inactive partition (primary) will be used for installation.
Do you want to install image after downloading? (y - yes, n - no, <cr> - cancel) 
Installation cancelled
(ps.I canceled it.)

I do not know why. ᅲ_ᅲ
Photo of Grosjean, Stephane

Grosjean, Stephane, Employee

  • 12,592 Points 10k badge 2x thumb
In your script, the command is:
download image {$TFTPserver} {$downOS} vr vr-mgmt

$downOS ?
Photo of KD

KD

  • 150 Points 100 badge 2x thumb
sorry edit script files. 
I have not uploaded the modified script file.
I removed the while statement from the first file.

There is also a problem that the current OS and the target OS can not be compared. it seems to be possible to fix that part.
However,it is difficult to find the part where the upgrade does not proceed like the first problem.
// edit script file

enable dhcp vlan mgmt
enable cli scripting

set var CLI.OUT " "

set var wait $TCL(after 30)

set var TFTPserver "10.1.112.129"
set var Switchtype "X440-8p"
set var UpgradeOS "summitX-16.1.4.2-patch1-9.xos"

show switch
set var Temp1 $TCL(split ${CLI.OUT} "\n")
set var Temp2 $tcl(lindex $Temp1 1)
set var Temp3 $tcl(split $Temp2 " ")
set var Switch $tcl(lindex $Temp3 10)
delete var Temp2
delete var Temp3

set var Temp2 $tcl(lindex $Temp1 20)
set var Temp3 $tcl(split $Temp2 " ")
set var BootPartition $tcl(lindex $temp3 6)
delete var Temp1
delete var Temp2
delete var Temp3

if ({$BootPartition} == "primary") then
show version image primary
set var temp1 $tcl(split ${CLI.OUT} "\n")
set var temp2 $tcl(lindex $temp1 2)
set var BootpriOS $tcl(lindex $temp2 9)
delete var temp1
delete var temp2
endif
if ({$BootpriOS} == {$UpgradeOS}) then
use image secondary
endif
if ({$BootPartition} == "secondary") then
show version image secondary
set var temp1 $tcl(split ${CLI.OUT} "\n")
set var temp2 $tcl(lindex $temp1 2)
set var BootsecOS $tcl(lindex $temp2 9)
delete var temp1
delete var temp2
endif
if ({$BootsecOS} == {$UpgradeOS}) then
use image primary
endif


if ({$switch} == {$Switchtype}) then
download image $TFTPserver $UpgradeOS vr vr-mgmt
end if
(Edited)