Spectrum Archive VM
Spectrum Archive VM
Spectrum Archive VM
User Guide
Version 1.2
February 23, 2016
Note:
Because this virtual appliance uses the emulated tape library,
Some of the command output can be slightly different from the physical tape
library.
The capacity of each virtual tape cartridge is 2.5 GB which is significantly smaller
than the physical tape cartridges.
The virtual appliance is not an appropriate environment for performance testing.
Spectrum Scale protocol related service (NFS/CIFS/Object) is currently disabled by
default.
2. Requirements
3. Installation
This chapter describes how to install the Spectrum Archive Virtual Appliance.
At first, a Host-Only network needs to be configured. Click Preferences → Network →
Host-only Networks.
Make sure that there’s at least one host-only network with default setting as shows in
Figure 3-1.
If not, click add button to create a new one (red box shown in Figure 3-2) and
remember the adapter name (used later).
And create your own instance of the trial VM. Click File → Import Appliance as shown
in Figure 3-3.
During importing, don’t check ‘Reinitialize the MAC address of all network cards’
checkbox.
After the import, in Network setting of the trial VM, make sure that both adapter 2 and 3
are attached to adapters have been checked in Figure 3-1.
For Windows users: the ova file was exported on Max OS and its adapter names
match with Mac OS/Linux version VirtualBox. Because Windows uses a different
naming rule for adapter names, Windows users needs to correct the adapter settings
pre-configured in the ova. Follow the instruction below to change the adapter names.
Check the adapter names in the red box shown in Figure 3-4.
If these are wrong, change the setting by clicking Settings as shown in Figure 3-5. Here
are three Windows screen captures to follow, in case the adapter name needs to be
changed to "VirtualBox Host-Only Ethernet Adapter".
Then click Network tab and set correct adapter names for both adapter 2 and 3 as
shown in Figure 3-6.
Then make sure that both adapter 2 and adapter 3 names are correct in main window
as shown in Figure 3-7.
4. Setup
This chapter describes how to perform initial setup for Spectrum Archive Virtual
Appliance after installation.
When the virtual machine has booted, as described in the “Spectrum Scale 4.2 Trial VM
Quick Start Guide” included in the Spectrum Scale Trial VM, login by:
User: root
Password: ibm
Then, Spectrum Archive can be configured by running the following initial setup. This
needs to be done every time the virtual machine has booted.
Make sure that the virtual machine is a member of a Spectrum Scale cluster.
[root@spectrumscale ~]# mmlscluster
Make sure that the Spectrum Scale service has started and /gpfs/fs1 is mounted. It may
take about 5 minutes for fs1 to be mounted.
[root@spectrumscale ~]# mmgetstate
Then configure and start Spectrum Archive by issuing the following commands.
[root@spectrumscale ~]# ltfs -o tape_backend=file -o changer_backend=file -o
changer_devname=/ltfs_vtape/library /ltfs
6562 LTFS14000I LTFS starting, LTFS version 2.1.6.0 (9601), log level 2
6562 LTFS14058I LTFS Format Specification version 2.2.0
6562 LTFS14104I Launched by "ltfs -o tape_backend=file -o changer_backend=file -o
changer_devname=/ltfs_vtape/library /ltfs"
6562 LTFS14105I This binary is built for Linux (x86_64)
6562 LTFS14106I GCC version is 4.8.3 20140911 (Red Hat 4.8.3-9)
6562 LTFS17087I Kernel version: Linux version 3.10.0-229.el7.x86_64
(builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP
Fri Mar 6 11:36:42 UTC 2015 i386
Create a tape pool for data migration. This is required only once when the virtual
appliance is initially created and setup.
In this chapter, basic operations for Spectrum Archive are described. You can try each
section independently and learn how to perform an operation and how it works.
Steps:
To see if a file data resides on disk or tape, the dsmls command or ltfsee info files
command can be used.
[root@spectrumscale archive]# dsmls
IBM Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 4.80
/gpfs/fs1/archive:
10485760 10485760 10240 r - 10Mfile_1
10485760 10485760 10240 r - 10Mfile_2
10485760 10485760 10240 r - 10Mfile_3
2097152 2097152 2048 r - text
In the above dsmls output, the "r" means the files are resident (on disk). The file data
exists only on disk.
[root@spectrumscale archive]# ltfsee info files /gpfs/fs1/archive/*
Name: /gpfs/fs1/archive/10Mfile_1
Tape id:- Status: resident
Name: /gpfs/fs1/archive/10Mfile_2
Tape id:- Status: resident
Name: /gpfs/fs1/archive/10Mfile_3
Tape id:- Status: resident
Name: /gpfs/fs1/archive/text
Tape id:- Status: resident
Now, a manual policy execution will be done to migrate these test files to tapes.
Policy file is located at: /root/policy/policy_migArchiveDir.
The contents of the policy file are:
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
define(
is_migrated,
MISC_ATTRIBUTES LIKE '%V%'
)
When this policy is executed, it will migrate all the resident/pre-migrated files under
/gpfs/fs1/archive directory from disk to tape.
Note: Files less than 1 MB in size are excluded from migration for best practice.
Refer to chapter 6 Migration policy rule variations for more information about the
policy.
/gpfs/fs1/archive:
10485760 0 0 m ltfs 10Mfile_1
10485760 0 0 m ltfs 10Mfile_2
10485760 0 0 m ltfs 10Mfile_3
2097152 0 0 m ltfs text
If you read the files, they will be recalled from the tapes.
Notice the file status is p (premigrated). After a read of the migrated file, the data will be
recalled on to disks but also the data on the tape is still valid.
If you modify the migrated (or premigrated) file, the status will be resident.
[root@spectrumscale archive]# echo aaa >>10Mfile_2
Steps:
Create test files under a test directory /gpfs/fs1/archive and run manual migration. Make
sure all test files are migrated by running the dsmls command.
[root@spectrumscale ~]# mkdir /gpfs/fs1/archive
[root@spectrumscale ~]# cd /gpfs/fs1/archive
[root@spectrumscale archive]# dd if=/dev/urandom of=10Mfile_1 count=1 bs=10M
[root@spectrumscale archive]# for i in $(seq 2 3); do cp 10Mfile_1 10Mfile_$i; done
[root@spectrumscale archive]# mmapplypolicy /gpfs/fs1/archive -P
/root/policy/policy_migArchiveDir
The policy file for auto migration is located at: /root/policy/policy_migAuto. Unlike the
policy_migArchiveDir, note that the policy_migAuto does not pick up files in premigrate
state. THRESHOLD statement is described later in this section.
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
OR PATH_NAME LIKE '/gpfs/fs1/.SpaceMan/%'
OR PATH_NAME LIKE '/gpfs/fs1/.snapshots/%'
define(
is_premigrated,
MISC_ATTRIBUTES LIKE '%M%' AND MISC_ATTRIBUTES NOT LIKE '%V%'
)
define(
is_migrated,
MISC_ATTRIBUTES LIKE '%V%'
)
/gpfs/fs1/archive:
10485760 10485760 10240 p ltfs 10Mfile_1
10485760 0 0 m ltfs 10Mfile_2
10485760 0 0 m ltfs 10Mfile_3
10485760 10485760 10240 r - 10Mfile_AutoMigTest
The migration will be invoked for the newly created files after 2 minutes at most.
For cleaning up, delete the callback, set a default policy and delete test files.
Steps:
Create test files under a test directory /gpfs/fs1/archive and run manual migration. Make
sure all test files are migrated.
[root@spectrumscale ~]# mkdir /gpfs/fs1/archive
[root@spectrumscale ~]# cd /gpfs/fs1/archive
[root@spectrumscale archive]# dd if=/dev/urandom of=10Mfile_1 count=1 bs=10M
[root@spectrumscale archive]# for i in $(seq 2 3); do cp 10Mfile_1 10Mfile_$i; done
[root@spectrumscale archive]# mmapplypolicy /gpfs/fs1/archive -P
/root/policy/policy_migArchiveDir
In this case the 10Mfile_1 file data is in Tape VTAPE1L5. The tape ID can be different
on each virtual machine.
Now, delete the file.
[root@spectrumscale ~]# rm -f /gpfs/fs1/archive/10Mfile_1
Check the files in tape by looking at /ltfs/<tape id>. It is expected that the file 10Mfile_1
still exists in the corresponding tape. The actual output may differ in each test
environment.
[root@spectrumscale archive]# ls -l /ltfs/VTAPE1L5/gpfs/fs1/archive
Run the reconcile command. This will synchronize the tape and the disk. The deleted
files in gpfs are also deleted in /ltfs.
Furthermore, run the reclaim command. This will copy the data in the specified tape to a
separate tape and the data will be non-fragmented. The tape is automatically removed
from pool1.
[root@spectrumscale archive]# ltfsee reclaim -p pool1 -t VTAPE1L5
Start reclaiming the following 1 tapes:
VTAPE1L5 .
GLESL372I(00638): Validating tape VTAPE1L5 in pool pool1
Tape VTAPE1L5 is unmounted because it is inserted into the drive.
Tape VTAPE1L5 successfully reclaimed, formatted, and removed from storage pool pool1.
Reclamation complete. 1 tapes reclaimed, 1 tapes removed from the storage pool.
Steps:
Create test files under a test directory /gpfs/fs1/archive and run manual migration. Make
sure all test files are migrated.
(22:05:39) localhost:~ # mkdir /gpfs/fs1/archive
(22:05:46) localhost:~ # cd /gpfs/fs1/archive
(22:05:46) localhost:/gpfs/fs1/archive # dd if=/dev/urandom of=10Mfile_1 count=1 bs=10M
(22:05:47) localhost:/gpfs/fs1/archive # for i in $(seq 2 3); do cp 10Mfile_1 10Mfile_$i; done
Check tape ID that contains one or more files by running ltfsee info files command. Here,
use the tape VTAPE2L5 that includes 3 files for export/import test.
Run the export of the tape that contains the test files.
[root@spectrumscale archive]# ltfsee export -p pool1 -t VTAPE2L5
GLESS016I(00178): Reconciliation requested.
GLESM401I(00188): Loaded the global configuration.
When the export is done, the test files should be deleted from GPFS and the tape
should be removed from pool. Furthermore, in this case, the /gpfs/fs1/archive does not
contain any file after export, the directory itself is removed from GPFS.
[root@spectrumscale ~]# ls -l /gpfs/fs1/archive
ls: cannot access /gpfs/fs1/archive: No such file or directory
Now, running the import. When the import is done, the files in the imported tape will be
visible under IMPORT directory. The status will be "migrated".
[root@spectrumscale ~]# ltfsee import -p pool1 -t VTAPE2L5
GLESL042I(00640): Adding tape VTAPE2L5 to storage pool pool1.
Tape VTAPE2L5 successfully checked.
Added tape VTAPE2L5 to pool pool1 successfully.
Import of tape VTAPE2L5 has been requested.
Import of tape VTAPE2L5 complete.
If you read the file, a recall occurs and the status changes to premigrated.
The prior migration test cases demonstrated a transparent recall of a file by running "cat
<migrated file>". In addition to the transparent recall when a migrated file is read by a
system call, an explicit recall of a specified group of files can be executed in a
performance optimized manner (Referred to as selective bulk recall).
Steps:
Here, ltfsee recall command can be executed by passing the file names.
[root@spectrumscale archive]# find /gpfs/fs1/archive -type f | ltfsee recall
GLESL277I(00303): The ltfsee recall command is called without specifying an input file waiting
for standard input.
If necessary press ^D to exit.
GLESL268I(00142): 10 file name(s) have been provided to recall.
GLESL263I(00191): Recall result: 10 succeeded, 0 failed, 0 duplicate, 0 not migrated, 0 not
found.
[root@spectrumscale archive]# find /gpfs/fs1/archive -type f | sort | xargs ltfsee info files
Name: /gpfs/fs1/archive/10Mfile_1
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_10
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_2
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_3
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_4
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_5
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_6
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_7
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_8
Tape id:VTAPE0L5@lib1 Status: premigrated
This time, create a file list of these files and pass it to ltfsee recall command.
[root@spectrumscale archive]# find /gpfs/fs1/archive -type f -name "10Mfile*" >/tmp/file_list
[root@spectrumscale archive]# cat /tmp/file_list
/gpfs/fs1/archive/10Mfile_6
/gpfs/fs1/archive/10Mfile_7
/gpfs/fs1/archive/10Mfile_8
/gpfs/fs1/archive/10Mfile_10
/gpfs/fs1/archive/10Mfile_1
/gpfs/fs1/archive/10Mfile_4
/gpfs/fs1/archive/10Mfile_2
/gpfs/fs1/archive/10Mfile_3
/gpfs/fs1/archive/10Mfile_9
/gpfs/fs1/archive/10Mfile_5
[root@spectrumscale archive]# find /gpfs/fs1/archive -type f | sort | xargs ltfsee info files
Name: /gpfs/fs1/archive/10Mfile_1
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_10
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_2
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_3
Tape id:VTAPE0L5@lib1 Status: premigrated
Lastly, if a customer has millions of files to migrate, the find command can be slow. The
mmapplypolicy would be much faster to generate the file list. The following policy can
be used to let mmapplypolicy find the files and invoke ltfsee recall.
/root/policy/policy_recallArchiveDir
RULE EXTERNAL POOL 'pool1'
EXEC '/opt/ibm/ltfsee/bin/ltfsee'
Note that the rule ee_recall indicating data movement from pool1 (LTFS/tape) to system
(GPFS/disk).
[root@spectrumscale archive]# find /gpfs/fs1/archive -type f | sort | xargs ltfsee info files
Name: /gpfs/fs1/archive/10Mfile_1
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_10
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_2
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_3
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_4
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_5
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_6
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_7
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_8
Tape id:VTAPE0L5@lib1 Status: premigrated
Name: /gpfs/fs1/archive/10Mfile_9
Tape id:VTAPE0L5@lib1 Status: premigrated
Symbolic links, empty regular files, and empty directories are some file system objects
that do not contain data or content. These can not be migrated to tapes by the ltfsee
migrate command.
The policy rules that have been used in this guide excludes directories and symbolic
links by default. Also, (KB_ALLOCATED > 1024) statement excludes the empty file.
(Note that non-empty directories are saved in tapes).
While this is OK for pure space management purpose, a customer may want to use
tapes in the following ways:
Use tape export/import to replicate the entire file system from one system to another
Use tape as a complete backup of the file system so that if the file system is
corrupted, it can be recovered from the tape
For these needs, the ltfsee save command is provided.
Steps:
First, a simple file list will be created and used for saving the data.
Create the test files.
[root@spectrumscale archive]# mkdir dir emptydir
[root@spectrumscale archive]# cd dir
[root@spectrumscale dir]# cp ../10Mfile_1 .
[root@spectrumscale dir]# touch emptyFile
[root@spectrumscale dir]# ln -s 10Mfile_1 sln_10Mfile_1
[root@spectrumscale dir]# ls -lR /gpfs/fs1/archive^C
[root@spectrumscale dir]# cd
/gpfs/fs1/archive/dir:
total 10240
-rw-r--r--. 1 root root 10485760 Feb 3 02:17 10Mfile_1
-rw-r--r--. 1 root root 0 Feb 3 02:17 emptyFile
lrwxrwxrwx. 1 root root 9 Feb 3 02:17 sln_10Mfile_1 -> 10Mfile_1
/gpfs/fs1/archive/emptydir:
total 0
/gpfs/fs1/archive/dir/sln_10Mfile_1
pool1
[root@spectrumscale ~]#
Attention: Each entry must consist of 3 lines, the last line being blank.
Then, execute
[root@spectrumscale ~]# ltfsee save -f /tmp/savelist
GLESL279I(01252): Save result: 2 succeeded, 0 failed, 0 duplicate, 0 duplicate wrong pool, 0 not
found, 0 skipped.
In the above example the Status result is unknown. In that case, the tape needs to be
unmounted first by ltfsee tape move homeslot command and then the ltfsee info files
command can be re-run.
Next, in case there are a huge number of such objects, mmapplypolicy can be used.
/root/policy/policy_save
/*
Sample policy rules to save
symbolic links,
empty directories and
empty regular files
*/
define(DISP_XATTR,
CASE
WHEN XATTR($1) IS NULL
THEN '_NULL_'
ELSE XATTR($1)
END
)
RULE 'symoliclinks'
LIST 'emptyobjects'
DIRECTORIES_PLUS
/*
SHOW ('mode=' || SUBSTR(MODE,1,1) ||
' stime=' || DISP_XATTR('dmapi.IBMSTIME') ||
' ctime=' || VARCHAR(CHANGE_TIME) ||
' spath=' || DISP_XATTR('dmapi.IBMSPATH'))
*/
WHERE
( /* if the object is a symbolic link */
MISC_ATTRIBUTES LIKE '%L%'
)
AND
(
PATH_NAME NOT LIKE '%/.SpaceMan/%'
)
AND
(
( /* if the object has not been saved yet */
XATTR('dmapi.IBMSTIME') IS NULL
AND
XATTR('dmapi.IBMSPATH') IS NULL
RULE 'directories'
LIST 'emptyobjects'
DIRECTORIES_PLUS
/*
SHOW ('mode=' || SUBSTR(MODE,1,1) ||
' stime=' || DISP_XATTR('dmapi.IBMSTIME') ||
' ctime=' || VARCHAR(CHANGE_TIME) ||
' spath=' || DISP_XATTR('dmapi.IBMSPATH'))
*/
WHERE
( /* if the object is a directory */
MISC_ATTRIBUTES LIKE '%D%'
)
AND
(
PATH_NAME NOT LIKE '%/.SpaceMan'
AND
PATH_NAME NOT LIKE '%/.SpaceMan/%'
)
AND
(
( /* directory's emptiness is checked in the later processing */
/* if the object has not been saved yet */
XATTR('dmapi.IBMSTIME') IS NULL
AND
XATTR('dmapi.IBMSPATH') IS NULL
)
RULE 'emptyregularfiles'
LIST 'emptyobjects'
/*
SHOW ('mode=' || SUBSTR(MODE,1,1) ||
' stime=' || DISP_XATTR('dmapi.IBMSTIME') ||
' ctime=' || VARCHAR(CHANGE_TIME) ||
' spath=' || DISP_XATTR('dmapi.IBMSPATH'))
*/
WHERE
( /* if the object is a regular file */
MISC_ATTRIBUTES LIKE '%F%'
)
AND
(
PATH_NAME NOT LIKE '%/.SpaceMan/%'
)
AND
(
( /* if the size = 0 and the object has not been saved yet */
FILE_SIZE = 0
AND
XATTR('dmapi.IBMSTIME') IS NULL
AND
XATTR('dmapi.IBMSPATH') IS NULL
)
OR
( /* if the object is modified or renamed after it was saved */
FILE_SIZE = 0
When this is actually executed, the directory emptiness will be checked after the scan.
Since the 2 directories are not empty, only the empty file will be saved in a tape.
[root@spectrumscale ~]# mmapplypolicy /gpfs/fs1/archive -P /root/policy/policy_save
...
[I] A total of 3 files have been migrated, deleted or processed by an EXTERNAL EXEC/script;
0 'skipped' files and/or errors.
A drive attribute can be assigned to each drive independently to limit tape related
operation that a drive can perform. Drive attributes can be assigned when a drive is
added to a library (ltfsee drive add command). To change attributes for a drive, the drive
needs to be removed once and added again with a new attributes.
There’s three attributes are defined and each is represented as a decimal value:
Migration (4) – indicates a drive is allowed to perform migration job.
Recall (2) – indicates a drive is allowed to perform recall job.
Generic (1) – indicates a drive is allowed to perform other generic jobs that includes
formatting, reconciliation and reclamation etc.
By default all these three attributes are enabled when a drive is added. A custom
attribute can be assigned to a drive using the logical OR of decimal numeric values
corresponding to attributes to be enabled. For example, a logical OR value 6 can be
used if Migration and Recall should be assigned but Generic is not.
Steps:
Remove one tape from the pool1 so that two tapes are assigned to it. If needed, the
tape needs to be unmounted.
Unmounts all the tapes from drives. Make sure that both tapes are not mounted in any
drive using ltfsee info tapes command (See ‘Drive’ column).
By default all the four drives attached to the virtual appliance has all m(igration), r(ecall)
and g(eneric) attributes.
Now do a migration. When it completes, see which drives has been used for that job. In
this case, VDRIVE0000 was used.
Then do a recall and see which drive was used. Since the tape cartridge that contains
the test data is already mounted by VDRIVE0000, the recall job will be done using the
same drive to avoid the cartridge movement.
Then also do a reconciliation and reclamation, verify which drives have been used.
As shown above if all attributes are assigned to all drives equally, tape exchanges are
avoided as much as possible.
For the next test, delete the pool1 once and also remove the drives from LTFS EE.
At this point all four drives are still virtually attached to the virtual machine but these
need to be added into LTFS EE drive list. ltfsee drive add command can be used and a
drive attribute can be given with each drive serial. In this case, assign the following
attribute to each tape drive:
VDRIVE0000 – 4 (Migration)
VDRIVE0001 – 2 (Recall)
VDRIVE0002 – 1 (Generic)
VDRIVE0003 – 1 (Generic)
Now create the pool1 again with two tapes and create a test file.
Do a migration in the same way. VDRIVE0000 will be used because it is the only drive
that can perform the migration job.
[root@spectrumscale ~]# mmapplypolicy /gpfs/fs1/archive -P /root/policy/policy_migArchiveDir
Then do a recall. Unlike the prior test case that used the default drive attributes, this
time, the tape drive that the recall role was assigned to will be used instead of the
migration drive.
Cleanup the test environment. Assign the original ‘mrg’ attributes to all drives and
assign one tape to pool1 so that pool1 has three tapes in total.
This chapter describes best practices about policy rules when you configure automatic
migration for Spectrum Archive.
The policy rule file is a powerful interface provided by Spectrum Scale. Various
parameters can be used in the rule to specify which files get migrated to which external
pool. The detail syntax and the built-in features are described in Knowledge Center.
In this chapter, some basic/typical rules are introduced to explain how the policy rules
can be modified.
Also, aside from the test policy rules, a few template rule files with recommended
defines and comments are prepared under /root/policy/template directory. These can be
used to adjust to the physical Spectrum Archive environment.
The recommendations / best practice for creating a migration policy for Spectrum
Archive are as follows:
Exclude Spectrum Archive internal directories (<mount point>/.ltfsee and <mount
point>/.SpaceMan)
Exclude snapshot directories (.snapshots). The path can differ depending on the file
system configuration.
Files/dirs can be excluded from the migration by defining the exclude_list and using it in
the RULE <name> MIGRATE FROM POOL statement.
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
OR PATH_NAME LIKE '/gpfs/fs1/.SpaceMan/%'
OR PATH_NAME LIKE '/gpfs/fs1/.snapshots/%'
)
...
RULE 'ARCHIVE_FILES' MIGRATE FROM POOL 'system'
TO POOL 'Archive_files'
...
WHERE (
...
AND NOT (exclude_list)
)
Note:
Please note that these are highly recommended to be excluded.
The RULE statement used in the test had WHERE clause with PATH_NAME
LIKE '/gpfs/fs1/archive/%'. This means any files under /gpfs/fs1/archive are
subject to migration. Therefore, technically speaking, the Spectrum Archive
internal directories such as /gpfs/fs1/.ltfsee did not need to be explicitly specified
to be excluded. The sample policy still had the define for best practice.
Steps:
Locate a policy rule file /root/policy/policy_migExclude.
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
OR PATH_NAME LIKE '/gpfs/fs1/.SpaceMan/%'
OR PATH_NAME LIKE '/gpfs/fs1/.snapshots/%'
OR PATH_NAME LIKE '/gpfs/fs1/archive/excludeme/%'
)
define(
is_premigrated,
MISC_ATTRIBUTES LIKE '%M%' AND MISC_ATTRIBUTES NOT LIKE '%V%'
)
define(
is_migrated,
MISC_ATTRIBUTES LIKE '%V%'
)
Now, create a few test files. For testing purpose 10 files will be created under
/gpfs/fs1/archive/excludeme and 1 file under /gpfs/fs1/archive/dir1
[root@spectrumscale ~]# mkdir -p /gpfs/fs1/archive/excludeme /gpfs/fs1/archive/dir1
[root@spectrumscale ~]# dd if=/dev/urandom of=/gpfs/fs1/archive/excludeme/10Mfile_1 bs=10M
count=1
[root@spectrumscale ~]# for i in $(seq 2 10); do cp /gpfs/fs1/archive/excludeme/10Mfile_1
/gpfs/fs1/archive/excludeme/10Mfile_$i; done
[root@spectrumscale ~]# cp /gpfs/fs1/archive/excludeme/10Mfile_1 /gpfs/fs1/archive/dir1/
So in this test case, there are 10 resident files under /gpfs/fs1/archive/excludeme and 1
under /gpfs/fs1/archive/dir1.
[root@spectrumscale ~]# dsmls /gpfs/fs1/archive/*
IBM Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 4.80
Client date/time: 02/03/2016 01:31:08
(c) Copyright by IBM Corporation and other(s) 1990, 2015. All Rights Reserved.
/gpfs/fs1/archive/dir1:
10485760 10485760 10240 r - 10Mfile_1
/gpfs/fs1/archive/excludeme:
10485760 10485760 10240 r - 10Mfile_1
10485760 10485760 10240 r - 10Mfile_10
10485760 10485760 10240 r - 10Mfile_2
10485760 10485760 10240 r - 10Mfile_3
10485760 10485760 10240 r - 10Mfile_4
10485760 10485760 10240 r - 10Mfile_5
10485760 10485760 10240 r - 10Mfile_6
There is a dry-run option of the policy so that the specified policy rule syntax can be
verified before actually running.
[root@spectrumscale ~]# mmapplypolicy /gpfs/fs1/archive -I test -P /root/policy/policy_migExclude
...
[I] 2016-02-03@06:31:39.709 Directory entries scanned: 14.
[I] Directories scan: 11 files, 3 directories, 0 other objects, 0 'skipped' files and/or errors.
[I] 2016-02-03@06:31:39.711 Sorting 14 file list records.
[I] Inodes scan: 11 files, 3 directories, 0 other objects, 0 'skipped' files and/or errors.
[I] 2016-02-03@06:31:39.731 Policy evaluation. 14 files scanned.
[I] 2016-02-03@06:31:39.734 Sorting 1 candidate file list records.
[I] 2016-02-03@06:31:39.735 Choosing candidate files. 1 records scanned.
[I] Summary of Rule Applicability and File Choices:
Rule# Hit_Cnt KB_Hit Chosen KB_Chosen KB_Ill Rule
0 1 10240 1 10240 0 RULE
'Mig-test' MIGRATE FROM POOL 'system' TO POOL 'Archive_files' WHERE(.)
After the policy has been verified, the actual migration can be executed.
[root@spectrumscale ~]# mmapplypolicy /gpfs/fs1/archive -P /root/policy/policy_migExclude
...
[I] Summary of Rule Applicability and File Choices:
Rule# Hit_Cnt KB_Hit Chosen KB_Chosen KB_Ill Rule
0 1 10240 1 10240 0 RULE
'Mig-test' MIGRATE FROM POOL 'system' TO POOL 'Archive_files' WHERE(.)
...
GLESL038I(00555): Migration result: 1 succeeded, 0 failed, 0 duplicate, 0 duplicate wrong pool, 0
not found, 0 too small to qualify for migration.
...
Sometimes, a customer may want to exclude a top directory but want to migrate a small
sub-directory under that top directory.
Similar to exclude, such case can be specified in the policy rule.
Locate /root/policy/policy_migInclude
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
OR PATH_NAME LIKE '/gpfs/fs1/.SpaceMan/%'
OR PATH_NAME LIKE '/gpfs/fs1/.snapshots/%'
OR PATH_NAME LIKE '/gpfs/fs1/archive/excludeme/%'
)
define(
include_list,
PATH_NAME LIKE '/gpfs/fs1/archive/excludeme/includeme/%'
)
define(
is_premigrated,
MISC_ATTRIBUTES LIKE '%M%' AND MISC_ATTRIBUTES NOT LIKE '%V%'
)
define(
is_migrated,
MISC_ATTRIBUTES LIKE '%V%'
)
Steps:
Create the test environment:
[root@spectrumscale ~]# mkdir -p /gpfs/fs1/archive/excludeme
[root@spectrumscale ~]# dd if=/dev/urandom of=/gpfs/fs1/archive/excludeme/10Mfile_1 bs=10M
[root@spectrumscale ~]# for i in $(seq 2 10); do cp /gpfs/fs1/archive/excludeme/10Mfile_1
/gpfs/fs1/archive/excludeme/10Mfile_$i; done
[root@spectrumscale ~]# mkdir /gpfs/fs1/archive/excludeme/includeme
[root@spectrumscale ~]# cp /gpfs/fs1/archive/excludeme/10Mfile_1
/gpfs/fs1/archive/excludeme/includeme/10Mfile_1
The hit count and the hit file names look correct.
Execute the policy.
(07:33:46) localhost:~ # mmapplypolicy /gpfs/fs1/archive -P /root/policy/policy_migInclude
As listed in the Knowledge Center, various file attributes can be used in the policy rule.
Following is a sample to migrate files that are larger than 10MB and the order is based
on the access time. A file with the oldest access time gets migrated first.
/root/policy/pocliy_migTimeSize
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
OR PATH_NAME LIKE '/gpfs/fs1/.SpaceMan/%'
OR PATH_NAME LIKE '/gpfs/fs1/.snapshots/%'
)
define(
is_migrated,
MISC_ATTRIBUTES LIKE '%V%'
)
[root@spectrumscale ~]# find /gpfs/fs1/archive -type f | sort | xargs ltfsee info files
Name: /gpfs/fs1/archive/atime/10Mfile_1
Tape id:- Status: resident
Name: /gpfs/fs1/archive/atime/20Mfile_1
Tape id:- Status: resident
Name: /gpfs/fs1/archive/atime/20Mfile_2
Tape id:- Status: resident
Name: /gpfs/fs1/archive/atime/20Mfile_3
Tape id:- Status: resident
Name: /gpfs/fs1/archive/atime/20Mfile_4
Tape id:- Status: resident
Name: /gpfs/fs1/archive/atime/20Mfile_5
Tape id:- Status: resident
Now, the 10Mfile_5 has the oldest timeout (atime) and 10Mfile_1 has the latest.
[root@spectrumscale ~]# stat /gpfs/fs1/archive/atime/20Mfile_* --printf "%n: atime => %x\n"
/gpfs/fs1/archive/atime/20Mfile_1: atime => 2016-02-03 01:45:44.996571992 -0500
/gpfs/fs1/archive/atime/20Mfile_2: atime => 2016-02-03 01:45:42.993572001 -0500
/gpfs/fs1/archive/atime/20Mfile_3: atime => 2016-02-03 01:45:40.991572011 -0500
/gpfs/fs1/archive/atime/20Mfile_4: atime => 2016-02-03 01:45:38.990572020 -0500
/gpfs/fs1/archive/atime/20Mfile_5: atime => 2016-02-03 01:45:36.987572029 -0500
Now execute dry-run of the policy. Only 20MB files should be selected and also the
order should be based on the timestamp.
[root@spectrumscale ~]# mmapplypolicy /gpfs/fs1/archive -I test -L 4 -P
/root/policy/policy_migTimeSize
...
[I] 2016-02-03@06:46:38.490 Sorting 8 file list records.
/gpfs/fs1/archive/atime/20Mfile_1y evalu RULE 'Mig-test' MIGRATE FROM POOL 'system' TO POOL
'Archive_files' WEIGHT(52.003429)
/gpfs/fs1/archive/atime/20Mfile_3 RULE 'Mig-test' MIGRATE FROM POOL 'system' TO POOL
'Archive_files' WEIGHT(56.008428)
/gpfs/fs1/archive/atime/20Mfile_5 RULE 'Mig-test' MIGRATE FROM POOL 'system' TO POOL
'Archive_files' WEIGHT(100.012428)
/gpfs/fs1/archive/atime/20Mfile_4 RULE 'Mig-test' MIGRATE FROM POOL 'system' TO POOL
'Archive_files' WEIGHT(58.009428)
/gpfs/fs1/archive/atime/20Mfile_2 RULE 'Mig-test' MIGRATE FROM POOL 'system' TO POOL
'Archive_files' WEIGHT(54.006428)
...
[I] 2016-02-03@06:46:38.515 Sorting 5 candidate file list records.
WEIGHT(100.012428) MIGRATE /gpfs/fs1/archive/atime/20Mfile_5 TO POOL Archive_files SHOW()
WEIGHT(58.009428) MIGRATE /gpfs/fs1/archive/atime/20Mfile_4 TO POOL Archive_files SHOW()
WEIGHT(56.008428) MIGRATE /gpfs/fs1/archive/atime/20Mfile_3 TO POOL Archive_files SHOW()
WEIGHT(54.006428) MIGRATE /gpfs/fs1/archive/atime/20Mfile_2 TO POOL Archive_files SHOW()
WEIGHT(52.003429) MIGRATE /gpfs/fs1/archive/atime/20Mfile_1 TO POOL Archive_files SHOW()
...
[root@spectrumscale ~]# find /gpfs/fs1/archive -type f | sort | xargs ltfsee info files
Name: /gpfs/fs1/archive/atime/10Mfile_1
Tape id:- Status: resident
Name: /gpfs/fs1/archive/atime/20Mfile_1
Tape id:VTAPE0L5@lib1 Status: migrated
Name: /gpfs/fs1/archive/atime/20Mfile_2
Tape id:VTAPE0L5@lib1 Status: migrated
Name: /gpfs/fs1/archive/atime/20Mfile_3
Tape id:VTAPE0L5@lib1 Status: migrated
Name: /gpfs/fs1/archive/atime/20Mfile_4
Tape id:VTAPE0L5@lib1 Status: migrated
Name: /gpfs/fs1/archive/atime/20Mfile_5
Tape id:VTAPE0L5@lib1 Status: migrated
As shown in the Automatic migration section, THRESHOLD(xx, xx) can be added to this
to give a further control of amount of capacity to migrate.
Furthermore, there is an option to only create the file list and not run the mmapplypolicy
by using -I defer -f <file> option.
Which external pool to migrate the data to can also be specified in the policy rule.
/root/policy/policy_migPool
define(
exclude_list,
PATH_NAME LIKE '/gpfs/fs1/.ltfsee/%'
OR PATH_NAME LIKE '/gpfs/fs1/.SpaceMan/%'
OR PATH_NAME LIKE '/gpfs/fs1/.snapshots/%'
)
define(
is_premigrated,
MISC_ATTRIBUTES LIKE '%M%' AND MISC_ATTRIBUTES NOT LIKE '%V%'
)
define(
is_migrated,
MISC_ATTRIBUTES LIKE '%V%'
)
Steps:
First, another pool (pool2) needs to be created.
[root@spectrumscale ~]# ltfsee pool create pool2
[root@spectrumscale ~]# ltfsee pool add -p pool2 -t VTAPE3L5 -t VTAPE4L5 -t VTAPE5L5 -e
/gpfs/fs1/archive/archive2:
10485760 10485760 10240 r - 10Mfile_1
10485760 10485760 10240 r - 10Mfile_2
10485760 10485760 10240 r - 10Mfile_3
10485760 10485760 10240 r - 10Mfile_4
10485760 10485760 10240 r - 10Mfile_5
Execute the dry-run of the policy and verify archive1 will be migrated to pool1 while
archive2 will be migrated to pool2.
[root@spectrumscale ~]# mmapplypolicy /gpfs/fs1/archive -I test -L 4 -P
/root/policy/policy_migPool
...
WEIGHT(inf) MIGRATE /gpfs/fs1/archive/archive1/10Mfile_1 TO POOL Archive_files1 SHOW()
WEIGHT(inf) MIGRATE /gpfs/fs1/archive/archive1/10Mfile_2 TO POOL Archive_files1 SHOW()
WEIGHT(inf) MIGRATE /gpfs/fs1/archive/archive1/10Mfile_3 TO POOL Archive_files1 SHOW()
WEIGHT(inf) MIGRATE /gpfs/fs1/archive/archive1/10Mfile_4 TO POOL Archive_files1 SHOW()
Here GLESL355E message indicates an error that it cannot remove a tape from the
pool. Note that last character E of this message ID indicates an ‘E’rror.
Issue "ps aux | grep ltfs" to make sure the ltfs -o tape_backend=file ... process has
exited.
For testing using this virtual appliance, If all tapes are full, the data needs to be deleted.
The steps to clean up the test files and tapes are:
Delete the gpfs test files.
Run the reconcile specifying the pool and the library.
Run the reclaim specifying the pool. This will reclaim and format each tapes in the
pool. The tapes will remain in the pool.
For example,
[root@spectrumscale ~]# df /ltfs_vtape
Filesystem 1K-blocks Used Available Use% Mounted on
9. Detail logs
The following files contain detailed messages and log information:
/var/log/messages
/var/log/ltfsee.log
Also, as demonstrated in the test cases, adding -L 6 to mmapplypolicy gives detail information
of the policy execution.
12. Limitations
Due to the virtual appliance usage, the virtual tapes mounted under /ltfs may show
duplicate entries. This can be ignored.
The virtual appliance has Spectrum Archive 1.2 running on IBM Spectrum Scale 4.2.
However, Spectrum Scale 4.2 is not officially supported by Spectrum Archive 1.2.
The virtual appliance has Spectrum Archive 1.2 running on CentOS. However,
CentOS is not officially supported by Spectrum Archive 1.2.This virtual appliance is
provided as is for demonstration/training purpose. No official support by IBM will be
provided for this virtual appliance.