AFM to cloud object storage policy-based upload for manual updates mode
AFM to cloud object storage now supports policy-based upload for manual updates (MU) mode.
A policy can be defined by system administrators and run by using the
mmafmcosctl reconcile command that helps automatic selection and upload of the
files or objects to cloud object storage buckets. Earlier, this task was done
with manual intervention by using –object-list
option from the upload command.
A policy rule is an SQL-like statement that directs mmafmcosctl reconcile command to upload data to the cloud object storage based on criteria defined in the policy file.
A policy rule specifies one or more conditions. When the conditions are true, the specific rule applies. Conditions can be specified by SQL expressions, which can include SQL functions, variables, and file attributes.
- File name or extension
- File size
- User ID and group ID
- Date and time when the file was last accessed
- Date and time when the file was last modified
Steps to policy-based upload for the manual updates mode
- According to the data created in the manual updates fileset, system administrator defines a policy. For example, upload all the objects or files with the specific names. For more information, see Creating a policy.
- As a system administrator, you can either install this policy permanently by using
mmafmcosctl
–add-policy
command or run it when needed, by using mmafmcosctl–policy
command. - When the policy is installed permanently by using
–add-policy
, mmafmcosctl reconcile command uses this policy to run when mafmcosctlDevice FilesetName
path reconcile command is run without any option. - As a system administrator, you can remove the installed policy by using
mmafmcosctl
Device FilesetName Path
reconcile–remove-policy
command. - As a system administrator, you can also run a policy right away by using
mmafmcosctl
Device FilesetName Path reconcile –policy
command. Here, the policy is not stored internally. - As a system administrator, you can view the installed policy by using
--list-policy
option.
Policy creation
LIST
option must have prerequisite names that
are, "dirtyFiles"
for files and "dirtyDirs"
for
directories.Example
- Manual updates mode fileset
-
Node1] mmlsfileset fs1 mufileset --afm -L
Filesets in file system 'fs1':
Attributes for fileset mufileset: ================================== Status Linked Path /gpfs/fs1/mufileset Id 125 Root inode 102236163 Parent Id 0 Created Wed Apr 20 03:54:03 2022 Comment Inode space 99 Maximum number of inodes 100352 Allocated inodes 100352 Permission change flag chmodAndSetacl afm-associated Yes Permission inherit flag inheritAclOnly Target https://s3.amazonaws.com:443/mufileset Mode manual-updates File Lookup Refresh Interval 120 File Open Refresh Interval 120 Dir Lookup Refresh Interval 120 Dir Open Refresh Interval 120 Async Delay disable Last pSnapId 0 Display Home Snapshots no Parallel Read Chunk Size 0 Number of Gateway Flush Threads 8 Prefetch Threshold 0 (default) Eviction Enabled yes (default) IO Flags 0x8280000 (afmObjectXattr,afmObjectDirectoryObj,afmObjectACL) IO Flags2 0x0 Node1]
- Files present in the manual-updates mode fileset
-
Node1] ls -l /gpfs/fs1/mufileset/
total 0 -rw-r--r-- 1 root root 0 Apr 29 08:42 extrafile1 -rw-r--r-- 1 root root 0 Apr 29 08:42 extrafile2 -rw-r--r-- 1 root root 0 Apr 29 08:42 extrafile3 -rw-r--r-- 1 root root 0 Apr 29 08:42 extrafile4 -rw-r--r-- 1 root root 0 Apr 29 08:42 extrafile5 -rw-r--r-- 1 root root 0 Apr 29 08:41 file1 -rw-r--r-- 1 root root 0 Apr 29 08:41 file2 -rw-r--r-- 1 root root 0 Apr 29 08:41 file3 -rw-r--r-- 1 root root 0 Apr 29 08:41 file4 -rw-r--r-- 1 root root 0 Apr 29 08:41 file5 -rw-r--r-- 1 root root 0 Apr 29 08:42 IBM1 -rw-r--r-- 1 root root 0 Apr 29 08:42 IBM2 -rw-r--r-- 1 root root 0 Apr 29 08:42 oneIBM -rw-r--r-- 1 root root 0 Apr 29 08:42 twoIBM Policy to transfer files which have IBM in their names respectively Node1] cat policyfile1 RULE EXTERNAL LIST 'dirtyFiles' RULE 'dirtyFilesRule' LIST 'dirtyFiles' WHERE NAME LIKE '%IBM%' AND PATH_NAME NOT LIKE '$filesetPath/.pconflicts/%' AND PATH_NAME NOT LIKE '$filesetPath/.afm/%' AND PATH_NAME NOT LIKE '$filesetPath/.ptrash/%'
Issue the following command on Node1]:mmafmcosctl fs1 mufileset /gpfs/fs1/mufileset reconcile --policy policyfile1
Dirty file list : /var/mmfs/afm/fs1-125/recovery/policylist.data.list.dirtyFiles Queued (Total) Failed TotalData (approx in Bytes) 4 (4) 0 0 Object Upload successfully queued at the gateway. Could not find any deleted files.