QuantaStor Local Update Mirror

From OSNEXUS Online Documentation Site
Revision as of 14:41, 22 April 2022 by Qadmin (Talk | contribs)

Jump to: navigation, search


Overview

Often times QuantaStor systems are deployed in sites where there's no public internet access. On these deployments the QuantaStor systems are unable to directly access packages.osnexus.com and in order for the systems to run upgrades they will need a local package mirror. The local package mirror is basically a VM which has a copy of the QuantaStor and other package files from packages.osnexus.com so that the local DNS server can be configured to resolve packages.osnexus.com to the local mirror within the datacenter.

There are a couple of methods by which a package mirror repository can be setup, those are:

  • Nginx + rsync of packages.osnexus.com
  • Apache + apt-mirror of packages.osnexus.com

Apache + apt-mirror Package Mirror Method

Follow the steps below to create a local mirror of the OSNEXUS QuantaStor update repository using apt-mirror for systems with Ubuntu 14.04 as its base operating system. The below instructions assume you already have an local Ubuntu server currently installed. For each instruction, the label [QS] will be instructions for the QuantaStor appliance, and the label [MIR] will be instructions for the mirror server.

Instructions

[MIR] 1. Elevate as root (sudo -i)

[MIR] 2. Update packages (apt-get update)

[MIR] 3. Install and enable Apache Web Server (apt install -y apache2 && systemctl enable apache2)

[MIR] 4. Create a package directory and set the correct permissions (mkdir -p /var/www/html/repo && chown www-data:www-data /var/www/html/repo)

[MIR] 5. Install apt-mirror (apt install -y apt-mirror)

[MIR] 6. Make a backup of /etc/apt/mirror.list (cp /etc/apt/mirror.list /etc/apt/mirror.list-bak)

[MIR] 7. Edit /etc/apt/mirror.list to be like the below:

############# config ##################
#
set base_path    /var/www/html/repo
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb http://packages.osnexus.com/packages trusty main
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
clean http://packages.osnexus.com/packages

[MIR] 8. Create a var folder in the local repo (mkdir -p /var/www/html/repo/var)

[MIR] 9. Copy /var/spool/apt-mirror/var/postmirror.sh to the var folder in the local repo (mkdir -p cp /var/spool/apt-mirror/var/postmirror.sh /var/www/html/repo/var)

[MIR] 10. Start the mirroring process (nohup apt-mirror &)

Note: Depending on your internet speed, this may take some time, but you can monitor the process with tail nohup.out. When it's finished, continue with step 11.

[QS] 11. Elevate as root (sudo -i)

[QS] 12. Make a copy of /etc/apt/sources.list and /etc/apt/sources.list.d/osnexus.list (cp /etc/apt/sources.list /etc/apt/sources.list.bk && cp /etc/apt/sources.list.d/osnexus.list /etc/apt/sources.list.d/osnexus.list.bk

[QS] 13. Edit /etc/apt/sources.list to be like the below:

deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty-updates main
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty universe
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty-updates universe
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty multiverse
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse

Note: Due to some oddities with apt-mirror, we have to specify using 64-bit with [arch=amd64]. If you don't, you'll see errors related to not being able to find 32-bit (i386) packages.

[QS] 14. Edit /etc/apt/sources.list.d/osnexus.list to be like the below:

deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/packages.osnexus.com/packages/ trusty main

[QS] 15. Update packages and upgrade QuantaStor (apt-get update && qs-upgrade)

Note: You may get stuck not being able to update the virt-what package. If this happens, you may either download (wget) and install (dpkg -i) the .deb package from a trusted source on the QuantaStor appliance, or download it to /var/www/html/repo/mirror/archive.ubuntu.com/ubuntu/pool/universe/v/virt-what.