Export and Import Quotas

You are here:

INTRODUCTION

NSS includes the ability to produce a csv formatted export file of quotas configured on an NSS host. It is also possible to import a csv formatted source file to configure quota policies. These features are particularly useful:

  • When taking a backup copy of quota settings prior to maintenance work
  • As a means to mass-change quota policies (export > edit > import)
  • When restoring quota policies after a server failure

Exporting and importing of quota settings is achieved with the command-line tools QSExport and QSImport. These tools are run from the command line and are located within the QS folder of the NSS installation.

These tools target specific Quota Servers; exporting quotas managed by a specific Quota Server and importing quotas to a specific Quota Server. This ‘server’ parameter is defined when running the tool.

This article describes how these command-line tools QSExport and QSImport are used.

STEP-BY-STEP PROCEDURE

Exporting Quota Settings

1 Ensure that the QSComApi has been registered on the server from which you wish to run the QSExport command line tool.

See Registering the QSComApi DLL for further details.

2 Ensure that the Quota Server service is running on the server from which you will be exporting the quota configuration.
3 If you plan to run the QSExport tool from a machine where the NSS package has not been installed, then you must manually copy the QSExport.exe file from a machine where the package has been installed. By default this file is located in C:\Program Files\northern\Storage Suite\QS\.
4 Open the Command Line Interface (CLI).
5 Navigate to the folder where the QSExport tool is located.
If you are running the tool on a server where the NSS package is installed, then this will be the ‘QS’ folder by default located on the C drive. cd C:\Program Files\NORTHERN\Storage Suite\QS
If you are running the QSExport tool on a server where the NSS package has not been installed, then this will be the folder to where you manually copied the QSExport.exe file. cd path-to-my-copy-of-QSExport
6 Run the following command (where ‘my-filename.csv’ is the name you want to give to the export file). QSExport.exe servername > my-filename.csv

Example:

The example above will export all quota settings from NSS-SRV2-LAB  to the file 20190815_Quotas_export. The default export file format is csv, comma-separated values, and it will be located in the folder where you are running QSExport from. If you want the export file to be placed in a different folder, you can include the target folder path in the file name property given when you run the tool, i.e. using ‘c:\my-folder\20190815_Quotas_export.csv‘ in the example above.

If the export file only shows the text “Class not registered” then the QSComApi.dll has not been registered on the computer from which you are running the QSExport tool, or the wrong version (32bit, 64bit) has been registered.

Viewing and Editing Quota Settings

The resulting export file can be viewed in Microsoft Excel, choosing to convert text to columns when opening the file. The quota settings can also be edited prior to (re)importing. Editing will be necessary in some situations, such as if you plan to move the quota configuration from one Quota Server to another – you must edit the ‘server’ value for each quota in the export file before importing to the new server. This is also a useful method of mass-editing quotas, with find-and-replace in Excel for example.

Please note that it is good practice to make a copy of the export file before editing.

Importing Quota Settings

1 Ensure that the QSComApi has been registered on the server from which you wish to run the QSExport command line tool.

See Registering the QSComApi DLL for further details.

2 Ensure that the Quota Server service is running on the server that you will be importing the quota configuration to.
3 If you plan to run the QSImport tool from a machine where the NSS package has not been installed, then you must manually copy the QSImport.exe file from a machine where the package has been installed. By default this file is located in C:\Program Files\northern\Storage Suite\QS\.
4 Open the Command Line Interface (CLI)
5 Navigate to the folder where the QSImport tool is located.
If you are running the tool on a server where the NSS package is installed, then this will be the ‘QS’ folder by default located on the C drive. cd C:\Program Files\NORTHERN\Storage Suite\QS
If you are running the QSImport tool on a server where the NSS package has not been installed, then this will be the folder to where you manually copied the QSImport.exe file. cd path-to-my-copy-of-QSImport
6 Run the following command QSImport.exe servername < my-filename.csv

Example:

The example above will import the quota configurations defined in 20190815_Quotas_export.csv into NSS-SRV2-LAB. In the example above, the import file is located in the same folder that the QSImport tool is being run from. If the import file is located elsewhere, the full file path should be provided in the file name variable, i.e. using ‘c:\my-folder\20190815_Quotas_export.csv‘ in the example above.

Note that the Quota Server service does not need to be restarted after an import.

VERIFY RESULTS

Success of the export is confirmed by matching the content of the export file to the configuration shown in the Quota Server interface; the quotas associated with the server from which the quota configuration was exported should match the content of the csv file.

A successful import can be confirmed by viewing the new settings in the Quota Server interface.

If the export/import was not successful, please make sure that:

  • There were no spelling errors in the server name value given when running QSExport/QSImport.
  • That the Quota Server service is running on the server(s) which you are exporting from and/or importing to.
  • That the  QSComApi.dll has been registered on the machine from which QSExport/QSImport is being run – including the correct version (32bit/64bit) of the dll.

If the following error code is returned: 0xF804FFFE then either the service is not running on the target Quota Server server, or the server name is incorrectly spelled. If export files only display “Class not registered” then the QSComApi.dll has not been registered, or the wrong version (32bit/64bit) has been registered.

 

Last updated: August 23, 2019
×