Skip to content
Snippets Groups Projects
Commit 40c3165a authored by Vladimir Bahyl's avatar Vladimir Bahyl
Browse files

Comments updated

parent a5e256c1
No related branches found
No related tags found
No related merge requests found
......@@ -16,19 +16,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Logic:
# * CTA tape pool should have at least X partial tapes available for writing
# * Eligible partial tapes are those that are not DISABLED, not FULL and not
# in a DISABLED logical tape library
# * If the number of eligible partial tapes for a given pool falls below the
# configured limit, the pool needs to be re-supplied with fresh tapes
# * Fresh supply tapes are taken from tape pools defined in the "supply" column
# * Supply tape pools can be separated by a separator (usually comma)
# LOGIC:
#
# * CTA tape pools should have at least X partial tapes available for writing.
# * Eligible partial tapes are those that are not DISABLED, not READONLY,
# not FULL and not in a DISABLED logical tape library.
# * If the number of eligible partial tapes of a given tape pool falls below the
# configured limit, the pool needs to be re-supplied with fresh tapes.
# * Fresh supply tapes are taken from tape pools defined in the "supply" column.
# * There can be multiple supply tape pools and they can be separated by
# a separator (usually comma).
# * There is no distinction between what is a supply pool and what is not, if
# a pool has a value in the "supply" column, tapes are taken from there.
# a pool has a value in the "supply" column, tapes are taken from that pool.
# Because of this, irregularities, cyclical loops and other misconfiguration
# are possible - please be careful
# * This script is intended to run every 15 minutes
# are possible - please be careful.
# * This script is intended to run every 15 minutes.
#
# Author: Vladimir Bahyl - 7/2019
......@@ -88,7 +90,7 @@ def extract_eligible_tapes(disabledlibraries, tapepool):
# MAIN
#
##########
logging.info("Current time: " + format(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
logging.info("--- Starting at: " + format(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
# Extract the list of all tape pools from CTA (in the JSON format)
command = [ctaadmin, "--json", "tapepool", "ls"]
......@@ -159,3 +161,5 @@ for tapepool in tapepools:
else:
logging.warn("Unable to re-fill the tape pool: " + tapepool["name"] + " because either the number of eligible partial tapes: " + tapepool["numPartialTapes"] + " or the supply pool: " + tapepool["supply"] + " is not properly configured")
logging.info("--- Finished processing all tape pools\n")
# This crontab entry will run the CTA tape pool re-supply script every 10 minutes.
# This crontab entry will run the CTA tape pool re-supply script every 15 minutes.
#
# The purpose of that script is to re-fill the tape pools with empty tapes according to defined configuration.
# The purpose of that script is to re-fill the tape pools with empty tapes
# according to defined configuration. More documentation inside of the script.
#
# Vladimir Bahyl - 7/2019
#
MAILTO=tape-operations@cern.ch
*/10 * * * * root /usr/local/bin/cta-pool-supply >> /var/log/cta-pool-supply.log 2>&1
*/15 * * * * root /usr/local/bin/cta-pool-supply >> /var/log/cta-pool-supply.log 2>&1
Summary: CTA supply re-fill mechanism
Summary: CTA pool supply re-fill mechanism
Name: cta-pool-supply
Version: 1.0
Release: 1
......@@ -10,16 +10,21 @@ Requires: python36 cta-cli
Source: %{name}-%{version}.tgz
%description
This RPM contains a script that will generate an tape mount
statistics report on the tape infrastructure since the specified
date.
TSMOD should investigate whether there are some users misusingthe
service.
It should be run at most twice per day.
TSMOD = Tape Service Manager on Duty
CTA pool supply re-fill mechanism
* CTA tape pools should have at least X partial tapes available for writing.
* Eligible partial tapes are those that are not DISABLED, not READONLY,
not FULL and not in a DISABLED logical tape library.
* If the number of eligible partial tapes of a given tape pool falls below the
configured limit, the pool needs to be re-supplied with fresh tapes.
* Fresh supply tapes are taken from tape pools defined in the "supply" column.
* There can be multiple supply tape pools and they can be separated by
a separator (usually comma).
* There is no distinction between what is a supply pool and what is not, if
a pool has a value in the "supply" column, tapes are taken from that pool.
Because of this, irregularities, cyclical loops and other misconfiguration
are possible - please be careful.
* This script is intended to run every 15 minutes.
Author: Vladimir Bahyl - 7/2019
%prep
......@@ -45,4 +50,3 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root)
/usr/local/bin/cta-pool-supply
/etc/cron.d/cta-pool-supply.cron
/var/log/cta-pool-supply.log
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment