mmrestrictedctl command

Enables specific system functions that are reserved for privileged escalated administrators.

Synopsis

mmrestrictedctl Device deleteSnapshot [[Fileset]:]Snapshot[,[[Fileset]:]Snapshot]...
[-j FilesetName[,FilesetName...]]
[-N {all | mount | Node[,Node...]|NodeFile | NodeClass}]
[--pit-continues-on-error] [--qos QosClass]

Availability

Available on all IBM Storage Scale editions.

Description

Root users and sudo root users can use the mmrestrictedctl command to delete a GPFS snapshot prior to the expiration date of the retention period, if one is set. The command can be run on both global and fileset snapshots on which retention periods are set.

Parameters

Device
The device name of the file system for which the snapshot is to be deleted. File system names do not need to be fully qualified.
Fileset
Specifies the name of the fileset that contains the fileset snapshot to be deleted.
deleteSnapshot
Deletes a GPFS snapshot even if there is a current retention date which has not expired.
Snapshot
Specifies the name of the snapshot to be deleted.

The snapshot names are separated by a comma.

The snapshot specifier describes global and fileset snapshots. For example, Fileset1:Snapshot1 specifies a fileset snapshot named Snapshot1 for fileset Fileset1. If Fileset1 is empty, Snapshot1 is a global snapshot named Snapshot1.

Note: Ensure that the snapshot name does not include a colon (:), a comma (,), and whitespaces. If the snapshot name consists of a whitespace, the whitespace must be quoted and part of the snapshot name. For example, if the snap1 and snap A snapshots must be deleted, use the command 'mmrestrictedctl pk2 deleteSnapshot "snap A, snap1"'.
-j FilesetName
Specifies the name of the fileset that contains the fileset snapshot to be deleted (SnapshotName). If -j is not specified, the mmrestrictedctl command attempts to delete a global snapshot named SnapshotName.
Note: When a list of snapshots separated by a comma (,) is used with the -j option, the fileset is applicable to each snapshot that does not use the colon (:) syntax. The fileset name must not consist of a white space.
-N{all | mount | Node[,Node...]|NodeFile | NodeClass}]
Specifies the nodes that participate in deleting the snapshot. This command supports all defined node classes. The default is all or the current value of the defaultHelperNodes parameter of the mmchconfig command.

For general information on how to specify node names, see Specifying nodes as input to GPFS commands.

--pit-continues-on-error
Allows the mmrestrictedctl command to continue removing the remaining files, if errors are encountered in the parallel inode traverse (PIT) phase that performs the deletion of files in the snapshot. An output file is generated if an error occurs while deleting files in the snapshot. The location of the file that logs the errors is displayed in the command output.
Note:
  • The mmrestrictedctl command continues to run only if the error is reported in the PIT phase of the command execution. If the error is reported in other phases of command execution, the command stops running.
  • The --pit-continues-on-error option works only if the minimum release level of the IBM Storage Scale cluster is 5.1.1 or later.

The --pit-continues-on-error option allows the command to skip fatal errors encountered during the PIT phase and continue with the file system scan. If fatal errors are encountered, the command fails at the end of the scan and generates an output file that lists all the problematic files that had the fatal errors. Based on such output file, users can take additional actions to handle these problematic files before rerunning the command.

If --pit-continues-on-error is not used, the command run fails if a fatal error is encountered. Any error that is not included in the next table is considered as a fatal error.

Table 1. Non-fatal errors that can be encountered during the PIT phase
Non-fatal error Code Description
E_COMPRESS_NOT_ALLOWED 840 File compression is not allowed.
E_COMPRESS_HYPERALLOC 799 Compression of a file in hyperalloc mode is not allowed.
E_NOREPLGRP 219 Not enough replicas could be created because the desired degree of replication is larger than the number of failure groups.
E_NOREPLSPC 220 Not enough replicas could be created because there was not enough space left in one of the failure groups.
E_NOBALSPC 221 There was not enough space left on one of the disks to properly balance the file according to the current stripe method.
E_NOBALAVAIL 222 The file could not be properly balanced because one or more disks are unavailable.
E_ADDR_BROKEN 226 All replicas were on disks that have since been deleted from the stripe group.
E_ALL_UNAVAIL 218 A replicated read or write failed because none of the replicas were available.
E_ENC_CTX_NOT_READY 786 Encryption context is not ready.
--qos QosClass
Specifies the Quality of Service for I/O operations (QoS) class to which the instance of the command is assigned. If you do not specify this parameter, the instance of the command is assigned by default to the maintenance QoS class. This parameter has no effect unless the QoS service is enabled. For more information, see the topic mmchqos command. Specify one of the following QoS classes:
maintenance
This QoS class is typically configured to have a smaller share of file system IOPS. Use this class for I/O-intensive, potentially long-running IBM Storage Scale commands, so that they contribute less to reducing overall file system performance.
other
This QoS class is typically configured to have a larger share of file system IOPS. Use this class for administration commands that are not I/O-intensive.
For more information, see Setting the Quality of Service for I/O operations.

Exit status

0
Successful completion.
Nonzero
A failure occurred.

Security

You must have root authority or sudo root authority to run the mmrestrictedctl command when you delete global or fileset snapshots.

The node on which the command is issued must be able to execute remote shell commands on any other node in the cluster without the use of a password and without producing any extraneous messages. For more information, see Requirements for administering a GPFS file system.

Examples

An example of an output displaying an attempt and failure to delete a global snapshot where the retention time has not yet expired is shown.
Note: Deleting a fileset snapshot where the retention time has not yet expired also shows a failure output similar to the one shown.

[root@c40bbc4xn10 bin]# mmlssnapshot fs1
Snapshots in file system fs1:
Directory                SnapId    Status  Created                   ExpirationTime            Fileset
snap1                    34        Valid   Thu Jul 28 12:57:26 2022  Sat Dec 31 00:00:00 2022 
[root@c40bbc4xn10 bin]# date
Thu Jul 28 13:34:04 EDT 2022
[root@c40bbc4xn10 bin]# mmdelsnapshot fs1 snap1
The snapshot :snap1 cannot be deleted since its snapshot retention time is not yet expired.
Delete snapshot Error: :snap1, err = 1.
mmdelsnapshot: Command failed. Examine previous error messages to determine cause.
To delete a global snapshot protected by a retention time, issue the following command.
Note: You can also use the fileset options for non global snapshots.

[root@c40bbc4xn10 bin]# mmrestrictedctl fs1 deletesnapshot snap1
Invalidating snapshot files in :snap1...
Deleting files in snapshot :snap1...
 100.00 % complete on Thu Jul 28 13:32:06 2022  (    353280 inodes with total          4 MB data processed)
Invalidating snapshot files in :snap1/F/...
Delete snapshot :snap1 successful.
[root@c40bbc4xn10 bin]# ./mmlssnapshot fs1
No snapshots in file system fs1

See also

Location

/usr/lpp/mmfs/bin