Affinities
This section describes StorNext’s “stripe group affinity” feature, and also provides some common use cases.
Term | Definition |
---|---|
Stripe Group |
A collection of LUNs (typically disks or arrays) across which data is striped. Each stripe group also has a number of associated attributes, including affinity and exclusivity. |
Affinity |
Used to steer the allocation of a file’s data onto a set of stripe groups. Affinities are referenced by their name, which may be up to eight characters long. An affinity may be assigned to a set of stripe groups, representing a named pool of space, and to a file or directory, representing the logical point in the file system and directing the storage to use the designated pool. Each stripe group can have zero, one, or more affinities, and a file or directory can have zero or one affinities associated with it. The default behavior is for stripe groups and files to have no affinities. |
Exclusivity |
Defines a stripe group that has one or more affinities and the |
Files with an affinity, exclusive or not, cannot be stored on stripe groups without that affinity. If all the stripe groups for an affinity become filled, no more files with said affinity can be stored, even if there are stripe groups with no affinity at all. This is independent of exclusivity.
Files with no affinity can be stored on stripe groups with affinities and available space without the exclusive=true
attribute or on stripe groups with no affinities at all.
Turning on exclusivity can cause allocation failures for files with no affinity when there is space left on a stripe group. It does not affect allocation failures for files with an affinity, except indirectly by keeping the non-affinity files out of the way and thereby reserving the space just for affinity allocations.
Affinities for stripe groups are defined in the file system configuration file. A stripe group may have multiple affinities, and an affinity may be assigned to multiple stripe groups.

Auto Affinities designate the affinity (stripe group[s]) to which allocations will be targeted for all files on the file system whose name has the specified file extension.
See the StorNext Online Help for more details on how to configure Auto Affinities using the GUI.

Affinity Preference allows files of a particular affinity to have their allocations placed on other available stripe groups (with non-exclusive affinities) when the stripe groups of their assigned affinity do not have sufficient space. Otherwise, allocation attempts will fail with an out-of-space error.
See the StorNext Online Help for more details on how to configure Affinity Preference using the GUI.

StorNext has multiple allocation strategies which can be set at the file system level. These strategies control where a new file’s first blocks will be allocated. Affinities modify this behavior in two ways:
- A file with an affinity will be allocated only on a stripe group with matching affinity.
- A stripe group with an affinity and the exclusive attribute will be used only for allocations by files with matching affinity.
Once a file has been created, StorNext attempts to keep all of its data on the same stripe group. If there is no more space on that stripe group, data may be allocated from another stripe group. If the file has an affinity, only stripe groups with that affinity will be considered; if all stripe groups with that affinity are full, new space may not be allocated for the file, even if other stripe groups are available.

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.)
-
Note: Beginning with StorNext 6, use the
sgoffload
command instead of thesnfsdefrag
command. Thesgoffload
command moves extents belonging to files that are currently in use (open). Thesgoffload
command also informs the client to suspend I/O for a time, moves the data, then informs the client to refresh the location of the data and resume I/O. - 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).

Follow this procedure to add an affinity.
-
On the Tools menu, click File Systems, and then click Affinities. The Tools > File Systems > Affinities page appears.
-
Click New. The New Affinity page appears.
- At the Affinity field, enter the name of the new affinity.
- At the File Systems field, select the file system to which you want to associate the new affinity.
- Click Apply to create the affinity.
- When a message notifies you that the affinity was successfully created, click OK to continue.

Follow this procedure to delete an affinity.
- On the Tools menu, click File Systems, and then click Affinities. The Tools > File Systems > Affinities page appears.
- Select the affinity you want to delete.
- Click Delete.
- When asked to confirm the deletion, click Yes to proceed or No to abort.
- When a message notifies you that the affinity was successfully deleted, click OK to continue.