QuantaStor Local Update Mirror: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(29 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category: | [[index.php?title=Category:Local update mirror]] | ||
== Overview == | == Overview == | ||
QuantaStor systems are sometimes 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 will need a local package mirror repository to run QuantaStor upgrades. | |||
The local package mirror is usually a VM, which has a copy of the QuantaStor repository, 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 data center. | |||
Below is our supported method of creating a local repository. | |||
The basic process: | |||
# Setup the offline mirror VM which will run a web server to serve the packages to QuantaStor (nginx example below). | |||
# Download the QuantaStor repository (rsync example below, wget, ...) | |||
# Either move the downloaded QuantaStor repository to the location where your QuantaStor servers live or setup networking to allow your QuantaStor servers to see your offline QuantaStor repository. | |||
# Modify DNS so that the QuantaStor systems resolve packages.osnexus.com to point to your local QuantaStor repository OR modify certain /etc/apt files on each QuantaStor host to point to your QuantaStor repository (instead of packages.osnexus.com) | |||
# Perform upgrade as normal | |||
The offline QuantaStor repository will need to be updated before each upgrade. This could be done with a cron job as shown below. | |||
=== Setup the offline mirror VM and web server === | |||
Any web server can be used to serve the offline QuantaStor repository to QuantaStor hosts for upgrading. Below Nginx is used. This ships with the QuantaStor software so a simple community edition licensed QuantaStor VM could be used to host the offline QuantaStor repository. Any web server can be used. | |||
==== Setting up nginx on Ubuntu 18.04 or newer: ==== | |||
Edit the /etc/nginx/sites-enabled/osnexus-mirror file. '''Please note. The file may be different depending on your nginx version or Linux OS. ''' | Edit the /etc/nginx/sites-enabled/osnexus-mirror file. '''Please note. The file may be different depending on your nginx version or Linux OS. ''' | ||
Replace "yourserver.example.net" with your web server DNS FQDN.<pre> | |||
<pre> | |||
# | # | ||
Line 114: | Line 38: | ||
} | } | ||
} | } | ||
</pre>Now restart nginx and ensure it is enabled to startup automatically.<pre> | |||
systemctl enable nginx | |||
systemctl restart nginx | |||
</pre> | </pre> | ||
==== Alternative (less robust) Method of Serving the Offline QuantaStor Repository ==== | |||
Python has an internal web server that can be easily used to serve the offline QuantaStor repository files to the QuantaStor servers being upgraded. This is a CLI process that runs the server when started and if ^C stopped stops the web server. This is not a robust permanent solution but can be used for upgrades. | |||
< | Note on this command the server will listen on port 9999 not the normal port 80 (or 443). This means that the /etc/apt/sources* files will have to be changed to something like "http://<IP of offline QuantaStor repository>:9999/..." | ||
python3 -m http.server 9999 | |||
That command should be run in the top level repository directory (ie the location where the repository was downloaded to). | |||
=== Download the QuantaStor repository === | |||
The official online QuantaStor repository is accessible via http/s as well as the rsync protocol. In the example below, rsync is used to mirror. Rsync is useful because once your initial download has completed, future updates of your offline QuantaStor repository will only need to download new changes. (rsync can be used via the rsync protocol or rsync over ssh). | |||
As the online QuantaStor repository is also accessible via http/s, other tools such as wget, aptly, or other mirroring tools can be used to download the QuantaStor repository. | |||
==== Run an initial rsync to synchronize the QuantaStor update repository. ==== | |||
<pre> | <pre> | ||
rsync -aPv rsync:// | mkdir -p /var/lib/www/packages-root/ | ||
RSYNC_PASSWORD=guest rsync -aPv rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/ | |||
</pre> | </pre> | ||
==== Update an already rsync'd QuantaStor repository ==== | |||
For periodic automatic updates, add a cron entry that will run to synchronize your local mirror with the QuantaStor repository. The example below runs daily. Just running the rsync part of this command will do a one time update.<pre> | |||
<pre> | |||
edit the /etc/cron.d/osnexus-mirror-sync file and add the below contents: | edit the /etc/cron.d/osnexus-mirror-sync file and add the below contents: | ||
0 02 * * * root /usr/bin/rsync -aPv rsync:// | 0 02 * * * root RSYNC_PASSWORD=guest /usr/bin/rsync -aPv rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/ | ||
</pre> | </pre> | ||
=== Allow Offline QuantaStor Servers to See the Downloaded QuantaStor Repository === | |||
Each site will have different requirements for this process. In some cases, the downloaded QuantaStor repository server would be isolated from the protected network via a firewall change, opened up to the internet for the download or update of the repository, then isolated from the internet and opened to the internal QuantaStor servers. | |||
In another case, it may be download, scan, and physically move the offline QuantaStor repository to the location where the QuantaStor servers can see it. | |||
Site policies will determine how you handle this step. | |||
=== Modify DNS or /etc/apt Prior to Upgrades === | |||
On the QuantaStor systems to be upgraded, the /etc/apt/sources* files point to "packages.osnexus.com". Since they are offline, this cannot be accessed. | |||
One method to make offline QuantaStor systems upgradable from the offline QuantaStor repository server would be to edit all /etc/apt/sources* files (including sources.list.d sub-directory files) to change packages.osnexus.com to point to the DNS name or IP of the offline QuantaStor repository server you setup. NOTE other hostnames found in those files *.unbuntu.com do NOT need to be changed. The QuantaStor qs_upgrade.py does NOT use those. | |||
Another method would be to change your internal DNS server to point "packages.quantastor.com" to your downloaded offline QuantaStor repository server. | |||
The example below should only be referenced for a method to change these files. NOTE it references a specific version of QuantaStor (focal) which may not be installed (ie jammy). Do NOT use this command without understanding how you should modify it. | |||
Add your new local repository mirror to your QuantaStor systems for all updates: | |||
Replace "yourserver.example.net" with your web server DNS FQDN. | |||
<pre> | <pre> | ||
# for focal based quantastor deployments | |||
echo 'deb http://yourserver.example.net/packages quantastor-focal main' > /etc/apt/sources.list.d/osnexus.list | |||
# for bionic based QuantaStor deployments | |||
echo 'deb http://yourserver.example.net/packages quantastor-bionic main' > /etc/apt/sources.list.d/osnexus.list | echo 'deb http://yourserver.example.net/packages quantastor-bionic main' > /etc/apt/sources.list.d/osnexus.list | ||
</pre> | </pre> | ||
If you need any further assistance, please | === Perform upgrade as normal === | ||
After the above steps, QuantaStor hosts can be upgrade using all normal QuantaStor upgrade methods (Web UI, CLI) | |||
=== Summary === | |||
OSNEXUS Support will provide support for this process for licensed QuantaStor deployments. If you need any further assistance, please see https://www.osnexus.com for support options. |
Latest revision as of 15:57, 11 April 2025
index.php?title=Category:Local update mirror
Overview
QuantaStor systems are sometimes 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 will need a local package mirror repository to run QuantaStor upgrades.
The local package mirror is usually a VM, which has a copy of the QuantaStor repository, 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 data center.
Below is our supported method of creating a local repository.
The basic process:
- Setup the offline mirror VM which will run a web server to serve the packages to QuantaStor (nginx example below).
- Download the QuantaStor repository (rsync example below, wget, ...)
- Either move the downloaded QuantaStor repository to the location where your QuantaStor servers live or setup networking to allow your QuantaStor servers to see your offline QuantaStor repository.
- Modify DNS so that the QuantaStor systems resolve packages.osnexus.com to point to your local QuantaStor repository OR modify certain /etc/apt files on each QuantaStor host to point to your QuantaStor repository (instead of packages.osnexus.com)
- Perform upgrade as normal
The offline QuantaStor repository will need to be updated before each upgrade. This could be done with a cron job as shown below.
Setup the offline mirror VM and web server
Any web server can be used to serve the offline QuantaStor repository to QuantaStor hosts for upgrading. Below Nginx is used. This ships with the QuantaStor software so a simple community edition licensed QuantaStor VM could be used to host the offline QuantaStor repository. Any web server can be used.
Setting up nginx on Ubuntu 18.04 or newer:
Edit the /etc/nginx/sites-enabled/osnexus-mirror file. Please note. The file may be different depending on your nginx version or Linux OS.
Replace "yourserver.example.net" with your web server DNS FQDN.
# # A virtual host entry for an OSNEXUS QuantaStor mirror # server { listen 80; server_name yourserver.example.net packages; location / { root /var/lib/www/packages-root; autoindex on; } }
Now restart nginx and ensure it is enabled to startup automatically.
systemctl enable nginx systemctl restart nginx
Alternative (less robust) Method of Serving the Offline QuantaStor Repository
Python has an internal web server that can be easily used to serve the offline QuantaStor repository files to the QuantaStor servers being upgraded. This is a CLI process that runs the server when started and if ^C stopped stops the web server. This is not a robust permanent solution but can be used for upgrades.
Note on this command the server will listen on port 9999 not the normal port 80 (or 443). This means that the /etc/apt/sources* files will have to be changed to something like "http://<IP of offline QuantaStor repository>:9999/..."
python3 -m http.server 9999
That command should be run in the top level repository directory (ie the location where the repository was downloaded to).
Download the QuantaStor repository
The official online QuantaStor repository is accessible via http/s as well as the rsync protocol. In the example below, rsync is used to mirror. Rsync is useful because once your initial download has completed, future updates of your offline QuantaStor repository will only need to download new changes. (rsync can be used via the rsync protocol or rsync over ssh).
As the online QuantaStor repository is also accessible via http/s, other tools such as wget, aptly, or other mirroring tools can be used to download the QuantaStor repository.
Run an initial rsync to synchronize the QuantaStor update repository.
mkdir -p /var/lib/www/packages-root/ RSYNC_PASSWORD=guest rsync -aPv rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/
Update an already rsync'd QuantaStor repository
For periodic automatic updates, add a cron entry that will run to synchronize your local mirror with the QuantaStor repository. The example below runs daily. Just running the rsync part of this command will do a one time update.
edit the /etc/cron.d/osnexus-mirror-sync file and add the below contents: 0 02 * * * root RSYNC_PASSWORD=guest /usr/bin/rsync -aPv rsync://guest@pkgmirror.osnexus.com/packages /var/lib/www/packages-root/
Allow Offline QuantaStor Servers to See the Downloaded QuantaStor Repository
Each site will have different requirements for this process. In some cases, the downloaded QuantaStor repository server would be isolated from the protected network via a firewall change, opened up to the internet for the download or update of the repository, then isolated from the internet and opened to the internal QuantaStor servers.
In another case, it may be download, scan, and physically move the offline QuantaStor repository to the location where the QuantaStor servers can see it.
Site policies will determine how you handle this step.
Modify DNS or /etc/apt Prior to Upgrades
On the QuantaStor systems to be upgraded, the /etc/apt/sources* files point to "packages.osnexus.com". Since they are offline, this cannot be accessed.
One method to make offline QuantaStor systems upgradable from the offline QuantaStor repository server would be to edit all /etc/apt/sources* files (including sources.list.d sub-directory files) to change packages.osnexus.com to point to the DNS name or IP of the offline QuantaStor repository server you setup. NOTE other hostnames found in those files *.unbuntu.com do NOT need to be changed. The QuantaStor qs_upgrade.py does NOT use those.
Another method would be to change your internal DNS server to point "packages.quantastor.com" to your downloaded offline QuantaStor repository server.
The example below should only be referenced for a method to change these files. NOTE it references a specific version of QuantaStor (focal) which may not be installed (ie jammy). Do NOT use this command without understanding how you should modify it.
Add your new local repository mirror to your QuantaStor systems for all updates:
Replace "yourserver.example.net" with your web server DNS FQDN.
# for focal based quantastor deployments echo 'deb http://yourserver.example.net/packages quantastor-focal main' > /etc/apt/sources.list.d/osnexus.list # for bionic based QuantaStor deployments echo 'deb http://yourserver.example.net/packages quantastor-bionic main' > /etc/apt/sources.list.d/osnexus.list
Perform upgrade as normal
After the above steps, QuantaStor hosts can be upgrade using all normal QuantaStor upgrade methods (Web UI, CLI)
Summary
OSNEXUS Support will provide support for this process for licensed QuantaStor deployments. If you need any further assistance, please see https://www.osnexus.com for support options.