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.
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!
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:
hostname: bizproxy, 192.168.10.1
management LAN: 192.168.10.0/24
required disk space: 10GB
file system web folder: /var/www/html/lanforge/r5.4.6
LAN URL: http://192.168.10.1/lanforge/r5.4.6/
Apache Directory config example:
Alias /private/downloads /var/www/html/lanforge
Alias /private/downloads/ /var/www/html/lanforge/
Alias /lanforge /var/www/html/lanforge
Alias /lanforge/ /var/www/html/lanforge/
<Directory /var/www/html/lanforge>
Require ip 192.168.10.0/24
Options +Indexes +FollowSymLinks
IndexOptions FancyIndexing FoldersFirst NameWidth=*
AllowOverride all
</Directory>
Nginx example:
location /lanforge/ {
root /var/www/html/lanforge;
autoindex on;
allow 192.168.10.0/24;
deny all;
}
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.
Size of the files files you would expect to mirror is about 8GB
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
After running mirror.bash, you now have a copy of the LANforge packages you want on bizproxy.
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+
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.
Use the above mirror script for mirroring the LANforge packages.
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"
This option is for mirroring the Bundle files only. This is useful if the default kernel version is acceptable.
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
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
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
The bundle upgrade is a standard manner of doing an offline upgrade.
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.
on the Fedora lanforge, configure a test-network port to serve HTTP.
edit the resulting vr_conf/nginx_eth3.conf
to add the Downloads directory:
# 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:
location /Downloads {
root /home/lanforge;
autoindex on;
}
and of course: remove the top line of the file
reset the port to make the changes take effect
first, tail the logfile:
[lanforge@ct523-jedway1 logs]$ pwd
/usr/local/lanforge/nginx/logs
[lanforge@ct523-jedway1 logs]$ tail -F br1000_error.log
next down and up the port. A simple port reset does not restart nginx
check on the Windows system to make sure you can browse the url:
Get the correct files into Fedora /home/lanforge/Downloads
:
wget https://www.candelatech.com/private/downloads/r5.4.6/LANforge-Server-5.4.6-upgrade.zip
check that you did not create LANforge-Server-5.4.6-upgrade.zip.1
Download on windows, or use posh wget:
Using Edge: click on the […] dots, select Keep, on next card select Extra Options → Keep
wget -o LANforge-Server-5.4.6-upgrade.zip http://10.40.0.1/Downloads/LANforge-Server-5.4.6-upgrade.zip
Stop LANforge on the windows system
Extract the zip file:
cd %env:PROGRAM<TAB><TAB>
tab complete to get to cd 'C:\Program Files (x86)\LANforge-Server\'
Expand-Archive -Path $HOME\Downloads\LANforge*upgrade.zip -Dest .
run the upgrade_lfconfig script:
.\upgrade_lfconfig.ps1
click OK
The server will have started
Check the LANforge manager system to check it has re-regeistered
In the Resources tab, you should see the host-name has returned
check the Build Date column to check the version is recent.