Software Development Kit (SDK) and API Discussions

CDOT Efficiency over API

Hello,

 

We are manually running commands to enable storage efficiency on volumes.

 

> volume efficiency on -vserver  <vserver> -volume  <volume>

> volume efficiency modify -vserver <vserver>  -volume <volume> -compression true -inline-compression true -data-compaction true

> set adv; volume efficiency start -vserver <vserver> -volume <volume> -dedupe true -compression true -compaction true -scan-old-data true -snapshot-blocks true -shared-blocks true

 

I found API which allow me to enable, set and start efficiency, however I am missing some arguments which I am able to pass over CLI.

 

API "sis-enable" = > volume efficiency on -vserver  <vserver> -volume  <volume>

 

api1 = NaElement("sis-enable")

api1.child_add_string("path","<path>")   # /vol/volume

 

API "sis-set-config" =  > volume efficiency modify -vserver <vserver>  -volume <volume> -compression true -inline-compression true -data-compaction true

 

api2 = NaElement("sis-set-config")

api2.child_add_string("enable-data-compaction","true")

api2.child_add_string("enable-compression","true")

api2.child_add_string("enable-inline-compression","true")

 

API sis-start != set adv; volume efficiency start -vserver <vserver> -volume <volume> -dedupe true -compression true -compaction true -scan-old-data true -snapshot-blocks true -shared-blocks true

 

Here is my problem, I can’t find how I should cover these arguments passed over CLI -dedupe true -compression true -compaction true -scan-old-data true -snapshot-blocks true -shared-blocks true

 

Available options

api3 = NaElement("sis-start")

api3.child_add_string("build-metadata","<build-metadata>")

api3.child_add_string("delete-checkpoint","<delete-checkpoint>")

api3.child_add_string("path","<path>")

api3.child_add_string("qos-policy","<qos-policy>")

api3.child_add_string("queue-operation","<queue-operation>")

api3.child_add_string("restart-checkpoint","<restart-checkpoint>")

api3.child_add_string("run-compaction-scan","<run-compaction-scan>")

api3.child_add_string("scan","<scan>")

api3.child_add_string("scan-all","<scan-all>")
3 REPLIES 3

Re: CDOT Efficiency over API

from API reference

 

scan => boolean, optional
If this is "true", the sis operation will scan the file system to process all the existing data.
The scan will include whatever is enabled on the volume. For example: If compression is not enabled on the volume, the scan will not include compression. This default behavior can be changed by using the run-dedupe-scan and run-compression-scan parameters.
If scan is false only data added since the last sis operation will be processed. Default value: "false"

 

scan-all => boolean, optional
If this argument is "true", scanner will scan entire volume without applying shared block optimization. This argument is valid only if scan argument is set to "true". Look at the documentation for scan parameter for more details. Default value: "false"

 

from volume efficiency start

[-compression | -C [true]] - Start Compression (if scanning old data) (privilege: advanced)
Compresses existing data. Deduplication is not run unless the dedupe option is also specified. Valid only if scan-old-data parameter is true.
[-dedupe | -D [true]] - Start Deduplication (if scanning old data) (privilege: advanced)
Deduplicates existing data on disk. Similarly, compression is not run unless the compression option is also specified. Valid only if scan-old-data parameter is true.
[-compaction | -P [true]] - Start Compaction (if scanning old data) (privilege: advanced)
Compacts existing data on disk. Valid only if scan-old-data parameter is true.
[-shared-blocks | -a [true]] - Compress Shared Blocks (if scanning old data) (privilege: advanced)
Compresses the Compression Groups that have shared blocks created by deduplication or cloning data. Valid only if scan-old-data parameter is true.
[-snapshot-blocks | -b [true]] - Compress Blocks In Snapshots (if scanning old data) (privilege: advanced)
Compresses data blocks locked in a Snapshot copy. Valid only if scan-old-data parameter is true.

[-scan-old-data | -s [true]] - Scan Old Data
This option scans the file system and processes all existing data. It prompts for user confirmation before proceeding. Use the force option to suppress this confirmation.
[-scan-all | -o [true]] - Scan all the data without shared block optimization(if scanning old data)
Scans the entire file system and processes the shared blocks also. You may be able to achieve additional space savings using this option. Where as, by default the option –scan-old-data saves some time by skipping the shared blocks.

 

Re: CDOT Efficiency over API

I found simillar issue already posted on the forum, guy did workaround solution with  "system-cli" API

 

Setup SiS using API

 

But he didn't get an answer.

 

Re: CDOT Efficiency over API

tried to run , version test agains cdot over both API "version" and "system-cli"

system cli is not working for me

 

<results status="passed">
        <build-timestamp>1551341125</build-timestamp>
        <is-clustered>true</is-clustered>
        <version>NetApp Release 9.1P17: Thu Feb 28 08:05:25 UTC 2019</version>
        <version-tuple>
                <system-version-tuple>
                        <generation>9</generation>
                        <major>1</major>
                        <minor>0</minor>
                </system-version-tuple>
        </version-tuple>
</results>

<results status="passed">
        <cli-output></cli-output>
        <cli-result-value>0</cli-result-value>
</results>

[]

used code for sysem-cli call

 

    def invoke_cli(self, *cli_args):
        """
        Call the unsupported/undocumented system-cli API.
        args is a tuple of arguments that, joined with spaces, would represent
        the command line if executing in the CLI.
        """

        args = NaElement('args')
        for arg in cli_args:
            args.child_add(NaElement('arg', arg))

        cli = NaElement('system-cli')
        cli.child_add(args)
        out = self.api.invoke_elem(cli)
        if self.sprintf:
            print (out.sprintf())
        return self._failure_router(out)

called as

    def get_cli_test(self):
        """Return version"""
        out = self.invoke_cli('version')
        output = out.child_get('cli-output').element['content'].splitlines()
        print output

 

 

Forums