SGOFFLOAD

Section: Maintenance Commands (8)
Updated: April 2019

NAME

sgoffload – Stripe Group Offload Utility

SYNOPSIS

sgoffload –fsname|-f FsName –sgname|-g SgName | ‘#SgIndex’ [–target TargetSgName | ‘#TargetSgIndex’] [–percent|-p percentage] [–ignore_affinity] [–vacate] [–yes|-y] [–verbose] [–debug|-D] [–progress ProgressFilePath] [–no_admin_lock] [–timeout seconds] [–help]
sgmanage –offload

DESCRIPTION

sgoffload can be used to move existing data offof any data stripe group to another stripe group. The selected stripe group can be then marked vacated and reads/writes continue on from a different stripe group in a StorNext File System. Vacating is removing the configured disks from the stripe group. If a target stripe group, –target TargetSgName | ‘#SgIndex’, is selected, the file system will try allocation from only that stripe group independent of affinity. If the –ignore_affinity option is set, the original affinity is ignored in determining the new allocation. If the file system only has one data stripe group the command fails with ENOSPC.

The use of sgoffload requires that the file system be active on the primary node of an HA pair, if HA is configured. If it is active on the secondary, cvadmin subcommand fail can be used to switch it to the primary.

The use of sgoffload also requires that the global configuration variable metadataArchive be set to true. If this change needs to be made, the file system must be stopped and restarted for the change to take effect. Wait for the metadata archive database rebuild to complete by monitoring the status with the cvadmin subcommand mdarchive status.

Sgoffload will attempt to defragment files as it offloads the stripe group by combining contiguous file extents from the source stripe group into a single allocation request on the destination stripe group. Note that this is not the same behavior as snfsdefrag(1) which will consolidate all contiguous extents, regardless of the original stripe group.

Sgoffload makes use of the adminstrative lock feature of StorNext which allows it to move files that are currently open from a client node. While a file is being operated on, I/O operations on that file are suspended. This behavior can be overridden with the –no_admin_lock option. Some clients may not support the I/O token operation if the software version is older. In this case, the file is seen to be busy by sgoffload and the file is skipped. To completely offload a stripe group, sgoffload may have to be invoked repeatedly to move the once busy files.

Multiple sgoffload commands may be invoked simultaneously as long as the source stripe group is not the same.

The sgoffload command may also be invoked as:

sgmanage –offload

OPTIONS

Options that start with — and take an argument can have the argument separated by either a space or an equal sign, e.g.

–fsname FsName
–fsname=FsName

are equivalent.

–fsname|-f FsName
Selects a given file system. If the file system is not running in the default cluster or administrative domain, those may added to file system name using the syntax:

FsName[@cluster[/addom]]
–sgname|-g SgName | ‘#SgIndex’
Selects a stripe group by name or index. The hash sign, which is part of the index syntax, must be escaped to avoid special processing by the shell.
–target TargetSgName ‘#TargetSgIndex’
Selects a target stripe group to move data to. The hash sign, which is part of the index syntax, must be escaped to avoid special processing by the shell.
–percent|-p percentage
Set percentage of blocks to move from 1 to 99 percent. The –vacate and –percent options are mutually exclusive. If the –percent option is not selected, all blocks are moved. The percentage of blocks might vary as blocks can be removed while the offload is in progress.
–ignore_affinity
Ignore affinities and allow data to be allocated anywhere. The –target and –ignore_affinity options are mutually exclusive.
–vacate
Vacate the stripe group once data is moved. The default is not to vacate. If the stripe group is a shared metadata/user data stripe group, the stripe group is made EXCLUSIVE for metadata allocations only. If the stripe group is a shared journal/user data stripe group, the stripe group is made EXCLUSIVE for journal only. If the stripe group is user data, the disk luns are removed from the configuration and the stripe group is marked VACANT. A stripe group that is marked as DOWN may also be vacated using this option. A vacant stripe group can be re-used using the sgadd functionality. File system clients running a version of StorNext prior to 5.4.0 should un-mount prior to the vacate and re-mount after. At the beginning of the vacate operation, sgoffload disables allocations to the stripe group, if they were not already disabled. At the end of the offload, if the operation could not complete due to busy files, allocations to the stripe group remain suspended. The –vacate option is the same as running the following commands:

sgmanage -f <fs> -g <sg> --suspend
sgoffload -f <fs> -g <sg>
sgmanage -f <fs> -g <sg> --delete

–yes|-y
Run the command without prompting for confirmation before making the change.
–verbose
Show additional output.
–debug|-D
Prints out debug information of each allocated extent being moved.
–progress ProgressFilePath
Create and periodically update this file with information about how far along we are and how much time remains. This file is in JSON format. Progress information is also written to standard output in normal (not JSON) format.
–no_admin_lock
Do not attempt to temporarily stop I/O related operations on an open file by setting the administrative lock on a file. The default behavior is to attempt to set the administrative lock on each file that is being offloaded. If sgoffload successfully sets the administrative lock, I/O related operations will be suspended for any application that has the file open during the time sgoffload is operating on that file. If a file is open and the administrative lock cannot be obtained, that file will be skipped and the offload may not completely empty the stripe group.
–timeout seconds
Set the amount of time to wait for the FSM to respond to a query. This value can also be specified in snfs_rest_config.json for all instances of this command using the process name entry sgmanage in snfs_rest_config.json. This file is installed by default and has a value of 60 seconds.
–help
Print a usage statement.

EXAMPLES

Offload data from stripe group sg1

rock# sgoffload -f snfs1 -g sg1


Offload data from stripe group 1 to target stripe group sg3

rock# sgoffload -f snfs1 -g sg1 --target sg3


NOTE: The sgoffload command is not available on Debian and Ubuntu clients.

SEE ALSO

cvadmin(8), snfs_config(5), sgadd(8), sgdefrag(8), sgmanage(8), sgresize(8), snfsdefrag(1), snfs_rest_config.json(4)