Perform Disaster Recovery

The topics covered in this chapter are:

Create a Bootable USB Drive

The bootable USB drive is used to re-image the router for the purpose of system upgrade or boot the router in case of boot failure. The bootable USB drive can be created in two ways:

Create a Bootable USB Drive Using Compressed Boot File

A bootable USB drive is created by copying a compressed boot file into a USB drive. The USB drive becomes bootable after the contents of the compressed file are extracted.

This task can be completed using Windows, Linux, or MAC operating systems available on your local machine. The exact operation to be performed for each generic step outlined here depends on the operating system in use.

Before You Begin
  • Have access to a USB drive with a storage capacity that is between 2GB (min) and 32 GB (max). USB 2.0 and USB 3.0 are supported.

  • Copy the compressed boot file from the software download page at cisco.com to your local machine. The file name for the compressed boot file is in the format ncs4k-usb-boot-<release_number>.zip. For example, ncs4k-usb-boot-5.2.3.zip.

SUMMARY STEPS

    1.    Connect the USB drive to your local machine and format it with FAT32 file system.

    2.    Copy the compressed boot file to the USB drive.

    3.    Unzip the compressed boot file inside the USB drive.

    4.    The contents of the compressed boot file ("EFI" and "Boot" directories) should be extracted to the root of the USB drive. If they are extracted to a separate folder, move them to the root of the USB drive.


DETAILED STEPS
    Step 1   Connect the USB drive to your local machine and format it with FAT32 file system.
    Step 2   Copy the compressed boot file to the USB drive.
    Step 3   Unzip the compressed boot file inside the USB drive.
    Step 4   The contents of the compressed boot file ("EFI" and "Boot" directories) should be extracted to the root of the USB drive. If they are extracted to a separate folder, move them to the root of the USB drive.

    USB drive is bootable when the "EFI" and "Boot" directories are in the root of the USB drive.


    What to Do Next

    Use the bootable USB drive to boot the router or upgrade its image. See:

    Create a Bootable USB Drive Using Shell Script

    To create the bootable USB drive using shell script, you need an ISO image file and the shell script that creates the boot device. The shell script is available on the router itself. Create the bootable USB drive as an preemptive measure when the router is operational. If router is already unusable, create the bootable USB drive on another active router or as instructed in the procedure Create a Bootable USB Drive Using Compressed Boot File.


    Note


    The contents of the USB drive is erased during the process of creating the bootable drive.


    Before You Begin
    • Have access to a USB drive with a storage capacity that is between 2GB (min) and 32 GB (max). USB 2.0 and USB 3.0 are supported.

    • ISO image must be present on a network server.

    SUMMARY STEPS

      1.    copy tftp:source disk1:destination

      2.    dir /disk1:

      3.    run ls /usr/bin/usb-install.sh

      4.    Connect the USB drive.

      5.    run

      6.    tail /var/log/messages

      7.    cd directory path

      8.    <shell_script_file_name> <location_of_iso_image> <mount_location_of_USB_device>


    DETAILED STEPS
      Step 1   copy tftp:source disk1:destination


      Example:
      RP/0/RP0:hostname# copy tftp://223.255.254.254/image/ncs4k-mini-x.iso disk1\:/ncs4k-mini-x.iso

      Copy the ISO image from a network server to the router hard disk.

      Step 2   dir /disk1:


      Example:
      RP/0/RP0:hostname#dir /disk1:

      Verify that the image is copied. The result of this command displays the ISO file name.

      Directory of /disk1:/
      
          12 -rw-r--r-- 1  7864320 Jun 27 20:30 ncs4k-mini-x.iso
      
      Step 3   run ls /usr/bin/usb-install.sh


      Example:
      RP/0/RP0:hostname# run ls /usr/bin/usb-install.sh

      Verify that the shell script is available on the router. The usb-install.sh script must be present in the command output.

      run ls /usr/bin/usb*.sh
      
      430 -rwx------ 1 8456 Jun 20 23:30 /usr/bin/usb-install.sh
      
      Step 4   Connect the USB drive.

      The USB drive must be connected to the USB port on the RP to which the iso image has been copied. The USB port is shown in this figure.





      1 External USB Port
      2 XR VM Console Port
      3 XR VM Management Port
      Step 5   run


      Example:
      RP/0/RP0:hostname# run

      Enters the XR VM Linux shell. The router prompt changes to:

      [xr-vm_node0_RP0_CPU0:/]$
      Step 6   tail /var/log/messages


      Example:
      [xr-vm_node0_RP0_CPU0:/]$ tail /var/log/messages

      Identifies the device name to which the USB drive is been mapped. The USB drive is auto-discoverable on the XR VM shell.

      ...
      ...
      Aug 16 18:56:07 xr-vm kernel: virtio-pci 0000:c0:08.0: setting latency timer to 64
      Aug 16 18:56:07 xr-vm kernel: virtio-pci 0000:c0:08.0: irq 93 for MSI/MSI-X
      Aug 16 18:56:07 xr-vm kernel: virtio-pci 0000:c0:08.0: irq 94 for MSI/MSI-X
      Aug 16 18:56:07 xr-vm kernel:  vde: vde1
      
      
      In this example, we identify from the last entry that the USB is mapped as "vde".
      Step 7   cd directory path


      Example:[xr-vm_node0_RP0_CPU0:/]$ cd /usr/bin

      Access the directory where the shell script is present.

      Step 8   <shell_script_file_name> <location_of_iso_image> <mount_location_of_USB_device>


      Example:
      [xr-vm_node0_RP0_CPU0:/usr/bin]$ ./usb-install.sh /disk1:/ncs4k-mini-x.iso /dev/vde/

      Runs the script to create the bootable USB drive. After the process is complete, this message is displayed:

      USB stick set up for EFI boot!

      What to Do Next

      Use the bootable USB drive to boot the router or upgrade its image. See:

      Boot the Router Using USB

      The router can be booted using an external bootable USB drive. This might be required when the router is unable to boot from the installed image. Boot failure can happen when the image gets corrupted. During the USB boot process the router gets re-imaged with the version available on the USB drive.

      The default boot sequence is USB disk, Sata disk and PXE boot.


      Note


      • During the USB boot process, the router is completely re-imaged with the iso image version present in the bootable USB drive. All existing configurations are deleted because the disk 0 content is erased. No optional packages are installed during the upgrade process; they need to be installed after the upgrade is complete.

      • When the USB boots to a new image, the second RP must be physically unplugged or must be powered off. Else, while reloading after installation of new image, the system will pickup the old image from the other card.


      Before You Begin

        Step 1   Connect the USB drive to an RP.

        The USB port on the RP is shown in this figure.





        1 External USB Port
        2 XR VM Console Port
        3 XR VM Management Port
        Step 2   Connect to the console.

        If it is not already connected, connect a terminal to the System Admin console port of the RP. If two RPs are installed on the router, connect to the System Admin console port of both RPs. Start the terminal emulation program on your workstation.

        Step 3   Power on the router.
        Step 4   Press F12 on the console of the RP to which the USB is not connected. This action displays the boot menu and pauses the boot process. The RP on which the USB is connected should boot normally.

        Only the RP having the USB should boot. The booting of other RP is paused.

        Step 5   Select the USB drive to boot from USB.

        According to the default boot sequence, the USB drive is the first boot source. Because the USB device is already connected, the router automatically boots from it. During the boot process, the OS image is installed on the router so that in future the router boots without the USB.

        According to the default boot sequence, the Sata disk is the first boot source and the USB drive is the second boot source. During the boot process, the OS image is installed on the router so that in future the router boots without the USB.

        Step 6   Remove the USB drive.
        After the initial boot sequences are completed, this message is displayed:
        Running install image: Please reboot the system
        On receiving this message, remove the USB drive.
        Note   

        The USB drive should not left connected on the router during regular operation. If the router reloads when the USB drive is connected, all existing configurations will be delete as the router gets re-imaged.

        Step 7   Press Enter to get the host prompt.
        Step 8   Login to the host using root and lab as username and password respectively.

        Example:
        host login: root
        Password: 
        

        If there is no space in the RP, a prompt to either abort installation or to continue with formatting the disk is displayed.

        The prompt changes to:
        [Install image, reboot required host:~]$ 
        Step 9   Run the reboot command.

        Example:
        [Install image, reboot required host:~]$ reboot

        The RP reboots with the new image. After the booting is completed, specify the root-system username and password. For details, see Setup Root User Credentials and Login to XR VM Console.

        Step 10   Access the System Admin EXEC mode and reload the RP for which the boot process was paused in Step 4.

        Example:
        sysadmin-vm:0_RP0#hw-module location 0/RP1 reload
        

        The shut down RP is reloaded and gets synchronized with the other RP running the new image.


        What to Do Next

        Perform System Upgrade Using USB

        The router image can be upgraded using an external bootable USB drive. This might be required when the router is to be re-imaged, but the ISO image cannot be accessed over the network. It can happen when network connectivity is unavailable.


        Note


        During the upgrade all existing configurations are deleted because the disk 0 content is erased.


        Before You Begin
        • Create a bootable USB drive. See Create a Bootable USB Drive Using Shell Script or Create a Bootable USB Drive Using Compressed Boot File based on requirement.

        • Ensure that the router BIOS version is 14.xx or higher.

          • Verify the BIOS version using the show fpd package command in the System Admin EXEC mode.

          • Verify the actual state of all FPGA of the system and whether it require an upgrade or not using the show hw-module fpd command in System Admin EXEC mode.

          • If required, upgrade the BIOS using the upgrade hw-module location all fpd BIOS\ FPD command in the System Admin EXEC mode.


          Step 1   hw-module location node-id shutdown


          Example:
          sysadmin-vm:0_RP0#hw-module location 0/RP1 shutdown

          Shut down one RP. In this example, the RP1 is shut down. During the system upgrade, only one RP should be operational.

          Step 2   Connect the USB drive.

          The USB drive must be connected to the USB port on the operational RP. The USB port is shown in this figure.





          1 External USB Port
          2 XR VM Console Port
          3 XR VM Management Port
          Step 3   hw-module location node-id reload


          Example:
          sysadmin-vm:0_RP0#hw-module location 0/RP0 reload

          Reload the RP on which the USB is connected. As the RP reloads, it boots from the USB drive and gets re-imaged.

          Step 4   Remove the USB drive.
          After the initial boot sequences are complete, this message is displayed:
          Running install image: Please reboot the system
          On receiving this message, remove the USB drive.
          Note   

          The USB drive should not left connected on the router during regular operation. If the router reloads when the USB drive is connected, all existing configurations will be delete as the router gets re-imaged.

          Step 5   Press Enter to get the host prompt.
          Step 6   Login to the host using root and lab as username and password respectively.

          Example:
          host login: root
          Password: 
          
          The prompt changes to:
          [Install image, reboot required host:~]$ 
          Step 7   Run the reboot command.

          Example:
          [Install image, reboot required host:~]$ reboot

          The RP reboots with the new image. After the booting is completed, specify the root-system username and password. For details, see Setup Root User Credentials and Login to XR VM Console.

          Step 8   Access the System Admin EXEC mode and reload the RP that was shut down in Step 1.

          Example:
          sysadmin-vm:0_RP0#hw-module location 0/RP1 reload
          

          The shut down RP is reloaded and gets synchronized with the other RP running the new image.


          What to Do Next

          • Run the show version command in the XR EXEC mode to verify that the new image version is successfully installed.

          • Install the required optional packages.