Whamcloud - gitweb
LU-10918 llite: Rule based auto PCC caching when create files
[fs/lustre-release.git] / lustre / doc / lfs-pcc.1
1 .TH LFS-PCC 1 2019-04-15 "Lustre" "Lustre Utilities"
2 .SH NAME
3 lfs pcc commands used to interact with PCC features.
4 .SH SYNOPSIS
5 .B lfs pcc attach <\fB--id\fR|\fB-i\fR \fINUM\fR>  <\fIfile \fR...>
6 .br
7 .B lfs pcc attach <\fB--id\fR|\fB-i\fR \fINUM\fR>  <\fB--mnt\fR|\fB-m\fR \fImntpath\fR> <\fIfid \fR...>
8 .br
9 .B lfs pcc detach <\fIfile \fR...>
10 .br
11 .B lfs pcc detach_fid <\fImntpath\fR> <\fIfid \fR...>
12 .br
13 .B lfs pcc state <\fIfile \fR...>
14 .SH DESCRIPTION
15 .TP
16 .B lfs pcc attach <\fB--id\fR|\fB-i\fR \fINUM\fR>  <\fIfile \fR...>
17 Attach given files on the persistent client cache.
18 .TP
19 .B lfs pcc attach <\fB--id\fR|\fB-i\fR \fINUM\fR>  <\fB--mnt\fR|\fB-m\fR \fImntpath\fR> <\fIfid \fR...>
20 Attach given fils into the persistent client cache by FID(s).
21 .TP
22 .B lfs pcc detach <\fIfile \fR...>
23 Detach given files from the persistent client cache.
24 .TP
25 .B lfs pcc detach_fid <\fImntpath\fR> <\fIfid \fR...>
26 Detach files from the persistent client cache by FID(s).
27 .TP
28 .B lfs pcc state <\fIfile \fR...>
29 Display the PCC state for given files.
30 .TP
31 .SH OPTIONS
32 .TP
33 .B --id | -i
34 For RW-PCC, it is HSM ARCHIVE ID to choose which backend for cache files.
35 .TP
36 .B --mnt | -m
37 Specify the Lustre mount point.
38 .TP
39 Before using RW-PCC, you need to configure HSM root and Archive ID mapping properly:
40 .TP
41 .B lfs pcc add $MNTPATH $PCCPATH \ "$PARAM"
42 Add one PCC backend to the Lustre client. For RW-PCC, when a file is being
43 created, a rule-based policy is used to determine whether it will be cached.
44 The rule expression supports logical conditional conjunction and disjunction
45 operations among different users, groups, projects, or filenames including
46 wildcards. You need to specify auto create caching rule and archive ID in
47 .B $PARAM.
48 On this client any subsequently created files matching the condition of auto
49 caching rule will be persistently cached automatically.
50 .TP
51 .B lfs pcc del $MNTPATH $PCCPATH
52  Delete one PCC backend
53 .TP
54 .B lfs pcc clear $MNTPATH
55  Clear and remove all PCC backends for the client.
56 .TP
57 .SH EXAMPLES
58 .TP
59 .B # lctl set_param mdt.$FSNAME-MDT0000.hsm_control=enabled
60 Enable HSM on the appropriate MDT.
61 .TP
62 .B # lhsmtool_posix --daemon --hsm-root /mnt/pcc/ --archive=1 /mnt/lustre
63 Launch one copytool on client node to connect cache storage.
64 .TP
65 .B # lfs pcc add /mnt/lustre /mnt/pcc \ "projid={500,1000}&fname={*.h5},uid=1001 rwid=1"
66 Add HSM root and Archive ID (referenced by
67 .IB rwid
68 name-value pair) mapping for RW-PCC. Where "&" represents the logical
69 conjunction operator while "," represents the logical disjunction operator.
70 The example rule means that new files are only auto cached if the project ID is
71 either 500 or 1000 and the suffix of the file name is “h5” or the user ID is
72 1001.
73 .TP
74 .B $ lfs pcc attach -i 1 /mnt/lustre/file
75 Attach an existing file into PCC and migrate data from lustre to Cache Device,
76 any I/O to the Lustre file will direct to the RW-PCC copy.
77 .TP
78 .B $ lfs pcc attach_fid -i 1 -m /mnt/lustre 0x200000401:0x1:0x0
79 Attach an existing file referenced by FID "0x200000401:0x1:0x0" into PCC.
80 .TP
81 .B $ lfs pcc detach /mnt/lustre/file
82 Detach the file from RW-PCC, IO to the file will come to Lustre after this
83 command.
84 .B $ lfs pcc detach_fid /mnt/lustre 0x200000401:0x1:0x0
85 Detach the file referenced by FID "0x200000401:0x1:0x0" from PCC.
86 .TP
87 .B $ lfs pcc state /mnt/lustre/file
88 .br
89 file: /mnt/lustre/file, type: readwrite, PCC file: /mnt/pcc/0004/0000/0bd1/0000/0002/0000/0x200000bd1:0x4:0x0, user number: 1, flags: 6
90 .br
91 Display the PCC state of the file "/mnt/lustre/file".
92 .TP
93 .SH SEE ALSO
94 .BR lfs (1),
95 .BR lfs-hsm (1),
96 .BR lctl-pcc (8)