Example Use Cases

Affinities can be used to segregate audio and video files onto their own stripe groups. For example:

  • Create one or more stripe groups with an AUDIO affinity and the exclusive attribute.
  • Create one or more stripe groups with a VIDEO affinity and the exclusive attribute.
  • Create one or more stripe groups with no affinity (for non-audio, non-video files).
  • Create a directory for audio using ‘cvmkdir -k AUDIO audio’.
  • Create a directory for video using ‘cvmkdir -k VIDEO video’.

Files created within the audio directory will reside only on the AUDIO stripe group. (If this stripe group fills, no more audio files can be created.)

Files created within the video directory will reside only on the VIDEO stripe group. (If this stripe group fills, no more video files can be created.)

To reserve high-speed disk for critical files:

  • Create a stripe group with a FAST affinity and the exclusive attribute.
  • Label the critical files or directories with the FAST affinity.

The disadvantage here is that the critical files are restricted to only using the fast disk. If the fast disk fills up, the files will not have space allocated on slow disks.

To reserve high-speed disk for critical files, but allow them to grow onto slow disks:

  • Create a stripe group with a FAST affinity and the exclusive attribute.
  • Create all of the critical files, pre allocating at least one block of space, with the FAST affinity. (Or move them using snfsdefrag, after ensuring they are non-empty.)
  • Remove the FAST affinity from the critical files.

Because files will allocate from their existing stripe group, even if they no longer have a matching affinity, the critical files will continue to grow on the FAST stripe group. Once this stripe group is full, they can allocate space from other stripe groups, since they do not have an affinity.

This will not work if critical files may be created later, unless there is a process to move them to the FAST stripe group, or an affinity is set on the critical files by inheritance but removed after their first allocation (to allow them to grow onto non-FAST groups).