Candela Technologies Logo
Network Testing and Emulation Solutions

Upgrading Offline LANforge Systems

Goal: upgrade a LANforge system that does not have access to the Internet.

LANforge systems are often in off-line or isolated test environments where the only updates they get can be brought to them on a laptop that can taken to the isolated network manually. Candelatech provides Bundle upgrades that contain all the files necessary for performing the equivalent of a lf_kinstall.pl --do_lanforge upgrade action. It is also possible to create a mirror of the software that LANforge systems can query. Offline bundle files were introduced in 5.4.1. Offline upgrade by listing files from lf_kinstall.pl was introduced in 5.3.3.

Proxy from Controller Method

Given a network gateway that allows one-way access to LANforge systems, an outside management laptop can be used to upgrade the offline LANforge systems. There is no need to mirror everything, because your LF systems do not span all combinations. You don’t want to mirror everything. It’s over 13GB. Also, If you do not have ssh-keys installed between bizproxy and the LF systems, this technique will prompt you for passwords!

Mirror Packages Proxy option

If the proxy has a web server URL on the management LAN where LF files can be cached, follow these steps to update the bundles on the proxy and upgrade the LF systems. This option mirrors the LANforge tar archives and not the bundles. For this example the proxy system will have these properties:

  1. On bizproxy, mirror files from www.candelatech.com to bizproxy. Below something close to the commands you would need to put into a shell script.

  2. Size of the files files you would expect to mirror is about 8GB

  3. mirror.bash:

    #!/bin/bash
    VER="5.4.6"
    OSV=F36
    CT="https://www.candelatech.com/private/downloads/r${VER}"
    cd /var/www/html/lanforge/r$VER
    curl -s -o lf_kinstall.pl ${CT}/lf_kinstall.pl
    curl -s -o list.html ${CT}/
    perl -ne '/a href="([^"]+)"/ && print "$1\n";' list.html > list.txt
    rm -f list2.txt
    perl -ne '/^((ath|board|ct[56]|firmware|interop-|LANforge-Server-).*)/ && print "$1\n"' list.txt > list2.txt
    perl -ne '/(LANforge-?GUI[-_]5.*)/ && print "$1\n"' list.txt >> list2.txt
    grep "[Lx].*[-]${OSV}" list.txt >> list2.txt
    mapfile -t URLS < list2.txt
    for file in "${URLS[@]}"; do echo "${CT}/${file}" ; done > urls.txt
    wget -i urls.txt
  4. After running mirror.bash, you now have a copy of the LANforge packages you want on bizproxy.

  5. From bizproxy, the below script can use the first argument as the IP of the system to upgrade. web_upgrade.bash:

    #!/bin/bash
    LFHOST=${1:-}
    if [ -z $LFHOST ]; then echo "Please specify hostname or ip"; exit 1; fi
    VER=5.4.6
    # specify a kernel version in parameter 2:
    KV=${2:=5.19.17+}
    BIZ="http://192.168.10.1/"
    scp lf_kinstall.pl root@${LFHOST}:/root/lf_kinstall.pl
    ssh root@${LF_HOST} "chmod +x /root/lf_kinstall.pl"
    ssh root@${LF_HOST} "/root/lf_kinstall.pl \
        --lfver $VER --kver $KV \
        --do_lanforge --skip_yum_all --skip_pip --skip_installer_check \
        --download_from $BIZ \
        --tmp_dir /home/lanforge/Downloads"

    Example: ./web_upgrade.bash 192.168.10.2 6.2.4+

SSH Copy Packages Option

If the LANforge cannot reach the proxy controller because of firewall or routing reasons, the proxy controller can copy the files to the LF system and use a local-only install with the lf_kinstall.pl --source_dir option.

  1. Use the above mirror script for mirroring the LANforge packages.

  2. Use a script like the one below to query and copy the correct files to the LF system:

    #!/bin/bash
    cd /var/www/html/lanforge/r5.4.6
    LFHOST=${1:-}
    if [ -z $LFHOST ]; then echo "Please specify hostname or ip"; exit 1; fi
    # specify a kernel version in parameter 2:
    KV=${2:=5.19.17+}
    OSV=$(ssh lanforge@$LFHOST "awk -F\= '/VERSION_ID/{print \$2}' /etc/os-release")
    scp lf_kinstall.pl root@${LFHOST}:/root/lf_kinstall.pl
    ssh root@${LF_HOST} "chmod +x /root/lf_kinstall.pl"
    ssh root@{$LF_HOST} "/root/lf_kinstall.pl --print_only --show_urls \
        --skip_pip --skip_yum_all --do_upgrade \
        --lfver $VER --kver $KV | grep '# http' > /tmp/lf_list.txt"
    scp root@${LF_HOST}:/tmp/lf_list.txt /tmp
    mapfile -t urlz < /tmp/lf_list.txt
    for url in "${urlz[@]}"; do 
        file="${url##*/}"
        scp $file root@${LFHOST}:/home/lanforge/Downloads/
    done
    scp md5.txt root@${LFHOST}:/home/lanforge/Downloads/
    ssh root@${LFHOST} "/root/lf_kinstall.pl --offline \
        --lfver $VER --kver $KV --do_lanforge \
        --source_dir /home/lanforge/Downloads \
        --tmp_dir /var/tmp --skip_yum_all --skip_pip"

SSH Copy Bundles Option

This option is for mirroring the Bundle files only. This is useful if the default kernel version is acceptable.

  1. On bizproxy, mirror files from http://www.candelatech.com to bizproxy. Below something close to the commands you would need to put into a shell script.

    Sizes of the bundle files you would expect to mirror:

    $ ls Bundle*F{27,30,34,36}* | xargs du -shc
    1.7G    Bundle_lfver-5.4.6_kern-5.19.17+_osver-F27-i-27_x64.tar.xz
    1.7G    Bundle_lfver-5.4.6_kern-5.19.17+_osver-F30-i-30_x64.tar.xz
    1.7G    Bundle_lfver-5.4.6_kern-5.19.17+_osver-F34-i-34_x64.tar.xz
    1.7G    Bundle_lfver-5.4.6_kern-5.19.17+_osver-F36-i-36_x64.tar.xz
    6.7G    total
  2. We’ll call this “bundle_mirror.bash”:

    #!/bin/bash
    VER="5.4.6"
    CT="https://www.candelatech.com/private/downloads/r${VER}/"
    cd /var/www/html/lanforge/r$VER
    curl -s -o lf_kinstall.pl ${CT}/lf_kinstall.pl
    curl -s -o list.html ${CT}/
    perl -ne '/a href="([^"]+)"/ && print "$1\n";' list.html > list.txt
    perl -ne '/^(Bundle.*?(F(27|3[046])).*)/&& print "/$1\n"' list.txt > urls.txt
    wget -i urls.txt
  3. From bizproxy, the below script can use the first argument as the IP of the system to upgrade. scp_bundle_upgrade.bash:

    #!/bin/bash
    cd /var/www/html/lanforge/r5.4.6
    LFHOST=${1:-}
    if [ -z $LFHOST ]; then echo "Please specify hostname or ip"; exit 1; fi
    OSV=$(ssh lanforge@$LFHOST "awk -F\= '/VERSION_ID/{print \$2}' /etc/os-release")
    BNAME="Bundle_lfver_5.4.6_kern-5.19.17+_osver-F${OSV}-i-${OSV}_x64.tar.xz"
    scp $BNAME lanforge@${LFHOST}/home/lanforge/Downloads/
    scp lf_kinstall.pl root@${LFHOST}:/root/lf_kinstall.pl
    ssh root@${LF_HOST} "chmod +x /root/lf_kinstall.pl"
    ssh root@${LF_HOST} "./lf_kinstall.pl --use_bundle /home/lanforge/Downloads/$BNAME"

    Example: ./scp_bundle_upgrade.bash 192.168.10.2

Bundle method

The bundle upgrade is a standard manner of doing an offline upgrade.

Interop

Windows

Offline Windows lfserver upgrades will require a place to download the windows lanforge update zip from. The existing offline Bundle_lfver_X tar file does not include these files. Rather this requires the LANforge-Server-5.4.6-upgrade.zip file.

  1. on the Fedora lanforge, configure a test-network port to serve HTTP.

  2. edit the resulting vr_conf/nginx_eth3.conf to add the Downloads directory:

  3. # Remove the first line '# Autogenerated by ...' and edit the file as
    # desired for a custom config file.
    
    worker_processes        1;
    error_log logs/br1000_error.log;
    pid             /home/lanforge/vr_conf/nginx_br1000.pid;
    events {
        worker_connections  1024;
    }
    
    http {
        include       /usr/local/lanforge/nginx/conf/mime.types;
        default_type  application/octet-stream;
        access_log  logs/br1000_access.log;
        sendfile            on;
        keepalive_timeout  65; 
    
        server {
            listen       10.40.0.1:80 bind_dev=br1000;
            server_name  localhost;
            access_log  logs/br1000_host.access.log;
    
            location / { 
                root   html;
                index  index.html index.htm;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
            location /Downloads {
               root   /home/lanforge/;
               autoindex on;
            }
        }   
    }

    Notice the:

    1. location /Downloads {
          root   /home/lanforge;
          autoindex on;
      }
    2. and of course: remove the top line of the file

  4. reset the port to make the changes take effect

    1. first, tail the logfile:

      [lanforge@ct523-jedway1 logs]$ pwd
      /usr/local/lanforge/nginx/logs
      [lanforge@ct523-jedway1 logs]$ tail -F br1000_error.log 
    2. next down and up the port. A simple port reset does not restart nginx

  5. check on the Windows system to make sure you can browse the url:

  6. Get the correct files into Fedora /home/lanforge/Downloads:

    1. wget https://www.candelatech.com/private/downloads/r5.4.6/LANforge-Server-5.4.6-upgrade.zip

    2. check that you did not create LANforge-Server-5.4.6-upgrade.zip.1

  7. Download on windows, or use posh wget:

    1. Using Edge: click on the […] dots, select Keep, on next card select Extra Options → Keep

    2. wget -o LANforge-Server-5.4.6-upgrade.zip http://10.40.0.1/Downloads/LANforge-Server-5.4.6-upgrade.zip

  8. Stop LANforge on the windows system

  9. Extract the zip file:

    1. cd %env:PROGRAM<TAB><TAB> tab complete to get to cd 'C:\Program Files (x86)\LANforge-Server\'

    2. Expand-Archive -Path $HOME\Downloads\LANforge*upgrade.zip -Dest .

  10. run the upgrade_lfconfig script:

    1. .\upgrade_lfconfig.ps1

    2. click OK

    3. The server will have started

  11. Check the LANforge manager system to check it has re-regeistered

    1. In the Resources tab, you should see the host-name has returned

    2. check the Build Date column to check the version is recent.


Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog