QuantaStor Local Update Mirror: Difference between revisions

From OSNEXUS Online Documentation Site
Jump to navigation Jump to search
Show a link-styled [Expand] control beside each Example output label.
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:local_update_mirror]]
This page describes how to upgrade QuantaStor systems that have no internet access, using a local copy of the QuantaStor package repository. It covers where to host the copy, how to download and check it, and how to point the QuantaStor systems at it.
 
# [[#Choose where to host the mirror|Choose where to host the mirror]].
# [[#Download the QuantaStor repository|Download the QuantaStor repository]] with rsync.
# [[#Check the mirror before an upgrade|Check the mirror]] holds the release you plan to install.
# [[#Allow the QuantaStor systems to reach the mirror|Make the mirror reachable]] from the QuantaStor systems.
# [[#Point the QuantaStor systems at the mirror|Point the QuantaStor systems at the mirror]] and disable the Ubuntu package sources they cannot reach.
# [[#Upgrade as normal|Upgrade as normal]].


== Overview ==
== 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.
QuantaStor systems at sites with no public internet access cannot reach packages.osnexus.com, so they need a local mirror of the repository to run upgrades. The mirror is a server or VM that holds a copy of the QuantaStor repository and serves it over HTTP. The QuantaStor systems reach it through their apt configuration, or through your internal DNS resolving packages.osnexus.com to the mirror.


There are a couple of methods by which a package mirror repository can be setup, those are:
Update the mirror before each upgrade, and check it again before the upgrade window. The mirror holds whichever release is current when you sync it.


* Nginx + rsync of packages.osnexus.com
== Choose where to host the mirror ==
* Apache + apt-mirror of packages.osnexus.com


== Nginx + RSync Package Mirror Method ==
Pick the option that fits how your site connects to the internet.


The Nginx + RSync method is the simplest and most common way to mirror the OSNexus package repository at packages.osnexus.com.
{| class="wikitable"
! Option !! Where the mirror runs !! How the QuantaStor systems reach it
|-
| [[#Option 1: Ubuntu server with nginx on port 80|Option 1]] || An Ubuntu server or VM inside your network that can also reach the internet, such as a jump host || Port 80, by apt configuration or internal DNS
|-
| [[#Option 2: qs_rsync_mirror.sh|Option 2]] || An Ubuntu server or VM inside your network that can also reach the internet, such as a jump host, set up by a script || Port 9999, by apt configuration
|-
| [[#Option 3: Removable drive|Option 3]] || Downloaded on a machine with internet access and carried in on a removable drive, then copied to a mirror server inside your network or served straight from the drive || Port 80 or 9999, as for the mirror server, or 9999 from the drive
|}


Follow the steps below to create a local mirror of the OSNEXUS QuantaStor update repository.
A QuantaStor VM can also host the mirror. See [[#Hosting the mirror on a QuantaStor VM|Hosting the mirror on a QuantaStor VM]].


1. Contact support@osnexus.com to request that your SSH public key be added to the OSNEXUS QuantaStor replication mirror for rsync access. Support can also assist with the below process and any questions you may have.
=== Option 1: Ubuntu server with nginx on port 80 ===


2. Setup a Linux VM with a web server, below is an example config file using nginx on Ubuntu 18.04 or newer:
Install nginx and rsync:
<pre style="font-size: smaller">
apt-get install -y nginx rsync
</pre>


Edit the /etc/nginx/sites-enabled/osnexus-mirror file. '''Please note. The file may be different depending on your nginx version or Linux OS. '''
Create the file {{Code|1=/etc/nginx/sites-enabled/osnexus-mirror}} with the contents below. Replace "yourserver.example.net" with the mirror server's DNS name. The packages.osnexus.com entry lets the mirror answer when your internal DNS points that name at it. '''The file location may differ with other nginx versions or Linux distributions.'''
 
'''Replace''' yourserver.example.net with your web server DNS FQDN.
 
<pre>


<pre style="font-size: smaller">
#
#
# A virtual host entry for an OSNEXUS QuantaStor mirror
# A virtual host entry for an OSNEXUS QuantaStor mirror
Line 31: Line 45:


server {
server {
     listen      80;
     listen      80 default_server;
     server_name  yourserver.example.net packages;
     server_name  yourserver.example.net packages packages.osnexus.com;
     location / {
     location / {
         root /var/lib/www/packages-root;
         root /var/lib/www/packages-root;
Line 40: Line 54:
</pre>
</pre>


Now restart and ensure it is enabled to startup automatically.
Ubuntu's nginx package enables a default site that answers requests made by IP address or by any name not listed above, so the mirror returns "404 Not Found" until it is removed. Remove it, check the configuration and restart nginx:
 
<pre style="font-size: smaller">
<pre>
rm -f /etc/nginx/sites-enabled/default
nginx -t
systemctl enable nginx
systemctl enable nginx
systemctl restart nginx
systemctl restart nginx
</pre>
</pre>


3. ensure your ssh key is available for the root user as the id_rsa file under /root/.ssh/
Then download the repository as described in [[#Download the QuantaStor repository|Download the QuantaStor repository]].
 
=== Option 2: qs_rsync_mirror.sh ===
 
The {{Code|1=qs_rsync_mirror.sh}} script downloads the repository with rsync into {{Code|1=/var/lib/www/packages-root}} and, with the {{Code|1=-n}} option, adds an nginx site on port 9999. By default it skips the RHEL repositories and the older Ubuntu releases.
 
On the Ubuntu server, install nginx and rsync, download the script and run it. The script checks that nginx is installed before it does anything, including when it only downloads.
<pre style="font-size: smaller">
apt-get install -y nginx rsync
curl -O http://packages.osnexus.com/packages/quantastor-jammy/scripts/qs_rsync_mirror.sh
bash qs_rsync_mirror.sh -n
</pre>
<div class="mw-collapsible mw-collapsed">
<div class="mw-collapsible-toggle" style="float: none;">'''Example output''' <span class="mw-collapsible-toggle-default"><span class="mw-collapsible-text">Expand</span></span></div>
<div class="mw-collapsible-content">
<pre style="font-size: smaller">
Creating credentials file in /tmp: /tmp/qs_rsync_mirror.credentials
Using existing exclude file: /var/lib/www/packages-root/exclude.list
Exclusions in /var/lib/www/packages-root/exclude.list:
index.html
precise/
trusty/
packages-redhat/
quantastor-rhel/
quantastor-redhat/
quantastor-xenial/
quantastor-bionic/
quantastor-focal-optional/
Bandwidth limit set to 50 Mbps.
Starting rsync process with options: -a --quiet
Mirror sync completed successfully.
Setting up Nginx configuration at /etc/nginx/sites-enabled/osnexus-mirror
Reloading Nginx...
Nginx is running and configuration was successfully reloaded.


4. Run an initial rsync to synchronize the QuantaStor update repo using the credentials and SSH key setup with the OSNEXUS support team in step 1.
Please update your apt configuration on any quantastor systems to point to the new local mirror: http://<ip>:9999/packages
Example: /etc/apt/sources.list.d/osnexus.list with the following content:


<pre>
deb http://<ip>:9999/packages/ quantastor-focal main
rsync -aPv rsync://YOURUSER@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/
</pre>
</pre>
</div>
</div>
Use {{Code|1=-d}} to download to a different directory, for example on a larger data disk, and {{Code|1=-b}} to change the download bandwidth limit from the default of 50 Mbps. At the default limit the first download takes around two hours. Run the script with {{Code|1=-h}} for all options.


5. Add a cron entry that will run every day to synchronize your local mirror with the QuantaStor repo. Note that this requires ssh access from your mirror server to pkgmirror.osnexus.com
When it finishes, the script prints an example apt line that names the {{Code|1=quantastor-focal}} suite. Use the line for your platform from [[#apt method|apt method]] instead. With this option the QuantaStor systems' apt source is {{Code|1=<nowiki>http://yourserver.example.net:9999/packages</nowiki>}}, and the [[#DNS method|DNS method]] does not apply.


<pre>
=== Option 3: Removable drive ===
edit the /etc/cron.d/osnexus-mirror-sync file and add the below contents:
 
0 02 * * * root /usr/bin/rsync -aPv rsync://YOURUSER@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/
In an air-gapped environment, stage the repository with a removable drive. Download it to the drive on a machine with internet access, carry the drive in, and copy the repository onto a mirror server inside your network, which then serves it like any other mirror.
 
Format the drive as ext4. The download keeps Linux ownership and permissions on every file, which filesystems such as exFAT and NTFS cannot store. The examples below mount the drive at {{Code|1=/mnt/qsmirror}}.
 
On the machine with internet access, with the drive mounted, install nginx and rsync, download the script and run it with {{Code|1=-d}} pointing at the drive. The script needs nginx installed even though it does not serve anything here.
<pre style="font-size: smaller">
apt-get install -y nginx rsync
curl -O http://packages.osnexus.com/packages/quantastor-jammy/scripts/qs_rsync_mirror.sh
bash qs_rsync_mirror.sh -d /mnt/qsmirror/packages-root
</pre>
</pre>


6. Add your new local mirror to your QuantaStor systems for all updates:
==== Stage the repository on a mirror server ====


'''Replace''' yourserver.example.net with your web server DNS FQDN.
Unmount the drive, carry it in, and mount it at {{Code|1=/mnt/qsmirror}} on the mirror server inside your network. Copy the repository to the directory the mirror serves:
<pre style="font-size: smaller">
rsync -a /mnt/qsmirror/packages-root/ /var/lib/www/packages-root/
</pre>


<pre>
Then serve it on port 80 with the [[#Option 1: Ubuntu server with nginx on port 80|Option 1]] nginx configuration, or on port 9999 with {{Code|1=qs_rsync_mirror.sh}}, skipping the download:
echo 'deb http://yourserver.example.net/packages quantastor-bionic main' > /etc/apt/sources.list.d/osnexus.list
<pre style="font-size: smaller">
bash qs_rsync_mirror.sh -s -n
</pre>
</pre>


If you need any further assistance, please contact support@osnexus.com.
As in Option 2, the script ends with an example apt line for {{Code|1=quantastor-focal}}. Use the line for your platform from [[#apt method|apt method]] instead.


== Apache + apt-mirror Package Mirror Method ==
To refresh the mirror before a later upgrade, sync the drive again on the machine with internet access and repeat the copy. rsync copies only what has changed.


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.
==== Serve directly from the drive ====


[QS] label indicates commands will to run on your QuantaStor systems
You can also serve the repository straight from the drive, without a mirror server, using the web server built into Python. It needs nothing installed and runs as an ordinary user:
<pre style="font-size: smaller">
cd /mnt/qsmirror/packages-root
python3 -m http.server 9999
</pre>
 
The Python web server runs only while the command runs, and stops when you press Ctrl+C. Leave it running until the upgrade is complete on every QuantaStor system, including any later Ceph cluster upgrade. The QuantaStor systems' apt source is {{Code|1=<nowiki>http://yourserver.example.net:9999/packages</nowiki>}}.


[MIR] label indicates commands to run on your package mirror server / VM
The same Python command can serve a repository downloaded by any of the other options, from the top level of the download, {{Code|1=/var/lib/www/packages-root}} by default.


=== Instructions ===
=== Hosting the mirror on a QuantaStor VM ===


[MIR] 1. Elevate as root (<code>sudo -i</code>)
A QuantaStor VM can host the mirror, using {{Code|1=qs_rsync_mirror.sh}}, which ships on QuantaStor systems. On a QuantaStor VM:


[MIR] 2. Update packages (<code>apt-get update</code>)
* A QuantaStor VM used as the mirror needs its own license key. See [[License Management]].
* The script serves the mirror on port 9999 and leaves the web interface on ports 80 and 443 as it is.
* Do not use the Option 1 configuration. nginx on a QuantaStor system already serves the web interface on ports 80 and 443, so the DNS method is not available either.
* Check the free space before the first download. The repository needs about 48 GB, which can be more than the root volume of a QuantaStor VM has free. Add {{Code|1=-d}} followed by a directory on a larger disk to put it there.
* Keep the mirror off the QuantaStor systems you are upgrading. Each one restarts its services and reboots during its upgrade, and the mirror would be unavailable to the others while it does.


[MIR] 3. Install and enable Apache Web Server (<code>apt install -y apache2 && systemctl enable apache2</code>)
To download the repository and serve it on port 9999:
<pre style="font-size: smaller">
/opt/osnexus/quantastor/bin/qs_rsync_mirror.sh -n
</pre>


[MIR] 4. Create a package directory and set the correct permissions (<code>mkdir -p /var/www/html/repo && chown www-data:www-data /var/www/html/repo</code>)
To serve a repository staged from a removable drive as in [[#Option 3: Removable drive|Option 3]], copy it into place and run the script without the download:
<pre style="font-size: smaller">
rsync -a /mnt/qsmirror/packages-root/ /var/lib/www/packages-root/
/opt/osnexus/quantastor/bin/qs_rsync_mirror.sh -s -n
</pre>


[MIR] 5. Install apt-mirror (<code>apt install -y apt-mirror</code>)
== Download the QuantaStor repository ==


[MIR] 6. Make a backup of /etc/apt/mirror.list (<code>cp /etc/apt/mirror.list /etc/apt/mirror.list-bak</code>)
OSNEXUS provides an rsync copy of the QuantaStor repository at pkgmirror.osnexus.com, and rsync is the supported way to download it. After the first download, rsync only fetches what has changed. The online repository at packages.osnexus.com does not allow directory listing, so recursive download tools such as wget cannot mirror it.


[MIR] 7. Edit /etc/apt/mirror.list to be like the below:
The full repository is about 84 GB. Excluding the RHEL repositories and the older Ubuntu releases brings it to about 48 GB. Both grow with each release. {{Code|1=qs_rsync_mirror.sh}} applies similar exclusions by default, and so does the command below. Remove its {{Code|1=--exclude}} options to download everything.


<pre>
=== Run an initial rsync ===
############# config ##################
<pre style="font-size: smaller">
#
mkdir -p /var/lib/www/packages-root/
set base_path    /var/www/html/repo
RSYNC_PASSWORD=guest rsync -aPv --exclude=packages-redhat/ --exclude=quantastor-rhel/ --exclude=quantastor-xenial/ --exclude=quantastor-bionic/ --exclude=precise/ --exclude=trusty/ rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/
#
</pre>
# set mirror_path  $base_path/mirror
 
# set skel_path    $base_path/skel
=== Update an existing mirror ===
# set var_path    $base_path/var
To update the mirror on a schedule, create the file {{Code|1=/etc/cron.d/osnexus-mirror-sync}} with the line below, which runs daily at 02:00. Running the rsync command on its own does a one-time update.
# set cleanscript $var_path/clean.sh
<pre style="font-size: smaller">
# set defaultarch  <running host architecture>
0 02 * * * root RSYNC_PASSWORD=guest /usr/bin/rsync -aPv --exclude=packages-redhat/ --exclude=quantastor-rhel/ --exclude=quantastor-xenial/ --exclude=quantastor-bionic/ --exclude=precise/ --exclude=trusty/ rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/
# set postmirror_script $var_path/postmirror.sh
</pre>
# set run_postmirror 0
 
set nthreads    20
'''Note.''' The mirror decides which versions an upgrade installs. The QuantaStor upgrade installs the newest QuantaStor packages on the mirror, and the Ceph cluster upgrade targets the Ceph version named in the mirror's {{Code|1=upgrade.conf}}. If you plan to upgrade QuantaStor first and Ceph in a later maintenance window, disable the scheduled sync between the two unless you intend to move to a newer release.
set _tilde 0
 
#
== Check the mirror before an upgrade ==
############# end config ##############
On the mirror server, after the sync, compare the mirror's release date and newest QuantaStor version with the online repository. This example is for QuantaStor systems based on Ubuntu 22.04, jammy. Replace {{Code|1=quantastor-jammy}} with {{Code|1=quantastor-focal}} or {{Code|1=quantastor-noble}} for those platforms, and {{Code|1=/var/lib/www/packages-root}} with the download directory if you changed it.
<pre style="font-size: smaller">
grep '^Date:' /var/lib/www/packages-root/packages/dists/quantastor-jammy/Release
zcat /var/lib/www/packages-root/packages/dists/quantastor-jammy/main/binary-amd64/Packages.gz | awk '/^Package: qstorservice$/{p=1} p && /^Version:/{print $2; p=0}' | sort -V | tail -1
curl -s http://packages.osnexus.com/packages/dists/quantastor-jammy/Release | grep '^Date:'
</pre>
<div class="mw-collapsible mw-collapsed">
<div class="mw-collapsible-toggle" style="float: none;">'''Example output''' <span class="mw-collapsible-toggle-default"><span class="mw-collapsible-text">Expand</span></span></div>
<div class="mw-collapsible-content">
<pre style="font-size: smaller">
Date: Mon, 14 Sep 2026 12:08:50 GMT
6.8.6.015+454592a831-1
Date: Mon, 14 Sep 2026 12:08:50 GMT
</pre>
</div>
</div>
 
The first and third dates should match, and the version should be the release you plan to install. See the [[QuantaStor Version ChangeLog]] for the current release. If the mirror is behind the online repository, contact OSNEXUS Support before the upgrade window.


deb http://packages.osnexus.com/packages trusty main
After you point a QuantaStor system at the mirror as described below, you can confirm on that system which QuantaStor version the upgrade will install and which Ceph version a Ceph cluster upgrade will target:
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
<pre style="font-size: smaller">
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
apt-get update
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
apt-cache policy qstorservice
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
curl -s http://yourserver.example.net/packages/quantastor-jammy/scripts/upgrade.conf | grep CEPH_VER
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
</pre>
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
<div class="mw-collapsible mw-collapsed">
clean http://archive.ubuntu.com/ubuntu
<div class="mw-collapsible-toggle" style="float: none;">'''Example output''' <span class="mw-collapsible-toggle-default"><span class="mw-collapsible-text">Expand</span></span></div>
clean http://packages.osnexus.com/packages
<div class="mw-collapsible-content">
<pre style="font-size: smaller">
qstorservice:
  Installed: 6.7.2.003+ad12621f62-1
  Candidate: 6.8.6.015+454592a831-1
  Version table:
(version table omitted)
CEPH_VER=20.2.2
</pre>
</pre>
</div>
</div>
The "Candidate" line shows the QuantaStor version. With a mirror on port 9999, add :9999 after the server name in the curl command.


[MIR] 8. Create a var folder in the local repo (<code>mkdir -p /var/www/html/repo/var</code>)
== Allow the QuantaStor systems to reach the mirror ==
The machine that downloads the repository needs outbound access to pkgmirror.osnexus.com on TCP port 873 for rsync. The QuantaStor systems need to reach the mirror on TCP port 80 or 9999, depending on how it is served.


[MIR] 9. Copy /var/spool/apt-mirror/var/postmirror.sh to the var folder in the local repo (<code>mkdir -p cp /var/spool/apt-mirror/var/postmirror.sh /var/www/html/repo/var</code>)
Each site has different requirements beyond that. In some cases the mirror server sits behind a firewall that is opened to the internet for the download, then closed to the internet and opened to the internal QuantaStor systems. In others the repository is downloaded, scanned, and carried in as in Option 3. Site policies determine how you handle this step.


[MIR] 10. Start the mirroring process (<code>nohup apt-mirror &</code>)
== Point the QuantaStor systems at the mirror ==
On the QuantaStor systems, {{Code|1=/etc/apt/sources.list.d/osnexus.list}} points at packages.osnexus.com, which they cannot reach. Use one of the two methods below.


'''Note:''' Depending on your internet speed, this may take some time, but you can monitor the process with <code>tail nohup.out</code>. When it's finished, continue with step 11.
=== DNS method ===
Point packages.osnexus.com at the mirror server in your internal DNS. The Option 1 nginx configuration answers for that name. This method does not work with a mirror on port 9999.


[QS] 11. Elevate as root (<code>sudo -i</code>)
=== apt method ===
Replace the contents of {{Code|1=/etc/apt/sources.list.d/osnexus.list}} on each QuantaStor system with a single line for your platform. Replace "yourserver.example.net" with the mirror server's DNS name or IP address, and add :9999 after it for a mirror on port 9999.


[QS] 12. Make a copy of /etc/apt/sources.list and /etc/apt/sources.list.d/osnexus.list (<code>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</code>
<pre style="font-size: smaller">
# focal, Ubuntu 20.04 based QuantaStor systems
echo 'deb http://yourserver.example.net/packages quantastor-focal main' > /etc/apt/sources.list.d/osnexus.list


[QS] 13. Edit /etc/apt/sources.list to be like the below:
# jammy, Ubuntu 22.04 based QuantaStor systems
echo 'deb http://yourserver.example.net/packages quantastor-jammy main' > /etc/apt/sources.list.d/osnexus.list


<pre>
# noble, Ubuntu 24.04 based QuantaStor systems
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/archive.ubuntu.com/ubuntu/ trusty-updates main
echo 'deb http://yourserver.example.net/packages quantastor-noble main' > /etc/apt/sources.list.d/osnexus.list
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
</pre>
</pre>


'''Note:''' Due to some oddities with apt-mirror, we have to specify using 64-bit with <code>[arch=amd64]</code>. If you don't, you'll see errors related to not being able to find 32-bit (i386) packages.
Keep {{Code|1=osnexus.list}} to a single deb line in this form. The Ceph cluster upgrade reads the repository address and suite from this file.


[QS] 14. Edit /etc/apt/sources.list.d/osnexus.list to be like the below:
=== Disable the Ubuntu package sources ===
The upgrade runs {{Code|1=apt-get update}} and {{Code|1=apt-get upgrade}}, which read every package source on the system, including the Ubuntu sources in {{Code|1=/etc/apt/sources.list}}. An unreachable source does not stop the upgrade, but it slows down every {{Code|1=apt-get update}} while the lookups fail. Disable these sources on each QuantaStor system before the upgrade:
<pre style="font-size: smaller">
sed -i -E 's/^(deb(-src)? .*ubuntu\.com.*)/# \1/' /etc/apt/sources.list /etc/apt/sources.list.d/*.list
</pre>


<pre>
If the system has {{Code|1=/etc/apt/sources.list.d/ubuntu.sources}}, which uses the deb822 format, disable it as well:
deb [arch=amd64] http://<YOUR_MIR_IP>/repo/mirror/packages.osnexus.com/packages/ trusty main
<pre style="font-size: smaller">
sed -i '/^Types:/i Enabled: no' /etc/apt/sources.list.d/ubuntu.sources
</pre>
</pre>


[QS] 15. Update packages and upgrade QuantaStor (<code>apt-get update && qs-upgrade</code>)
The Ubuntu packages that OSNEXUS publishes in the QuantaStor repository, such as security updates, still install from the mirror.
 
== Upgrade as normal ==
Upgrade the QuantaStor systems with the [[Upgrade Manager]] in the web interface or with the CLI, as you would with internet access.
 
OSNEXUS Support supports this process for licensed QuantaStor deployments. For further assistance, see https://www.osnexus.com for support options.
 
== Related pages ==
* [[Upgrade Manager]]
* [[QuantaStor Version ChangeLog]]


'''Note:''' You may get stuck not being able to update the virt-what package. If this happens, you may either download (<code>wget</code>) and install (<code>dpkg -i</code>) 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.
----
<small>''Verified against QuantaStor 6.8.6.''</small>

Latest revision as of 16:08, 13 October 2026

This page describes how to upgrade QuantaStor systems that have no internet access, using a local copy of the QuantaStor package repository. It covers where to host the copy, how to download and check it, and how to point the QuantaStor systems at it.

  1. Choose where to host the mirror.
  2. Download the QuantaStor repository with rsync.
  3. Check the mirror holds the release you plan to install.
  4. Make the mirror reachable from the QuantaStor systems.
  5. Point the QuantaStor systems at the mirror and disable the Ubuntu package sources they cannot reach.
  6. Upgrade as normal.

Overview

QuantaStor systems at sites with no public internet access cannot reach packages.osnexus.com, so they need a local mirror of the repository to run upgrades. The mirror is a server or VM that holds a copy of the QuantaStor repository and serves it over HTTP. The QuantaStor systems reach it through their apt configuration, or through your internal DNS resolving packages.osnexus.com to the mirror.

Update the mirror before each upgrade, and check it again before the upgrade window. The mirror holds whichever release is current when you sync it.

Choose where to host the mirror

Pick the option that fits how your site connects to the internet.

Option Where the mirror runs How the QuantaStor systems reach it
Option 1 An Ubuntu server or VM inside your network that can also reach the internet, such as a jump host Port 80, by apt configuration or internal DNS
Option 2 An Ubuntu server or VM inside your network that can also reach the internet, such as a jump host, set up by a script Port 9999, by apt configuration
Option 3 Downloaded on a machine with internet access and carried in on a removable drive, then copied to a mirror server inside your network or served straight from the drive Port 80 or 9999, as for the mirror server, or 9999 from the drive

A QuantaStor VM can also host the mirror. See Hosting the mirror on a QuantaStor VM.

Option 1: Ubuntu server with nginx on port 80

Install nginx and rsync:

apt-get install -y nginx rsync

Create the file /etc/nginx/sites-enabled/osnexus-mirror with the contents below. Replace "yourserver.example.net" with the mirror server's DNS name. The packages.osnexus.com entry lets the mirror answer when your internal DNS points that name at it. The file location may differ with other nginx versions or Linux distributions.

#
# A virtual host entry for an OSNEXUS QuantaStor mirror
#

server {
    listen       80 default_server;
    server_name  yourserver.example.net packages packages.osnexus.com;
    location / {
        root /var/lib/www/packages-root;
        autoindex on;
    }
}

Ubuntu's nginx package enables a default site that answers requests made by IP address or by any name not listed above, so the mirror returns "404 Not Found" until it is removed. Remove it, check the configuration and restart nginx:

rm -f /etc/nginx/sites-enabled/default
nginx -t
systemctl enable nginx
systemctl restart nginx

Then download the repository as described in Download the QuantaStor repository.

Option 2: qs_rsync_mirror.sh

The qs_rsync_mirror.sh script downloads the repository with rsync into /var/lib/www/packages-root and, with the -n option, adds an nginx site on port 9999. By default it skips the RHEL repositories and the older Ubuntu releases.

On the Ubuntu server, install nginx and rsync, download the script and run it. The script checks that nginx is installed before it does anything, including when it only downloads.

apt-get install -y nginx rsync
curl -O http://packages.osnexus.com/packages/quantastor-jammy/scripts/qs_rsync_mirror.sh
bash qs_rsync_mirror.sh -n
Example output Expand
Creating credentials file in /tmp: /tmp/qs_rsync_mirror.credentials
Using existing exclude file: /var/lib/www/packages-root/exclude.list
Exclusions in /var/lib/www/packages-root/exclude.list:
index.html
precise/
trusty/
packages-redhat/
quantastor-rhel/
quantastor-redhat/
quantastor-xenial/
quantastor-bionic/
quantastor-focal-optional/
Bandwidth limit set to 50 Mbps.
Starting rsync process with options: -a --quiet
Mirror sync completed successfully.
Setting up Nginx configuration at /etc/nginx/sites-enabled/osnexus-mirror
Reloading Nginx...
Nginx is running and configuration was successfully reloaded.

Please update your apt configuration on any quantastor systems to point to the new local mirror: http://<ip>:9999/packages
Example: /etc/apt/sources.list.d/osnexus.list with the following content:

deb http://<ip>:9999/packages/ quantastor-focal main

Use -d to download to a different directory, for example on a larger data disk, and -b to change the download bandwidth limit from the default of 50 Mbps. At the default limit the first download takes around two hours. Run the script with -h for all options.

When it finishes, the script prints an example apt line that names the quantastor-focal suite. Use the line for your platform from apt method instead. With this option the QuantaStor systems' apt source is http://yourserver.example.net:9999/packages, and the DNS method does not apply.

Option 3: Removable drive

In an air-gapped environment, stage the repository with a removable drive. Download it to the drive on a machine with internet access, carry the drive in, and copy the repository onto a mirror server inside your network, which then serves it like any other mirror.

Format the drive as ext4. The download keeps Linux ownership and permissions on every file, which filesystems such as exFAT and NTFS cannot store. The examples below mount the drive at /mnt/qsmirror.

On the machine with internet access, with the drive mounted, install nginx and rsync, download the script and run it with -d pointing at the drive. The script needs nginx installed even though it does not serve anything here.

apt-get install -y nginx rsync
curl -O http://packages.osnexus.com/packages/quantastor-jammy/scripts/qs_rsync_mirror.sh
bash qs_rsync_mirror.sh -d /mnt/qsmirror/packages-root

Stage the repository on a mirror server

Unmount the drive, carry it in, and mount it at /mnt/qsmirror on the mirror server inside your network. Copy the repository to the directory the mirror serves:

rsync -a /mnt/qsmirror/packages-root/ /var/lib/www/packages-root/

Then serve it on port 80 with the Option 1 nginx configuration, or on port 9999 with qs_rsync_mirror.sh, skipping the download:

bash qs_rsync_mirror.sh -s -n

As in Option 2, the script ends with an example apt line for quantastor-focal. Use the line for your platform from apt method instead.

To refresh the mirror before a later upgrade, sync the drive again on the machine with internet access and repeat the copy. rsync copies only what has changed.

Serve directly from the drive

You can also serve the repository straight from the drive, without a mirror server, using the web server built into Python. It needs nothing installed and runs as an ordinary user:

cd /mnt/qsmirror/packages-root
python3 -m http.server 9999

The Python web server runs only while the command runs, and stops when you press Ctrl+C. Leave it running until the upgrade is complete on every QuantaStor system, including any later Ceph cluster upgrade. The QuantaStor systems' apt source is http://yourserver.example.net:9999/packages.

The same Python command can serve a repository downloaded by any of the other options, from the top level of the download, /var/lib/www/packages-root by default.

Hosting the mirror on a QuantaStor VM

A QuantaStor VM can host the mirror, using qs_rsync_mirror.sh, which ships on QuantaStor systems. On a QuantaStor VM:

  • A QuantaStor VM used as the mirror needs its own license key. See License Management.
  • The script serves the mirror on port 9999 and leaves the web interface on ports 80 and 443 as it is.
  • Do not use the Option 1 configuration. nginx on a QuantaStor system already serves the web interface on ports 80 and 443, so the DNS method is not available either.
  • Check the free space before the first download. The repository needs about 48 GB, which can be more than the root volume of a QuantaStor VM has free. Add -d followed by a directory on a larger disk to put it there.
  • Keep the mirror off the QuantaStor systems you are upgrading. Each one restarts its services and reboots during its upgrade, and the mirror would be unavailable to the others while it does.

To download the repository and serve it on port 9999:

/opt/osnexus/quantastor/bin/qs_rsync_mirror.sh -n

To serve a repository staged from a removable drive as in Option 3, copy it into place and run the script without the download:

rsync -a /mnt/qsmirror/packages-root/ /var/lib/www/packages-root/
/opt/osnexus/quantastor/bin/qs_rsync_mirror.sh -s -n

Download the QuantaStor repository

OSNEXUS provides an rsync copy of the QuantaStor repository at pkgmirror.osnexus.com, and rsync is the supported way to download it. After the first download, rsync only fetches what has changed. The online repository at packages.osnexus.com does not allow directory listing, so recursive download tools such as wget cannot mirror it.

The full repository is about 84 GB. Excluding the RHEL repositories and the older Ubuntu releases brings it to about 48 GB. Both grow with each release. qs_rsync_mirror.sh applies similar exclusions by default, and so does the command below. Remove its --exclude options to download everything.

Run an initial rsync

mkdir -p /var/lib/www/packages-root/
RSYNC_PASSWORD=guest rsync -aPv --exclude=packages-redhat/ --exclude=quantastor-rhel/ --exclude=quantastor-xenial/ --exclude=quantastor-bionic/ --exclude=precise/ --exclude=trusty/ rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/

Update an existing mirror

To update the mirror on a schedule, create the file /etc/cron.d/osnexus-mirror-sync with the line below, which runs daily at 02:00. Running the rsync command on its own does a one-time update.

0 02 * * * root RSYNC_PASSWORD=guest /usr/bin/rsync -aPv --exclude=packages-redhat/ --exclude=quantastor-rhel/ --exclude=quantastor-xenial/ --exclude=quantastor-bionic/ --exclude=precise/ --exclude=trusty/ rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/

Note. The mirror decides which versions an upgrade installs. The QuantaStor upgrade installs the newest QuantaStor packages on the mirror, and the Ceph cluster upgrade targets the Ceph version named in the mirror's upgrade.conf. If you plan to upgrade QuantaStor first and Ceph in a later maintenance window, disable the scheduled sync between the two unless you intend to move to a newer release.

Check the mirror before an upgrade

On the mirror server, after the sync, compare the mirror's release date and newest QuantaStor version with the online repository. This example is for QuantaStor systems based on Ubuntu 22.04, jammy. Replace quantastor-jammy with quantastor-focal or quantastor-noble for those platforms, and /var/lib/www/packages-root with the download directory if you changed it.

grep '^Date:' /var/lib/www/packages-root/packages/dists/quantastor-jammy/Release
zcat /var/lib/www/packages-root/packages/dists/quantastor-jammy/main/binary-amd64/Packages.gz | awk '/^Package: qstorservice$/{p=1} p && /^Version:/{print $2; p=0}' | sort -V | tail -1
curl -s http://packages.osnexus.com/packages/dists/quantastor-jammy/Release | grep '^Date:'
Example output Expand
Date: Mon, 14 Sep 2026 12:08:50 GMT
6.8.6.015+454592a831-1
Date: Mon, 14 Sep 2026 12:08:50 GMT

The first and third dates should match, and the version should be the release you plan to install. See the QuantaStor Version ChangeLog for the current release. If the mirror is behind the online repository, contact OSNEXUS Support before the upgrade window.

After you point a QuantaStor system at the mirror as described below, you can confirm on that system which QuantaStor version the upgrade will install and which Ceph version a Ceph cluster upgrade will target:

apt-get update
apt-cache policy qstorservice
curl -s http://yourserver.example.net/packages/quantastor-jammy/scripts/upgrade.conf | grep CEPH_VER
Example output Expand
qstorservice:
  Installed: 6.7.2.003+ad12621f62-1
  Candidate: 6.8.6.015+454592a831-1
  Version table:
(version table omitted)
CEPH_VER=20.2.2

The "Candidate" line shows the QuantaStor version. With a mirror on port 9999, add :9999 after the server name in the curl command.

Allow the QuantaStor systems to reach the mirror

The machine that downloads the repository needs outbound access to pkgmirror.osnexus.com on TCP port 873 for rsync. The QuantaStor systems need to reach the mirror on TCP port 80 or 9999, depending on how it is served.

Each site has different requirements beyond that. In some cases the mirror server sits behind a firewall that is opened to the internet for the download, then closed to the internet and opened to the internal QuantaStor systems. In others the repository is downloaded, scanned, and carried in as in Option 3. Site policies determine how you handle this step.

Point the QuantaStor systems at the mirror

On the QuantaStor systems, /etc/apt/sources.list.d/osnexus.list points at packages.osnexus.com, which they cannot reach. Use one of the two methods below.

DNS method

Point packages.osnexus.com at the mirror server in your internal DNS. The Option 1 nginx configuration answers for that name. This method does not work with a mirror on port 9999.

apt method

Replace the contents of /etc/apt/sources.list.d/osnexus.list on each QuantaStor system with a single line for your platform. Replace "yourserver.example.net" with the mirror server's DNS name or IP address, and add :9999 after it for a mirror on port 9999.

# focal, Ubuntu 20.04 based QuantaStor systems
echo 'deb http://yourserver.example.net/packages quantastor-focal main' > /etc/apt/sources.list.d/osnexus.list

# jammy, Ubuntu 22.04 based QuantaStor systems
echo 'deb http://yourserver.example.net/packages quantastor-jammy main' > /etc/apt/sources.list.d/osnexus.list

# noble, Ubuntu 24.04 based QuantaStor systems
echo 'deb http://yourserver.example.net/packages quantastor-noble main' > /etc/apt/sources.list.d/osnexus.list

Keep osnexus.list to a single deb line in this form. The Ceph cluster upgrade reads the repository address and suite from this file.

Disable the Ubuntu package sources

The upgrade runs apt-get update and apt-get upgrade, which read every package source on the system, including the Ubuntu sources in /etc/apt/sources.list. An unreachable source does not stop the upgrade, but it slows down every apt-get update while the lookups fail. Disable these sources on each QuantaStor system before the upgrade:

sed -i -E 's/^(deb(-src)? .*ubuntu\.com.*)/# \1/' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

If the system has /etc/apt/sources.list.d/ubuntu.sources, which uses the deb822 format, disable it as well:

sed -i '/^Types:/i Enabled: no' /etc/apt/sources.list.d/ubuntu.sources

The Ubuntu packages that OSNEXUS publishes in the QuantaStor repository, such as security updates, still install from the mirror.

Upgrade as normal

Upgrade the QuantaStor systems with the Upgrade Manager in the web interface or with the CLI, as you would with internet access.

OSNEXUS Support supports this process for licensed QuantaStor deployments. For further assistance, see https://www.osnexus.com for support options.

Related pages


Verified against QuantaStor 6.8.6.