Immutability Objectives in Hammerspace
There are several ways to make data immutable in Hammerspace using different objectives. To avoid confusion, it’s important to understand how the different objectives work and when to use each one. The three objectives important for WORM are:
-
deny-write— When active, this objective prevents subject files from being modified. Appending data, overwriting data, and filename changes are not allowed. It is typically paired withdeny-delete, though it may be used by itself. -
deny-delete— When active, this objective prevents subject files from being deleted.deny-deleteis typically used along withdeny-write, though it may be used by itself. -
worm-operation— This is a compound objective which combines thedeny-deleteanddeny-writeobjectives with some attributes and conditional logic. Its definition in Hammerscript looks like this (carriage returns added for clarity):
IF ATTRIBUTES.WORM_EXPIRE_DATE>NOW
OR ATTRIBUTES.LEGAL_HOLD_EXPIRE_DATE>NOW
THEN {SLO('deny-delete'),SLO('deny-write')}
This is an excellent example of the flexibility of Hammerspace objectives, and follows a simple IF A OR B THEN C format. There are two attributes referenced, WORM_EXPIRE_DATE and LEGAL_HOLD_EXPIRE_DATE. If the value of either of these attributes is in the future (>NOW), then the two listed Service Level Objectives (SLOs) deny-delete and deny-write take effect. Attributes are just one category of metadata in Hammerspace that can be used to define objectives.
In the Hammerspace GUI, the WORM_EXPIRE_DATE attribute is set when enabling worm-operation on a share using the checkbox on the Share Details tab, as shown below. If worm-operation is configured elsewhere, such as on the Objectives tab of the share properties, or on the command line, WORM_EXPIRE_DATE must be set manually using the Hammerspace Toolkit (HSTK) hs attribute command.
LEGAL_HOLD_EXPIRE_DATE does not currently appear in the GUI, but like all attributes, it may be set using HSTK or through other command line methods.
For more general information on attributes, refer to the Hammerspace Objectives Solutions Guide found on the Hammerspace Support Hub.
So, when should worm-operation be used vs. deny-write and deny-delete? It depends on the goal. If the need is simply to create a share where the entire contents will be protected from changes and deletions until a particular date, use worm-operation. For more sophisticated needs, as with most of the use case examples later in this document, use deny-write and deny-delete to provide immutability.