CCIE Pursuit Blog

July 14, 2007

Warm-Reboot Count and Uptime Values

Filed under: Cool Commands,IOS,Tech Tips — cciepursuit @ 7:35 am

I just recently discovered the “warm-reboot” function.  Upon discovering something new I like to try to “break” it.  In this case I wanted to try to disable the warm-reboot function by exceeding the count and/or uptime values.  Here’s a quick recap of why those values are important (courtesy of Cisco IOS Hints and Tips):

“Of course, the IOS code (depending on platform’s memory management capabilities) or saved data could get corrupted, therefore the warm reload cannot be used continuously (and the router falls back to traditional reload if the router crashes before a specified time interval).”

Let’s test that and see if we can cause the router to bypass the warm-boot.  We should be able to do that by setting the warm-reboot uptime option to a large value and then requesting two consecutive reloads.

Step 1: Maximize the uptime value:
r2(config)#warm-reboot count 5 uptime ?
  <0-120>  Time in minutes, default 5

r2(config)#warm-reboot count 5 uptime 120

Step 2: Reload.  This should be a warm-reboot:
r2#reload warm
Proceed with reload? [confirm]

*Jul 14 12:07:41: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

After reload:
r2#sh log | i %SYS-6-BOOTTIME
*Jul 14 12:08:18: %SYS-6-BOOTTIME: Time taken to reboot after reload =   35 seconds

Step 3: Reload again.  This should NOT be a warm-reboot as the router has not been up for the required 120 minutes:
r2#reload warm
Proceed with reload? [confirm]

*Jul 14 12:09:32: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

After reload:
r2#sh log | i %SYS-6-BOOTTIME
*Jul 14 12:10:08: %SYS-6-BOOTTIME: Time taken to reboot after reload =   35 seconds

Hmmmm….that’s odd.  This was a warm-reboot.

r2#sh warm
Warm Reboot is enabled
Maximum warm reboot count is 5
Uptime after which warm reboot is safe in case of a crash is 120 (min)

Statistics:

0 warm reboots due to crashes and 2 warm reboots due to requests have taken place since the last cold reboot
3149 KB taken up by warm reboot storage

Actually it’s NOT odd.  I didn’t understand the uptime parameter properly.  The uptime only comes into play with CRASHES and not warm reboot requests.

Let’s change strategies and repeat the above, but this time let’s set the warm-reboot count to 1 and then reload twice:

r2(config)#warm-reboot count 1
Warm reboot will be possible after the next power cycle or reload.

Interesting.  Although warm-reboot was already configured, changing the count value requires that you do a standard reload first (this was not the case when we changed the uptime value).  [NOTE: I actually changed the count and the uptime because I let the uptime be set to the default of 5 minutes (from the previous setting of 120 minutes).  The reason for the standard reload could be due to the change in the count OR because I changed both the count and the uptime.]  It does not clear the historical warm-reboot statistics though:

***Update – Wrong! Wrong! Wrong!  This behavior is explained here. ***

r2#sh warm
Warm Reboot is enabled
Maximum warm reboot count is 1
Uptime after which warm reboot is safe in case of a crash is 5 (min)

Statistics:

0 warm reboots due to crashes and 2 warm reboots due to requests have taken place since the last cold reboot
3149 KB taken up by warm reboot storage

Reload 1 (standard):
r2#reload
Proceed with reload? [confirm]

*Jul 14 12:16:35: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

r2#sh log | i %SYS-6-BOOTTIME
*Jul 14 12:18:09: %SYS-6-BOOTTIME: Time taken to reboot after reload =   94 seconds

Interesting.  The warm-reboot statistics are reset now:

r2#sh warm
Warm Reboot is enabled
Maximum warm reboot count is 1
Uptime after which warm reboot is safe in case of a crash is 5 (min)

Statistics:

0 warm reboots due to crashes and 0 warm reboots due to requests have taken place since the last cold reboot
3149 KB taken up by warm reboot storage

Reload 2 (warm):
r2#reload warm
Proceed with reload? [confirm]

*Jul 14 12:54:24: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

After reload:
r2#sh log | i %SYS-6-BOOTTIME
*Jul 14 12:55:00: %SYS-6-BOOTTIME: Time taken to reboot after reload =   35 seconds

r2#sh warm
Warm Reboot is enabled
Maximum warm reboot count is 1
Uptime after which warm reboot is safe in case of a crash is 5 (min)

Statistics:

0 warm reboots due to crashes and 1 warm reboots due to requests have taken place since the last cold reboot
3149 KB taken up by warm reboot storage

Reload 3 (should not allow warm-reboot):
r2#reload warm
Not possible to warm reload.
Reason: Too Many warm reboots have taken place

Mission accomplished.  🙂

It looks like the downside to the warm-reboot command is that you can only use the “reload warm” command as many times as is configured with the warm-reboot count variable.  This is so you don’t corrupt your data.  If you find that you’ve used your allotment of warm-reboots, just increase the count:

r2#sh warm
Warm Reboot is enabled
Maximum warm reboot count is 1
Uptime after which warm reboot is safe in case of a crash is 5 (min)

Statistics:

0 warm reboots due to crashes and 1 warm reboots due to requests have taken place since the last cold reboot
3149 KB taken up by warm reboot storage

r2#reload warm
Not possible to warm reload.
Reason: Too Many warm reboots have taken place

r2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r2(config)#warm count ?
  <1-50>  Default 5

r2(config)#warm count 50
r2(config)#^Z
r2#wr
Building configuration…

*Jul 14 13:23:42: %SYS-5-CONFIG_I: Configured from console by console[OK]

r2#sh warm | i reboot count
Maximum warm reboot count is 50
r2#reload warm
Proceed with reload? [confirm]
*Jul 14 13:13:08: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: