Migrate from Cisco IOS XR to SONiC

In this section, you migrate the router from Cisco IOS XR to SONiC OS.

  1. Migrate the route processor from Cisco IOS XR software to SONiC image using one of the two options:

    • Setup a DHCP or PXE server to host a SONiC installer image as part of the default URL option. Use this server to automatically boot ONIE image.

      a. Copy ONIE image onie-recovery-x86_64-cisco_8000-r0.efi64.pxe and SONiC image sonic-cisco-8000.bin to the PXE server.

      b. Add an entry for the image in PXE server’s dhcpd.conf file and restart the dhcpd process. The following is a sample from a dhcpd.conf file for a DHCP server for files present in the root folder:

       subnet 203.0.113.0 netmask 255.255.255.0 {
        range 203.0.113.20 203.0.113.200;
        option default-url = "http://203.0.113.10/onie-recovery-x86_64-cisco_8000-r0.efi64.pxe.unsigned";
      }
      

      c. Run the command from the console prompt.

      Router#reload bootmedia network location all
      

      The RP boots into the iPXE mode.

      Note: With the DHCP server setup, the system downloads and installs the SONiC image automatically. If the installation does not start, go to step 4.

    • If the router does not have a configured DHCP server to boot from iPXE, follow these steps:

      a. Run the command from the console prompt.

      Router#reload bootmedia network location all
      

      b. Press the ESC key continuously to interrupt the RP boot and enter the BIOS Boot Manager menu. Select iPXE from the menu. The router boots into the iPXE mode.

      c. From the iPXE prompt, setup the network and boot the ONIE image.

      iPXE> set net0/ip 1.2.10.11
      iPXE> set net0/gateway 1.2.10.1
      iPXE> set net0/netmask 255.255.0.0
      iPXE> ifopen net0
      iPXE> boot http://1.2.15.6/<path>/onie-recovery-x86_64-cisco_8000-r0.efi64.pxe.unsigned
      

      ONIE installation starts in the ONIE: Embed ONIE mode. ONIE is installed to dev/sda location.

      Booting 'ONIE: Embed ONIE'
      ONIE: Embedding ONIE ...
      Platform : x86_64-cisco_8000-r0 [ initrd.xz 24.63 MiB 100% 3.45MiB/s ]
      Version : <version>
      Build Date: 2021-10-04T18:14+00:00
      [ 4.506553] mtdoops: mtd device (mtddev=name/number) must be supplied
      [ 6.854750] ixgbe 0000:04:00.0: HW Init failed: -17
      Info: Mounting kernel filesystems... done.
      [ 8.048252] cisco_util: loading out-of-tree module taints kernel.
      Info: Bypassing DHCP to embed local image
      Info: Mounting ONIE-BOOT on /mnt/onie-boot...
      Info: Mounting EFI System on /boot/efi...
      Info: BIOS mode: UEFI
      Info: Using Eth0 MAC address: aa:bb:cc:dd:ee:ff
      Info: eth0: Checking link...up
      ONIE: eth0: Using static IP config: ip=127.0.0.1
      Starting: klogd... done.
      Starting: dropbear ssh daemon... done.
      Starting: telnetd... done.
      discover: ONIE embed mode detected. Running updater.
      Starting: discover... done
      ...
      
  2. After ONIE is installed, the router reboots in the ONIE: Install OS mode by default. The installer looks for configured locations to install ONIE, and reads the platform information from the IDPROM.

    Booting 'ONIE: Install OS'
    ONIE: OS Install Mode ...
    Platform : x86_64-cisco_8000-r0
    Version : <version>
    Build Date: 2022-10-04T18:14+00:00
    [ 4.506553] mtdoops: mtd device (mtddev=name/number) must be supplied
    [ 6.854750] ixgbe 0000:04:00.0: HW Init failed: -17
    Info: Mounting kernel filesystems... done.
    [ 8.048252] cisco_util: loading out-of-tree module taints kernel.
    ...
    Please press Enter to activate this console. Info: eth0: Checking link... up.
    Info: Trying DHCPv4 on interface: eth0
    ONIE: Using DHCPv4 addr: eth0: 1.2.14.61 / 255.255.0.0
    ONIE: Starting ONIE Service Discovery
    ...
    NOTICE: ONIE started in NOS install mode. Install mode persists
    NOTICE: until a NOS installer runs successfully.
    

    ONIE enters the discovery mode where it searches for network OS (SONiC) install images. When a valid image is found either on the harddisk: or on the network location, ONIE automatically installs the SONiC image.

    Note: With the DHCP server setup, the system downloads and installs the SONiC image automatically.

    The following is a sample from a dhcpd.conf file for a DHCP server with the files present in the root folder:

    subnet 203.0.113.0 netmask 255.255.255.0 {
    range 203.0.113.20 203.0.113.200;
    option default-url =
    "http://203.0.113.10/onie-recovery-x86_64-cisco_8000-r0.efi64.pxe.unsigned";
    }
    

    However, if a SONiC install image is not copied to a location from where the installer picks the source, proceed to step 3.

  3. After ONIE is installed, ONIE discovery process starts. Perform this step only if the network is not setup, and the SONiC image is not configured to be picked up automatically. If the image is already configured in either the harddisk: or remote location, go to step 6.Stop ONIE discovery process at the ONIE prompt.

    ONIE# onie-stop
    ONIE# ip addr add 1.2.15.11/16 eth0
    ONIE# route add default gw 1.2.15.1 eth0
    
  4. Provide the SONiC installer image. This image self-extracts itself and installs the image in /dev/sda3 partition.

    ONIE# onie-nos-install http://1.2.15.6/<path>/sonic-cisco-8000.bin
    

    After the SONiC image is installed, the route processor reloads and boots up with the SONiC OS.

  5. Enter the username admin and password password at the SONiC login prompt.

    sonic login: admin
    Password:
    Last login: Fri June 3 18:52:14 UTC 2020 on ttyS0
    Linux sonic 4.19.0-9-cisco-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2022-06-03) x86_64
    You are on
     ____   ___  _   _ _  ____
    / ___| / _ \| \ | (_)/ ___|
    \___ \| | | | \|  | | |
     ___) | |_| | |\  | | | ___
     ____/ \___/|_| \_|_|\____|
    
    --- Software for Open Networking in the Cloud ---
    Unauthorized access and/or use are prohibited.
    All access and/or use are subject to monitoring.
    Help: http://azure.github.io/SONiC/
    
  6. View the image on the router.

    cisco@sonic:~$ sonic_installer list
    Current: SONiC-OS-cisco_202012.0-8dbd003f
    Next: SONiC-OS-cisco_202012.0-8dbd003f
    Available:
    SONiC-OS-cisco_202012.0-8dbd003f
    

    Here, the currently installed image, the image to be updated and the available images in the repository are the same.

  7. View the software version, and the list of docker images loaded on the router.

    cisco@sonic:~$ show version
    SONiC Software Version: SONiC.cisco_202012.0-8dbd003f
    Distribution: Debian 9.13
    Kernel: 4.19.0-9-cisco-amd64
    Build commit: 8dbd003f
    Build date: Fri June 3 07:37:25 UTC 2020
    Built by: user@host
    Platform: x86_64-8201_sys-r0
    HwSKU: 36x100Gb
    ASIC: cisco-8000
    Serial Number: FOC2219HITI
    Cisco Silicon One SDK: 1.33.1-SDK-1.5.2-13-g843fbac-sonic-1.33.1-sai152-dec9-651-1
    Cisco Whitebox BSP: 0.1.11-29-gb022f2d
    Cisco Whitebox FPD: 0.1-22-gfbde9e1
    Cisco NP Suite: None
    Uptime: 19:16:08 up 7 min, 1 user, load average: 4.48, 3.12, 1.50
    Docker images:
    REPOSITORY                  TAG                              IMAGE ID                SIZE
    docker-saiserver            cisco_202012.0-8dbd003f          d53de4f53fb3            951MB
    docker-saiserver            latest                           d53de4f53fb3            951MB
    docker-syncd                cisco_202012.0-8dbd003f          67d9c3e6ee6a            719MB
    docker-syncd                latest                           67d9c3e6ee6a            719MB
    docker-sonic-telemetry      cisco_202012.0-8dbd003f          177aadb68a43            353MB
    docker-sonic-telemetry      latest                           177aadb68a43            353MB
    docker-router-advertiser    cisco_202012.0-8dbd003f          38379913e9fb            290MB
    docker-router-advertiser    latest                           38379913e9fb            290MB
    docker-sonic-mgmt-framework cisco_202012.0-8dbd003f          b1dc56ba080a            428MB
    docker-sonic-mgmt-framework latest                           b1dc56ba080a            428MB
    docker-platform-monitor     cisco_202012.0-8dbd003f          3509321ea1ee            369MB
    docker-platform-monitor     latest                           3509321ea1ee            369MB
    docker-lldp-sv2             cisco_202012.0-8dbd003f          e97b462e462b            312MB
    docker-lldp-sv2             latest                           e97b462e462b            312MB
    docker-fpm-frr              cisco_202012.0-8dbd003f          670471b0e015            335MB
    docker-fpm-frr              latest                           670471b0e015            335MB
    docker-sflow                cisco_202012.0-8dbd003f          fe7fb968d68d            315MB
    docker-sflow                latest                           fe7fb968d68d            315MB
    docker-dhcp-relay           cisco_202012.0-8dbd003f          1ac3c7600354            300MB
    docker-dhcp-relay           latest                           1ac3c7600354            300MB
    docker-database             cisco_202012.0-8dbd003f          9aed1565ac96            290MB
    docker-database             latest                           9aed1565ac96            290MB
    docker-orchagent            cisco_202012.0-8dbd003f          fcdffb142dbb            346MB
    docker-orchagent            latest                           fcdffb142dbb            346MB
    docker-teamd                cisco_202012.0-8dbd003f          2c007b95b38f            315MB
    docker-teamd                latest                           2c007b95b38f            315MB
    docker-nat                  cisco_202012.0-8dbd003f          5e9cd32094fa            316MB
    docker-nat                  latest                           5e9cd32094fa            316MB
    docker-snmp-sv2             cisco_202012.0-8dbd003f          64357fe71751            348MB
    docker-snmp-sv2             latest                           64357fe71751            348MB