Skip to content
Snippets Groups Projects
Commit 29ccc352 authored by Eric Cano's avatar Eric Cano
Browse files

Added missing content in genrate_mhvtl_config.sh

added bash -x option to debug scripts.
parent b18eab98
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
nlib=1
ndrive=3 # no more than 9 drives
ntape=7
freetapeslots=3
echo "VERSION: 5" > /etc/mhvtl/device.conf
echo >> /etc/mhvtl/device.conf
for ((lib=1; lib<=${nlib}; lib++)); do
libid="${lib}0"
cat <<EOF >> /etc/mhvtl/device.conf
Library: ${libid} CHANNEL: $(printf %.2d ${lib}) TARGET: 00 LUN: 00
Vendor identification: STK
Product identification: VLSTK${libid}
Unit serial number: LIB${libid}
NAA: 30:22:33:44:ab:$(printf %.2x ${lib}):00:00
Home directory: /opt/mhvtl
PERSIST: False
Backoff: 400
EOF
rm -f /etc/mhvtl/library_contents.${libid}
for ((drive=1; drive<=${ndrive}; drive++)); do
cat <<EOF >> /etc/mhvtl/device.conf
Drive: ${lib}${drive} CHANNEL: $(printf %.2d ${lib}) TARGET: $(printf %.2d ${drive}) LUN: 00
Library ID: ${libid} Slot: $(printf %.2d ${drive})
Vendor identification: STK
Product identification: MHVTL
Unit serial number: VDSTK${lib}${drive}
NAA: 30:22:33:44:ab:$(printf %.2x ${lib}):$(printf %.2x ${drive}):00
Compression: factor 1 enabled 1
Compression type: lzo
Backoff: 400
EOF
echo "Drive ${drive}: VDSTK${lib}${drive}" >> /etc/mhvtl/library_contents.${libid}
done
cat <<EOF >> /etc/mhvtl/library_contents.${libid}
Picker 1:
MAP 1:
# Slot 1 - ?, no gaps
# Slot N: [barcode]
# [barcode]
# a barcode is comprised of three fields: [Leading] [identifier] [Trailing]
# Leading "CLN" -- cleaning tape
# Leading "W" -- WORM tape
# Leading "NOBAR" -- will appear to have no barcode
# If the barcode is at least 8 character long, then the last two characters are Trailing
# Trailing "S3" - SDLT600
# Trailing "X4" - AIT-4
# Trailing "L1" - LTO 1, "L2" - LTO 2, "L3" - LTO 3, "L4" - LTO 4, "L5" - LTO 5
# Trailing "LT" - LTO 3 WORM, "LU" - LTO 4 WORM, "LV" - LTO 5 WORM
# Trailing "L6" - LTO 6, "LW" - LTO 6 WORM
# Trailing "TA" - T10000+
# Trailing "TZ" - 9840A, "TY" - 9840B, "TX" - 9840C, "TW" - 9840D
# Trailing "TV" - 9940A, "TU" - 9940B
# Trailing "JA" - 3592+
# Trailing "JB" - 3592E05+
# Trailing "JC" - 3592E06+
# Trailing "JK" - 3592E07+
# Trailing "JW" - WORM 3592+
# Trailing "JX" - WORM 3592E05+ & 3592E06
# Trailing "JY" - WORM 3592E07+
# Trailing "D7" - DLT7000 media (DLT IV)
#
EOF
for ((tape=1; tape<=${ntape}; tape++)); do
echo "Slot ${tape}: V$(printf %.2d ${lib})$(printf %.3d ${tape})TA" >> /etc/mhvtl/library_contents.${libid}
done
for ((i=1;i<=${freetapeslots};i++)); do
echo "Slot $((${ntape}+${i})):" >> /etc/mhvtl/library_contents.${libid}
done
done
#!/bin/bash
#!/bin/bash -x
# This script recreates an environment similar to the one created by
# it-puppet-hostgroup-cta profiles.
# (Re-)create the mhvtl environment
echo Wiping mhvtl...
echo Wiping mhvtl and kubernetes library info...
systemctl stop mhvtl
sleep 2
rm -rf /etc/mhvtl
rm -rf /opt/mhvtl
rm -rf /opt/kubernetes/CTA/library
mkdir -p /opt/mhvtl
################################################################################
### Add castor repo for MHVTL latest
......@@ -39,8 +41,15 @@ chmod 0644 /etc/mhvtl/mhvtl.conf
################################################################################
### template('hg_cta/mhvtl/generate_mhvtl_config.sh.erb')
echo mhvtl config pre-run
ls -lR /opt/mhvtl
echo Running mhvtl config generator...
./generate_mhvtl_config.sh
bash -x ./generate_mhvtl_config.sh
echo mhvtl config post run
ls -lR /opt/mhvtl
################################################################################
### Create mhvtl directory
......@@ -51,10 +60,11 @@ chown vtl.vtl /opt/mhvtl
#### Start mhvtl
echo Starting mhvtl...
systemctl start mhvtl
sleep 2
################################################################################
### puppet:///modules/hg_cta/generate_librarydevice_PV.sh
echo Generating kubernetes persistent volumes
./generate_librarydevice_PV.sh
bash -x ./generate_librarydevice_PV.sh
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