]> git.proxmox.com Git - ceph.git/blob - ceph/doc/cephfs/fs-volumes.rst
import ceph quincy 17.2.6
[ceph.git] / ceph / doc / cephfs / fs-volumes.rst
1 .. _fs-volumes-and-subvolumes:
2
3 FS volumes and subvolumes
4 =========================
5
6 A single source of truth for CephFS exports is implemented in the volumes
7 module of the :term:`Ceph Manager` daemon (ceph-mgr). The OpenStack shared
8 file system service (manila_), Ceph Container Storage Interface (CSI_),
9 storage administrators among others can use the common CLI provided by the
10 ceph-mgr volumes module to manage the CephFS exports.
11
12 The ceph-mgr volumes module implements the following file system export
13 abstractions:
14
15 * FS volumes, an abstraction for CephFS file systems
16
17 * FS subvolumes, an abstraction for independent CephFS directory trees
18
19 * FS subvolume groups, an abstraction for a directory level higher than FS
20 subvolumes to effect policies (e.g., :doc:`/cephfs/file-layouts`) across a
21 set of subvolumes
22
23 Some possible use-cases for the export abstractions:
24
25 * FS subvolumes used as manila shares or CSI volumes
26
27 * FS subvolume groups used as manila share groups
28
29 Requirements
30 ------------
31
32 * Nautilus (14.2.x) or a later version of Ceph
33
34 * Cephx client user (see :doc:`/rados/operations/user-management`) with
35 the following minimum capabilities::
36
37 mon 'allow r'
38 mgr 'allow rw'
39
40
41 FS Volumes
42 ----------
43
44 Create a volume using::
45
46 $ ceph fs volume create <vol_name> [<placement>]
47
48 This creates a CephFS file system and its data and metadata pools. It can also
49 try to create MDSes for the filesystem using the enabled ceph-mgr orchestrator
50 module (see :doc:`/mgr/orchestrator`), e.g. rook.
51
52 <vol_name> is the volume name (an arbitrary string), and
53
54 <placement> is an optional string signifying which hosts should have NFS Ganesha
55 daemon containers running on them and, optionally, the total number of NFS
56 Ganesha daemons the cluster (should you want to have more than one NFS Ganesha
57 daemon running per node). For example, the following placement string means
58 "deploy NFS Ganesha daemons on nodes host1 and host2 (one daemon per host):
59
60 "host1,host2"
61
62 and this placement specification says to deploy two NFS Ganesha daemons each
63 on nodes host1 and host2 (for a total of four NFS Ganesha daemons in the
64 cluster):
65
66 "4 host1,host2"
67
68 For more details on placement specification refer to the :ref:`orchestrator-cli-service-spec`,
69 but keep in mind that specifying the placement via a YAML file is not supported.
70
71 Remove a volume using::
72
73 $ ceph fs volume rm <vol_name> [--yes-i-really-mean-it]
74
75 This removes a file system and its data and metadata pools. It also tries to
76 remove MDSes using the enabled ceph-mgr orchestrator module.
77
78 List volumes using::
79
80 $ ceph fs volume ls
81
82 Rename a volume using::
83
84 $ ceph fs volume rename <vol_name> <new_vol_name> [--yes-i-really-mean-it]
85
86 Renaming a volume can be an expensive operation. It does the following:
87
88 - renames the orchestrator managed MDS service to match the <new_vol_name>.
89 This involves launching a MDS service with <new_vol_name> and bringing down
90 the MDS service with <vol_name>.
91 - renames the file system matching <vol_name> to <new_vol_name>
92 - changes the application tags on the data and metadata pools of the file system
93 to <new_vol_name>
94 - renames the metadata and data pools of the file system.
95
96 The CephX IDs authorized to <vol_name> need to be reauthorized to <new_vol_name>. Any
97 on-going operations of the clients using these IDs may be disrupted. Mirroring is
98 expected to be disabled on the volume.
99
100 Fetch the information of a CephFS volume using::
101
102 $ ceph fs volume info vol_name [--human_readable]
103
104 The ``--human_readable`` flag shows used and available pool capacities in KB/MB/GB.
105
106 The output format is JSON and contains fields as follows:
107
108 * pools: Attributes of data and metadata pools
109 * avail: The amount of free space available in bytes
110 * used: The amount of storage consumed in bytes
111 * name: Name of the pool
112 * mon_addrs: List of monitor addresses
113 * used_size: Current used size of the CephFS volume in bytes
114 * pending_subvolume_deletions: Number of subvolumes pending deletion
115
116 Sample output of volume info command::
117
118 $ ceph fs volume info vol_name
119 {
120 "mon_addrs": [
121 "192.168.1.7:40977"
122 ],
123 "pending_subvolume_deletions": 0,
124 "pools": {
125 "data": [
126 {
127 "avail": 106288709632,
128 "name": "cephfs.vol_name.data",
129 "used": 4096
130 }
131 ],
132 "metadata": [
133 {
134 "avail": 106288709632,
135 "name": "cephfs.vol_name.meta",
136 "used": 155648
137 }
138 ]
139 },
140 "used_size": 0
141 }
142
143 FS Subvolume groups
144 -------------------
145
146 Create a subvolume group using::
147
148 $ ceph fs subvolumegroup create <vol_name> <group_name> [--size <size_in_bytes>] [--pool_layout <data_pool_name>] [--uid <uid>] [--gid <gid>] [--mode <octal_mode>]
149
150 The command succeeds even if the subvolume group already exists.
151
152 When creating a subvolume group you can specify its data pool layout (see
153 :doc:`/cephfs/file-layouts`), uid, gid, file mode in octal numerals and
154 size in bytes. The size of the subvolume group is specified by setting
155 a quota on it (see :doc:`/cephfs/quota`). By default, the subvolume group
156 is created with an octal file mode '755', uid '0', gid '0' and data pool
157 layout of its parent directory.
158
159
160 Remove a subvolume group using::
161
162 $ ceph fs subvolumegroup rm <vol_name> <group_name> [--force]
163
164 The removal of a subvolume group fails if it is not empty or non-existent.
165 '--force' flag allows the non-existent subvolume group remove command to succeed.
166
167
168 Fetch the absolute path of a subvolume group using::
169
170 $ ceph fs subvolumegroup getpath <vol_name> <group_name>
171
172 List subvolume groups using::
173
174 $ ceph fs subvolumegroup ls <vol_name>
175
176 .. note:: Subvolume group snapshot feature is no longer supported in mainline CephFS (existing group
177 snapshots can still be listed and deleted)
178
179 Fetch the metadata of a subvolume group using::
180
181 $ ceph fs subvolumegroup info <vol_name> <group_name>
182
183 The output format is json and contains fields as follows.
184
185 * atime: access time of subvolume group path in the format "YYYY-MM-DD HH:MM:SS"
186 * mtime: modification time of subvolume group path in the format "YYYY-MM-DD HH:MM:SS"
187 * ctime: change time of subvolume group path in the format "YYYY-MM-DD HH:MM:SS"
188 * uid: uid of subvolume group path
189 * gid: gid of subvolume group path
190 * mode: mode of subvolume group path
191 * mon_addrs: list of monitor addresses
192 * bytes_pcent: quota used in percentage if quota is set, else displays "undefined"
193 * bytes_quota: quota size in bytes if quota is set, else displays "infinite"
194 * bytes_used: current used size of the subvolume group in bytes
195 * created_at: time of creation of subvolume group in the format "YYYY-MM-DD HH:MM:SS"
196 * data_pool: data pool the subvolume group belongs to
197
198 Check the presence of any subvolume group using::
199
200 $ ceph fs subvolumegroup exist <vol_name>
201
202 The strings returned by the 'exist' command:
203
204 * "subvolumegroup exists": if any subvolumegroup is present
205 * "no subvolumegroup exists": if no subvolumegroup is present
206
207 .. note:: It checks for the presence of custom groups and not the default one. To validate the emptiness of the volume, subvolumegroup existence check alone is not sufficient. The subvolume existence also needs to be checked as there might be subvolumes in the default group.
208
209 Resize a subvolume group using::
210
211 $ ceph fs subvolumegroup resize <vol_name> <group_name> <new_size> [--no_shrink]
212
213 The command resizes the subvolume group quota using the size specified by 'new_size'.
214 The '--no_shrink' flag prevents the subvolume group to shrink below the current used
215 size of the subvolume group.
216
217 The subvolume group can be resized to an infinite size by passing 'inf' or 'infinite'
218 as the new_size.
219
220 Remove a snapshot of a subvolume group using::
221
222 $ ceph fs subvolumegroup snapshot rm <vol_name> <group_name> <snap_name> [--force]
223
224 Using the '--force' flag allows the command to succeed that would otherwise
225 fail if the snapshot did not exist.
226
227 List snapshots of a subvolume group using::
228
229 $ ceph fs subvolumegroup snapshot ls <vol_name> <group_name>
230
231
232 FS Subvolumes
233 -------------
234
235 Create a subvolume using::
236
237 $ ceph fs subvolume create <vol_name> <subvol_name> [--size <size_in_bytes>] [--group_name <subvol_group_name>] [--pool_layout <data_pool_name>] [--uid <uid>] [--gid <gid>] [--mode <octal_mode>] [--namespace-isolated]
238
239
240 The command succeeds even if the subvolume already exists.
241
242 When creating a subvolume you can specify its subvolume group, data pool layout,
243 uid, gid, file mode in octal numerals, and size in bytes. The size of the subvolume is
244 specified by setting a quota on it (see :doc:`/cephfs/quota`). The subvolume can be
245 created in a separate RADOS namespace by specifying --namespace-isolated option. By
246 default a subvolume is created within the default subvolume group, and with an octal file
247 mode '755', uid of its subvolume group, gid of its subvolume group, data pool layout of
248 its parent directory and no size limit.
249
250 Remove a subvolume using::
251
252 $ ceph fs subvolume rm <vol_name> <subvol_name> [--group_name <subvol_group_name>] [--force] [--retain-snapshots]
253
254
255 The command removes the subvolume and its contents. It does this in two steps.
256 First, it moves the subvolume to a trash folder, and then asynchronously purges
257 its contents.
258
259 The removal of a subvolume fails if it has snapshots, or is non-existent.
260 '--force' flag allows the non-existent subvolume remove command to succeed.
261
262 A subvolume can be removed retaining existing snapshots of the subvolume using the
263 '--retain-snapshots' option. If snapshots are retained, the subvolume is considered
264 empty for all operations not involving the retained snapshots.
265
266 .. note:: Snapshot retained subvolumes can be recreated using 'ceph fs subvolume create'
267
268 .. note:: Retained snapshots can be used as a clone source to recreate the subvolume, or clone to a newer subvolume.
269
270 Resize a subvolume using::
271
272 $ ceph fs subvolume resize <vol_name> <subvol_name> <new_size> [--group_name <subvol_group_name>] [--no_shrink]
273
274 The command resizes the subvolume quota using the size specified by 'new_size'.
275 '--no_shrink' flag prevents the subvolume to shrink below the current used size of the subvolume.
276
277 The subvolume can be resized to an infinite size by passing 'inf' or 'infinite' as the new_size.
278
279 Authorize cephx auth IDs, the read/read-write access to fs subvolumes::
280
281 $ ceph fs subvolume authorize <vol_name> <sub_name> <auth_id> [--group_name=<group_name>] [--access_level=<access_level>]
282
283 The 'access_level' takes 'r' or 'rw' as value.
284
285 Deauthorize cephx auth IDs, the read/read-write access to fs subvolumes::
286
287 $ ceph fs subvolume deauthorize <vol_name> <sub_name> <auth_id> [--group_name=<group_name>]
288
289 List cephx auth IDs authorized to access fs subvolume::
290
291 $ ceph fs subvolume authorized_list <vol_name> <sub_name> [--group_name=<group_name>]
292
293 Evict fs clients based on auth ID and subvolume mounted::
294
295 $ ceph fs subvolume evict <vol_name> <sub_name> <auth_id> [--group_name=<group_name>]
296
297 Fetch the absolute path of a subvolume using::
298
299 $ ceph fs subvolume getpath <vol_name> <subvol_name> [--group_name <subvol_group_name>]
300
301 Fetch the information of a subvolume using::
302
303 $ ceph fs subvolume info <vol_name> <subvol_name> [--group_name <subvol_group_name>]
304
305 The output format is json and contains fields as follows.
306
307 * atime: access time of subvolume path in the format "YYYY-MM-DD HH:MM:SS"
308 * mtime: modification time of subvolume path in the format "YYYY-MM-DD HH:MM:SS"
309 * ctime: change time of subvolume path in the format "YYYY-MM-DD HH:MM:SS"
310 * uid: uid of subvolume path
311 * gid: gid of subvolume path
312 * mode: mode of subvolume path
313 * mon_addrs: list of monitor addresses
314 * bytes_pcent: quota used in percentage if quota is set, else displays "undefined"
315 * bytes_quota: quota size in bytes if quota is set, else displays "infinite"
316 * bytes_used: current used size of the subvolume in bytes
317 * created_at: time of creation of subvolume in the format "YYYY-MM-DD HH:MM:SS"
318 * data_pool: data pool the subvolume belongs to
319 * path: absolute path of a subvolume
320 * type: subvolume type indicating whether it's clone or subvolume
321 * pool_namespace: RADOS namespace of the subvolume
322 * features: features supported by the subvolume
323 * state: current state of the subvolume
324
325 If a subvolume has been removed retaining its snapshots, the output only contains fields as follows.
326
327 * type: subvolume type indicating whether it's clone or subvolume
328 * features: features supported by the subvolume
329 * state: current state of the subvolume
330
331 The subvolume "features" are based on the internal version of the subvolume and is a list containing
332 a subset of the following features,
333
334 * "snapshot-clone": supports cloning using a subvolumes snapshot as the source
335 * "snapshot-autoprotect": supports automatically protecting snapshots, that are active clone sources, from deletion
336 * "snapshot-retention": supports removing subvolume contents, retaining any existing snapshots
337
338 The subvolume "state" is based on the current state of the subvolume and contains one of the following values.
339
340 * "complete": subvolume is ready for all operations
341 * "snapshot-retained": subvolume is removed but its snapshots are retained
342
343 List subvolumes using::
344
345 $ ceph fs subvolume ls <vol_name> [--group_name <subvol_group_name>]
346
347 .. note:: subvolumes that are removed but have snapshots retained, are also listed.
348
349 Check the presence of any subvolume using::
350
351 $ ceph fs subvolume exist <vol_name> [--group_name <subvol_group_name>]
352
353 The strings returned by the 'exist' command:
354
355 * "subvolume exists": if any subvolume of given group_name is present
356 * "no subvolume exists": if no subvolume of given group_name is present
357
358 Set custom metadata on the subvolume as a key-value pair using::
359
360 $ ceph fs subvolume metadata set <vol_name> <subvol_name> <key_name> <value> [--group_name <subvol_group_name>]
361
362 .. note:: If the key_name already exists then the old value will get replaced by the new value.
363
364 .. note:: key_name and value should be a string of ASCII characters (as specified in python's string.printable). key_name is case-insensitive and always stored in lower case.
365
366 .. note:: Custom metadata on a subvolume is not preserved when snapshotting the subvolume, and hence, is also not preserved when cloning the subvolume snapshot.
367
368 Get custom metadata set on the subvolume using the metadata key::
369
370 $ ceph fs subvolume metadata get <vol_name> <subvol_name> <key_name> [--group_name <subvol_group_name>]
371
372 List custom metadata (key-value pairs) set on the subvolume using::
373
374 $ ceph fs subvolume metadata ls <vol_name> <subvol_name> [--group_name <subvol_group_name>]
375
376 Remove custom metadata set on the subvolume using the metadata key::
377
378 $ ceph fs subvolume metadata rm <vol_name> <subvol_name> <key_name> [--group_name <subvol_group_name>] [--force]
379
380 Using the '--force' flag allows the command to succeed that would otherwise
381 fail if the metadata key did not exist.
382
383 Create a snapshot of a subvolume using::
384
385 $ ceph fs subvolume snapshot create <vol_name> <subvol_name> <snap_name> [--group_name <subvol_group_name>]
386
387
388 Remove a snapshot of a subvolume using::
389
390 $ ceph fs subvolume snapshot rm <vol_name> <subvol_name> <snap_name> [--group_name <subvol_group_name>] [--force]
391
392 Using the '--force' flag allows the command to succeed that would otherwise
393 fail if the snapshot did not exist.
394
395 .. note:: if the last snapshot within a snapshot retained subvolume is removed, the subvolume is also removed
396
397 List snapshots of a subvolume using::
398
399 $ ceph fs subvolume snapshot ls <vol_name> <subvol_name> [--group_name <subvol_group_name>]
400
401 Fetch the information of a snapshot using::
402
403 $ ceph fs subvolume snapshot info <vol_name> <subvol_name> <snap_name> [--group_name <subvol_group_name>]
404
405 The output format is json and contains fields as follows.
406
407 * created_at: time of creation of snapshot in the format "YYYY-MM-DD HH:MM:SS:ffffff"
408 * data_pool: data pool the snapshot belongs to
409 * has_pending_clones: "yes" if snapshot clone is in progress otherwise "no"
410 * pending_clones: list of in progress or pending clones and their target group if exist otherwise this field is not shown
411 * orphan_clones_count: count of orphan clones if snapshot has orphan clones otherwise this field is not shown
412
413 Sample output if snapshot clones are in progress or pending state::
414
415 $ ceph fs subvolume snapshot info cephfs subvol snap
416 {
417 "created_at": "2022-06-14 13:54:58.618769",
418 "data_pool": "cephfs.cephfs.data",
419 "has_pending_clones": "yes",
420 "pending_clones": [
421 {
422 "name": "clone_1",
423 "target_group": "target_subvol_group"
424 },
425 {
426 "name": "clone_2"
427 },
428 {
429 "name": "clone_3",
430 "target_group": "target_subvol_group"
431 }
432 ]
433 }
434
435 Sample output if no snapshot clone is in progress or pending state::
436
437 $ ceph fs subvolume snapshot info cephfs subvol snap
438 {
439 "created_at": "2022-06-14 13:54:58.618769",
440 "data_pool": "cephfs.cephfs.data",
441 "has_pending_clones": "no"
442 }
443
444 Set custom metadata on the snapshot as a key-value pair using::
445
446 $ ceph fs subvolume snapshot metadata set <vol_name> <subvol_name> <snap_name> <key_name> <value> [--group_name <subvol_group_name>]
447
448 .. note:: If the key_name already exists then the old value will get replaced by the new value.
449
450 .. note:: The key_name and value should be a string of ASCII characters (as specified in python's string.printable). The key_name is case-insensitive and always stored in lower case.
451
452 .. note:: Custom metadata on a snapshots is not preserved when snapshotting the subvolume, and hence, is also not preserved when cloning the subvolume snapshot.
453
454 Get custom metadata set on the snapshot using the metadata key::
455
456 $ ceph fs subvolume snapshot metadata get <vol_name> <subvol_name> <snap_name> <key_name> [--group_name <subvol_group_name>]
457
458 List custom metadata (key-value pairs) set on the snapshot using::
459
460 $ ceph fs subvolume snapshot metadata ls <vol_name> <subvol_name> <snap_name> [--group_name <subvol_group_name>]
461
462 Remove custom metadata set on the snapshot using the metadata key::
463
464 $ ceph fs subvolume snapshot metadata rm <vol_name> <subvol_name> <snap_name> <key_name> [--group_name <subvol_group_name>] [--force]
465
466 Using the '--force' flag allows the command to succeed that would otherwise
467 fail if the metadata key did not exist.
468
469 Cloning Snapshots
470 -----------------
471
472 Subvolumes can be created by cloning subvolume snapshots. Cloning is an asynchronous operation involving copying
473 data from a snapshot to a subvolume. Due to this bulk copy nature, cloning is currently inefficient for very huge
474 data sets.
475
476 .. note:: Removing a snapshot (source subvolume) would fail if there are pending or in progress clone operations.
477
478 Protecting snapshots prior to cloning was a pre-requisite in the Nautilus release, and the commands to protect/unprotect
479 snapshots were introduced for this purpose. This pre-requisite, and hence the commands to protect/unprotect, is being
480 deprecated in mainline CephFS, and may be removed from a future release.
481
482 The commands being deprecated are:
483 $ ceph fs subvolume snapshot protect <vol_name> <subvol_name> <snap_name> [--group_name <subvol_group_name>]
484 $ ceph fs subvolume snapshot unprotect <vol_name> <subvol_name> <snap_name> [--group_name <subvol_group_name>]
485
486 .. note:: Using the above commands would not result in an error, but they serve no useful function.
487
488 .. note:: Use subvolume info command to fetch subvolume metadata regarding supported "features" to help decide if protect/unprotect of snapshots is required, based on the "snapshot-autoprotect" feature availability.
489
490 To initiate a clone operation use::
491
492 $ ceph fs subvolume snapshot clone <vol_name> <subvol_name> <snap_name> <target_subvol_name>
493
494 If a snapshot (source subvolume) is a part of non-default group, the group name needs to be specified as per::
495
496 $ ceph fs subvolume snapshot clone <vol_name> <subvol_name> <snap_name> <target_subvol_name> --group_name <subvol_group_name>
497
498 Cloned subvolumes can be a part of a different group than the source snapshot (by default, cloned subvolumes are created in default group). To clone to a particular group use::
499
500 $ ceph fs subvolume snapshot clone <vol_name> <subvol_name> <snap_name> <target_subvol_name> --target_group_name <subvol_group_name>
501
502 Similar to specifying a pool layout when creating a subvolume, pool layout can be specified when creating a cloned subvolume. To create a cloned subvolume with a specific pool layout use::
503
504 $ ceph fs subvolume snapshot clone <vol_name> <subvol_name> <snap_name> <target_subvol_name> --pool_layout <pool_layout>
505
506 Configure maximum number of concurrent clones. The default is set to 4::
507
508 $ ceph config set mgr mgr/volumes/max_concurrent_clones <value>
509
510 To check the status of a clone operation use::
511
512 $ ceph fs clone status <vol_name> <clone_name> [--group_name <group_name>]
513
514 A clone can be in one of the following states:
515
516 #. `pending` : Clone operation has not started
517 #. `in-progress` : Clone operation is in progress
518 #. `complete` : Clone operation has successfully finished
519 #. `failed` : Clone operation has failed
520 #. `canceled` : Clone operation is cancelled by user
521
522 The reason for a clone failure is shown as below:
523
524 #. `errno` : error number
525 #. `error_msg` : failure error string
526
527 Sample output of an `in-progress` clone operation::
528
529 $ ceph fs subvolume snapshot clone cephfs subvol1 snap1 clone1
530 $ ceph fs clone status cephfs clone1
531 {
532 "status": {
533 "state": "in-progress",
534 "source": {
535 "volume": "cephfs",
536 "subvolume": "subvol1",
537 "snapshot": "snap1"
538 }
539 }
540 }
541
542 .. note:: The `failure` section will be shown only if the clone is in failed or cancelled state
543
544 Sample output of a `failed` clone operation::
545
546 $ ceph fs subvolume snapshot clone cephfs subvol1 snap1 clone1
547 $ ceph fs clone status cephfs clone1
548 {
549 "status": {
550 "state": "failed",
551 "source": {
552 "volume": "cephfs",
553 "subvolume": "subvol1",
554 "snapshot": "snap1"
555 "size": "104857600"
556 },
557 "failure": {
558 "errno": "122",
559 "errstr": "Disk quota exceeded"
560 }
561 }
562 }
563
564 (NOTE: since `subvol1` is in default group, `source` section in `clone status` does not include group name)
565
566 .. note:: Cloned subvolumes are accessible only after the clone operation has successfully completed.
567
568 For a successful clone operation, `clone status` would look like so::
569
570 $ ceph fs clone status cephfs clone1
571 {
572 "status": {
573 "state": "complete"
574 }
575 }
576
577 or `failed` state when clone is unsuccessful.
578
579 On failure of a clone operation, the partial clone needs to be deleted and the clone operation needs to be retriggered.
580 To delete a partial clone use::
581
582 $ ceph fs subvolume rm <vol_name> <clone_name> [--group_name <group_name>] --force
583
584 .. note:: Cloning only synchronizes directories, regular files and symbolic links. Also, inode timestamps (access and
585 modification times) are synchronized up to seconds granularity.
586
587 An `in-progress` or a `pending` clone operation can be canceled. To cancel a clone operation use the `clone cancel` command::
588
589 $ ceph fs clone cancel <vol_name> <clone_name> [--group_name <group_name>]
590
591 On successful cancellation, the cloned subvolume is moved to `canceled` state::
592
593 $ ceph fs subvolume snapshot clone cephfs subvol1 snap1 clone1
594 $ ceph fs clone cancel cephfs clone1
595 $ ceph fs clone status cephfs clone1
596 {
597 "status": {
598 "state": "canceled",
599 "source": {
600 "volume": "cephfs",
601 "subvolume": "subvol1",
602 "snapshot": "snap1"
603 }
604 }
605 }
606
607 .. note:: The canceled cloned can be deleted by using --force option in `fs subvolume rm` command.
608
609
610 .. _subvol-pinning:
611
612 Pinning Subvolumes and Subvolume Groups
613 ---------------------------------------
614
615
616 Subvolumes and subvolume groups can be automatically pinned to ranks according
617 to policies. This can help distribute load across MDS ranks in predictable and
618 stable ways. Review :ref:`cephfs-pinning` and :ref:`cephfs-ephemeral-pinning`
619 for details on how pinning works.
620
621 Pinning is configured by::
622
623 $ ceph fs subvolumegroup pin <vol_name> <group_name> <pin_type> <pin_setting>
624
625 or for subvolumes::
626
627 $ ceph fs subvolume pin <vol_name> <group_name> <pin_type> <pin_setting>
628
629 Typically you will want to set subvolume group pins. The ``pin_type`` may be
630 one of ``export``, ``distributed``, or ``random``. The ``pin_setting``
631 corresponds to the extended attributed "value" as in the pinning documentation
632 referenced above.
633
634 So, for example, setting a distributed pinning strategy on a subvolume group::
635
636 $ ceph fs subvolumegroup pin cephfilesystem-a csi distributed 1
637
638 Will enable distributed subtree partitioning policy for the "csi" subvolume
639 group. This will cause every subvolume within the group to be automatically
640 pinned to one of the available ranks on the file system.
641
642
643 .. _manila: https://github.com/openstack/manila
644 .. _CSI: https://github.com/ceph/ceph-csi