Discussion:
[rancid] Restore of rancid-based hp procurve config files failed
Stefan Metzger
2011-10-12 05:18:16 UTC
Permalink
<html><head></head><body bgcolor='#FFFFFF' style='font-size:10pt;background-color:#FFFFFF;font-family:Verdana, Arial, sans-serif;'>Hi,<br/>&nbsp;<br/>configured rancid (version 2.3.6, expect version 5.44 on a SLES 11.1) based on different tutorials. Created a user &ldquo;rancid&rdquo;, the .cloginrc file, modified the<br/>rancid.conf file, created the svn/cvs repository (rancid-cvs) and tested successfully the login on our hp procurve switch<br/>infrastructure by using hlogin.<br/>&nbsp;<br/>After running the &ldquo;rancid-run&rdquo; script to backup the configuration of a hp procurve 4208 switch, the config file under<br/>/usr/local/rancid/var/&lt;LIST_OF_GROUPS_entry&gt;/configs looks like this:<br/>&nbsp;<br/>-----<br/>;RANCID-CONTENT-TYPE: hp<br/>;<br/>;Chassis type: J8773A<br/>;Serial Number: SG746VB024<br/>;<br/>;Memory: 47M<br/>;<br/>;Image: stamp:&nbsp;&nbsp;&nbsp; /sw/code/build/rmm(rm11)<br/>;Image: Mar 12 2010 01:28:36<br/>;Image: L.11.24<br/>;Image: 76<br/>;Image: Boot Image:&nbsp;&nbsp;&nbsp;&nbsp; Primary<br/>;Image: ROM L.10.03<br/>;<br/>;Flash: Image&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size(Bytes)&nbsp;&nbsp; Date&nbsp;&nbsp; Version<br/>;Flash: -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------&nbsp; -------- -------<br/>;Flash: Primary Image&nbsp;&nbsp; : 4542313&nbsp;&nbsp; 03/12/10 L.11.24<br/>;Flash: Secondary Image : 4542313&nbsp;&nbsp; 03/12/10 L.11.24<br/>;Flash: Boot Rom Version: L.10.03<br/>;Flash: Current Boot&nbsp;&nbsp;&nbsp; : Primary<br/>;<br/>;&nbsp; Status and Counters - Module Information<br/>;&nbsp;&nbsp; Slot&nbsp; Module Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Serial Number<br/>;&nbsp;&nbsp; ----- ---------------------------------------- --------------<br/>;&nbsp;&nbsp; A&nbsp;&nbsp;&nbsp;&nbsp; ProCurve J9033A Gig-T/SFP vl Module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SG743AM06Y<br/>;&nbsp;&nbsp; B&nbsp;&nbsp;&nbsp;&nbsp; ProCurve J8768A 24p Gig-T vl Module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SG744AK0D9<br/>;<br/>; Stacking Status<br/>;&nbsp; Stack State&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Candidate<br/>;&nbsp; Transmission Interval : 60<br/>;&nbsp; Auto Join&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Yes<br/>;<br/>;<br/>hostname &quot;ProCurve Switch 4208vl&quot;<br/>max-vlans 256<br/>module 1 type J9033A<br/>module 2 type J8768A<br/>[&hellip;]<br/>;<br/>---------<br/>&nbsp;<br/>If I try to restore this file by using scp on the switch startup-config (scp &lt;backup file&gt; &lt;login&gt;@&lt;switch-ip&gt;:/cfg/startup-config<br/>I got an error:<br/>&nbsp;<br/>scp: /cfg/startup-config/: errno = 0xe<br/>&nbsp;<br/>&nbsp;<br/>If I backup the config manually by using scp the backup file (header) looks a little bit different:<br/>&nbsp;<br/>-----<br/>; J8773A Configuration Editor; Created on release #L.11.24<br/>&nbsp;<br/>hostname &quot;ProCurve Switch 4208vl&quot;<br/>max-vlans 256<br/>module 2 type J8768A<br/>module 1 type J9033A<br/>[&hellip;]<br/>&nbsp;<br/>-----<br/>&nbsp;<br/>Restoring this one works well. It seems that the line &quot;; J8773A Configuration Editor; Created on release #L.11.24&quot; is required, because,<br/>if I replace the comments header of the rancid backup file by the second one (; J8773A Configuration Editor; Created on release #L.11.24) the restore<br/>works also.<br/>&nbsp;<br/>Any idea/solution?<br/>&nbsp;<br/>Br<br/>Stefan&nbsp;&nbsp;<br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="Loading Image..." width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font-size:12px; line-height:17px;">SMS schreiben mit WEB.DE FreeMail - einfach, schnell und&nbsp;&nbsp;&nbsp;<br>kostenguenstig. Jetzt gleich testen! <a href="http://f.web.de/?mc=021192"><b>http://f.web.de/?mc=021192</b></a></td></tr></table>
</body></html>
Stefan Metzger
2011-10-12 05:22:50 UTC
Permalink
Hi,
 
configured rancid (version 2.3.6, expect version 5.44 on a SLES 11.1) based on different tutorials. Created a user “rancid”, the .cloginrc file, modified the
rancid.conf file, created the svn/cvs repository (rancid-cvs) and tested successfully the login on our hp procurve switch
infrastructure by using hlogin.
 
After running the “rancid-run” script to backup the configuration of a hp procurve 4208 switch, the config file under
/usr/local/rancid/var/<LIST_OF_GROUPS_entry>/configs looks like this:
 
-----
;RANCID-CONTENT-TYPE: hp
;
;Chassis type: J8773A
;Serial Number: SG746VB024
;
;Memory: 47M
;
;Image: stamp:    /sw/code/build/rmm(rm11)
;Image: Mar 12 2010 01:28:36
;Image: L.11.24
;Image: 76
;Image: Boot Image:     Primary
;Image: ROM L.10.03
;
;Flash: Image           Size(Bytes)   Date   Version
;Flash: -----           ----------  -------- -------
;Flash: Primary Image   : 4542313   03/12/10 L.11.24
;Flash: Secondary Image : 4542313   03/12/10 L.11.24
;Flash: Boot Rom Version: L.10.03
;Flash: Current Boot    : Primary
;
;  Status and Counters - Module Information
;   Slot  Module Description                       Serial Number
;   ----- ---------------------------------------- --------------
;   A     ProCurve J9033A Gig-T/SFP vl Module      SG743AM06Y
;   B     ProCurve J8768A 24p Gig-T vl Module      SG744AK0D9
;
; Stacking Status
;  Stack State           : Candidate
;  Transmission Interval : 60
;  Auto Join             : Yes
;
;
hostname "ProCurve Switch 4208vl"
max-vlans 256
module 1 type J9033A
module 2 type J8768A
[…]
;
---------
 
If I try to restore this file by using scp on the switch startup-config (scp <backup file> <login>@<switch-ip>:/cfg/startup-config
I got an error:
 
scp: /cfg/startup-config/: errno = 0xe
 
 
If I backup the config manually by using scp the backup file (header) looks a little bit different:
 
-----
; J8773A Configuration Editor; Created on release #L.11.24
 
hostname "ProCurve Switch 4208vl"
max-vlans 256
module 2 type J8768A
module 1 type J9033A
[…]
 
-----
 
Restoring this one works well.
If I replace the comments header of the rancid backup file by the second one (; J8773A Configuration Editor; Created on release #L.11.24) the restore
works also.
 
Any idea/solution?
 
Br
Stefan
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
Per-Olof Olsson
2011-10-14 18:26:59 UTC
Permalink
Hi

Yes Procurve switches use the first comment line as a type of identifier
to prevent loading wrong (or none) config files to the switch.

I don't know why hrancid remove that line from the backup.
After put that line back its easier to use.
I just make a copy of the rancid backup file, removing the comment part
up to identifier line, and load it to the switch.


diff -c hrancid.in.ORG hrancid.in
...
*** 302,307 ****
--- 340,346 ----
s/\$(Revision|Id):/ $1:/;
/^; (\S+) configuration editor;/i &&
ProcessHistory("COMMENTS","keysort","A0",";Chassis type:
$1\n") &&
+ ProcessHistory("","","",";\n;Running config file:\n$_") &&
next;

# order logging statements - doesnt appear to do syslog as of
right now
***************
...

/Peo
----------------------------------------------------------
Per-Olof Olsson Email: ***@chalmers.se
Chalmers tekniska högskola IT-service
Hörsalsvägen 5 412 96 Göteborg
Tel: 031/772 6738 Fax: 031/772 8680
----------------------------------------------------------
Post by Stefan Metzger
Hi,
configured rancid (version 2.3.6, expect version 5.44 on a SLES 11.1) based on different tutorials. Created a user “rancid”, the .cloginrc file, modified the
rancid.conf file, created the svn/cvs repository (rancid-cvs) and tested successfully the login on our hp procurve switch
infrastructure by using hlogin.
After running the “rancid-run” script to backup the configuration of a hp procurve 4208 switch, the config file under
-----
;RANCID-CONTENT-TYPE: hp
;
;Chassis type: J8773A
;Serial Number: SG746VB024
;
;Memory: 47M
;
;Image: stamp: /sw/code/build/rmm(rm11)
;Image: Mar 12 2010 01:28:36
;Image: L.11.24
;Image: 76
;Image: Boot Image: Primary
;Image: ROM L.10.03
;
;Flash: Image Size(Bytes) Date Version
Y> ;Flash: ----- ---------- -------- -------
Post by Stefan Metzger
;Flash: Primary Image : 4542313 03/12/10 L.11.24
;Flash: Secondary Image : 4542313 03/12/10 L.11.24
;Flash: Boot Rom Version: L.10.03
;Flash: Current Boot : Primary
;
; Status and Counters - Module Information
; Slot Module Description Serial Number
; ----- ---------------------------------------- --------------
; A ProCurve J9033A Gig-T/SFP vl Module SG743AM06Y
; B ProCurve J8768A 24p Gig-T vl Module SG744AK0D9
;
; Stacking Status
; Stack State : Candidate
; Transmission Interval : 60
; Auto Join : Yes
;
;
hostname "ProCurve Switch 4208vl"
max-vlans 256
module 1 type J9033A
module 2 type J8768A
[…]
;
---------
scp: /cfg/startup-config/: errno = 0xe
-----
; J8773A Configuration Editor; Created on release #L.11.24
hostname "ProCurve Switch 4208vl"
max-vlans 256
module 2 type J8768A
module 1 type J9033A
[…]
-----
Restoring this one works well.
If I replace the comments header of the rancid backup file by the second one (; J8773A Configuration Editor; Created on release #L.11.24) the restore
works also.
Any idea/solution?
Br
Stefan
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...