Storage volumes endpoint overview
Overview
FlexVol volumes are logical containers used by ONTAP to serve data to clients. They contain file systems in a NAS environment and LUNs in a SAN environment.
A FlexGroup volume is a scale-out NAS container that provides high performance along with automatic load distribution and scalability. A FlexGroup volume contains several constituents that automatically and transparently share the traffic.
FlexClone volumes are writable, point-in-time copies of a FlexVol volume. At this time, FlexClones of FlexGroups are not supported.
Volumes with SnapLock type Compliance or Enterprise, are referred to as SnapLock volumes. Volumes with SnapLock type cannot be of FlexGroup style. Once a SnapLock aggregate is created, by default, volumes created inside the aggregate inherit the "snaplock" property from the aggregate. It is possible to create a SnapLock volume by specifying SnapLock parameters. SnapLock parameters are only available at the "advanced" privilege level.
ONTAP storage APIs allow you to create, modify, and monitor volumes and aggregates.
Storage efficiency
Storage efficiency is used to remove duplicate blocks in the data and to compress the data. Efficiency has deduplication, compression, cross volume deduplication, and compaction options. On All Flash systems, all efficiencies are enabled by default on volume creation. Options such as "background/inline/both" are treated as both, which means both background and inline are enabled for any efficiency option. The option "none" disables both background and inline efficiency.
To enable any efficiency option on all-flash or FAS systems, background deduplication is always enabled.
Quotas
Quotas provide a way to restrict or track the files and space usage by a user, group, or qtree. Quotas are enabled for a specific FlexVol or a FlexGroup volume.
The following APIs can be used to enable or disable and obtain quota state for a FlexVol or a FlexGroup volume:
– PATCH /api/storage/volumes/{uuid} -d '{"quota.enabled":"true"}'
– PATCH /api/storage/volumes/{uuid} -d '{"quota.enabled":"false"}'
– GET /api/storage/volumes/{uuid}/?fields=quota.state
File System Analytics
File system analytics provide a quick method for obtaining information summarizing properties of all files within any directory tree of a volume. For more information on file system analytics, see DOC /storage/volumes{volume.uuid}/files/{path} . Analytics can be enabled or disabled on individual volumes.
The following APIs can be used to enable or disable and obtain analytics state for a FlexVol volume or a FlexGroup volume:
– PATCH /api/storage/volumes/{uuid} -d '{"analytics.state":"on"}'
– PATCH /api/storage/volumes/{uuid} -d '{"analytics.state":"off"}'
– GET /api/storage/volumes/{uuid}/?fields=analytics
QoS
QoS policy and settings enforce Service Level Objectives (SLO) on a volume. SLO can be set by specifying qos.max_throughput_iops and/or qos.max_throughput_mbps or qos.min_throughput_iops. Specifying min_throughput_iops is only supported on volumes hosted on a node that is flash optimized. A pre-created QoS policy can also be used by specifying qos.name or qos.uuid property.
Performance monitoring
Performance of a volume can be monitored by the metric.*
and statistics.*
fields. These show the performance of the volume in terms of IOPS, latency and throughput. The metric.*
fields denote an average whereas statistics.*
fields denote a real-time monotonically increasing value aggregated across all nodes.
Volume APIs
The following APIs are used to perform operations related with FlexVol volumes and FlexGroup volumes:
– POST /api/storage/volumes
– GET /api/storage/volumes
– GET /api/storage/volumes/{uuid}
– PATCH /api/storage/volumes/{uuid}
– DELETE /api/storage/volumes/{uuid}
Examples
Creating a volume
The POST request is used to create a new volume and to specify its properties.
# The API: /api/storage/volumes # The call: curl -X POST "https://<mgmt-ip>/api/storage/volumes" -H "accept: application/hal+json" -d '{"name": "vol1", "aggregates":[{"name":"aggr1"}], "svm":{"name" : "vs1"}}' # The response: { "job": { "uuid": "b89bc5dd-94a3-11e8-a7a3-0050568edf84", "_links": { "self": { "href": "/api/cluster/jobs/b89bc5dd-94a3-11e8-a7a3-0050568edf84" } } } }
Creating a SnapLock volume and specifying its properties using POST
# The API: /api/storage/volumes # The call: curl -X POST "https://<mgmt-ip>/api/storage/volumes" -H "accept: application/hal+json" -d '{"name": "vol1", "aggregates":[{"name": "aggr1"}], "svm":{"name" : "vs1"}, "snaplock":{"retention":{"default": "P20Y"}}}' # The response: { "job": { "uuid": "e45b123b-c228-11e8-aa20-0050568e36bb", "_links": { "self": { "href": "/api/cluster/jobs/e45b123b-c228-11e8-aa20-0050568e36bb" } } } }
Creating a FlexGroup volume and specifying its properties using POST
# The API: /api/storage/volumes # The call: curl -X POST "https://<mgmt-ip>/api/storage/volumes" -H "accept: application/hal+json" -d '{"name" : "vol1", "state" : "online", "type" : "RW", "aggregates" : [{"name" : "aggr1"}, {"name" : "aggr2"}, {"name":"aggr3"}], "constituents_per_aggregate" : "1", "svm" : {"name" : "vs1"}, "size" : "240MB", "encryption" : {"enabled" : "False"}, "efficiency" : {"compression" : "both"}, "autosize" : {"maximum" : "500MB", "minimum" : "240MB"}}' # The response: { "job": { "uuid": "3cfa38bd-3a78-11e9-ae39-0050568ed7dd", "_links": { "self": { "href": "/api/cluster/jobs/3cfa38bd-3a78-11e9-ae39-0050568ed7dd" } } } }
Creating a FlexClone and specifying its properties using POST
# The API: /api/storage/volumes # The call: curl -X POST "https://<mgmt-ip>/api/storage/volumes" -H "accept: application/hal+json" -d '{"name":"vol1_clone", "clone": {"parent_volume": {"name": "vol1"}, "is_flexclone": "true"},"svm":{"name": "vs0"}}' # The response: HTTP/1.1 202 Accepted Date: Tue, 26 Feb 2019 09:06:22 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Location: /api/storage/volumes/?name=vol1_clone Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "c9ee0040-39a5-11e9-9b24-00a098439a83", "_links": { "self": { "href": "/api/cluster/jobs/c9ee0040-39a5-11e9-9b24-00a098439a83" } } } }
Volumes reported in the GET REST API
The following types of volumes are reported:
– RW, DP and LS volumes
– FlexGroup volume
– FlexCache volume
– FlexClone volume
The following volumes are not reported:
– DEL and TMP type volume
– Node Root volume
– System Vserver volume
– FlexGroup constituent
– FlexCache constituent
Examples
Retrieving the list of volumes
# The API: /api/storage/volumes # The call: curl -X GET "https://<mgmt-ip>/api/storage/volumes" -H "accept: application/hal+json" # The response: { "records": [ { "uuid": "2d1167cc-c3f2-495a-a23f-8f50b071b9b8", "name": "vsdata_root", "_links": { "self": { "href": "/api/storage/volumes/2d1167cc-c3f2-495a-a23f-8f50b071b9b8" } } }, { "uuid": "3969be7e-78b4-4b4c-82a4-fa86331f03df", "name": "vsfg_root", "_links": { "self": { "href": "/api/storage/volumes/3969be7e-78b4-4b4c-82a4-fa86331f03df" } } }, { "uuid": "59c03ac5-e708-4ce8-a676-278dc249fda2", "name": "svm_root", "_links": { "self": { "href": "/api/storage/volumes/59c03ac5-e708-4ce8-a676-278dc249fda2" } } }, { "uuid": "6802635b-8036-11e8-aae5-0050569503ac", "name": "fgvol", "_links": { "self": { "href": "/api/storage/volumes/6802635b-8036-11e8-aae5-0050569503ac" } } }, { "uuid": "d0c3359c-5448-4a9b-a077-e3295a7e9057", "name": "datavol", "_links": { "self": { "href": "/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" } } } ], "num_records": 5, "_links": { "self": { "href": "/api/storage/volumes" } } }
Retrieving the attributes of a volume
The GET request is used to retrieve the attributes of a volume.
# The API: /api/storage/volumes/{uuid} # The call: curl -X GET "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -H "accept: application/hal+json" # The response: { "uuid": "d0c3359c-5448-4a9b-a077-e3295a7e9057", "comment": "This is a data volume", "create_time": "2018-07-05T14:56:44+05:30", "language": "en_us", "name": "datavol", "size": 20971520, "state": "online", "style": "flexvol", "tiering_policy": "auto", "type": "rw", "aggregates": [ { "name": "data", "uuid": "aa742322-36bc-4d98-bbc4-0a827534c035", "_links": { "self": { "href": "/api/cluster/aggregates/data" } } } ], "encryption": { "enabled": false, "state": "none", "key_id": "", "type" : "none" }, "error_state": { "has_bad_blocks": false, "is_inconsistent": false }, "files": { "maximum": 566, "used": 96 }, "nas": { "gid": 2468, "security_style": "unix", "uid": 1357, "unix_permissions": 4755, "export_policy": { "name": "default", "id": 8589934593 }, "junction_parent": { "name": "vol1", "uuid": "a2564f80-25fb-41e8-9b49-44de2600991f", "_links": { "self": { "href": "/api/storage/volumes/a2564f80-25fb-41e8-9b49-44de2600991f" } } } }, "metric": { "timestamp": "2019-04-09T05:50:15Z", "status": "ok", "duration": "PT15S", "latency": { "other": 0, "total": 0, "read": 0, "write": 0 }, "iops": { "read": 0, "write": 0, "other": 0, "total": 0 }, "throughput": { "read": 0, "write": 0, "other": 0, "total": 0 }, "cloud": { "timestamp": "2019-04-09T05:50:15Z", "status": "ok", "duration": "PT15S", "iops" : { "read": 0, "write": 0, "other": 0, "total": 0 }, "latency": { "read": 0, "write": 0, "other": 0, "total": 0 } }, "flexcache": { "timestamp": "2019-04-09T05:50:15Z", "status": "ok", "duration": "PT1D", "cache_miss_percent": 0, "bandwidth_savings": 0 } }, "statistics": { "timestamp": "2019-04-09T05:50:42Z", "status": "ok", "latency_raw": { "other": 38298, "total": 38298, "read": 0, "write": 0 }, "iops_raw": { "read": 0, "write": 0, "other": 3, "total": 3 }, "throughput_raw": { "read": 0, "write": 0, "other": 0, "total": 0 }, "cloud": { "timestamp": "2019-04-09T05:50:42Z", "status": "ok", "iops_raw" : { "read": 0, "write": 0, "other": 0, "total": 0 }, "latency_raw": { "read": 0, "write": 0, "other": 0, "total": 0 } }, "flexcache_raw": { "timestamp": "2019-04-09T05:50:15Z", "status": "ok", "cache_miss_blocks": 0, "client_requested_blocks": 0 } }, "qos": { "policy": { "min_throughput_iops": 0, "max_throughput_iops": 1000, "max_throughput_mbps": 0, "uuid": "228454af-5a8b-11e9-bd5b-005056ac6f1f", "name": "pg1" } }, "snaplock": { "append_mode_enabled": false, "autocommit_period": "none", "compliance_clock_time": "2019-05-24T10:59:00+05:30", "expiry_time": "2038-01-19T08:44:28+05:30", "is_audit_log": false, "litigation_count": 0, "privileged_delete": "disabled", "type": "enterprise", "retention": { "default": "P0Y", "minimum": "P0Y", "maximum": "P30Y" } }, "snapshot_policy": { "name": "default" }, "svm": { "name": "vsdata", "uuid": "d61b69f5-7458-11e8-ad3f-0050569503ac" }, "_links": { "self": { "href": "/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" } } }
Retrieving the quota state of a FlexVol or a FlexGroup volume
# The API: /api/storage/volumes/{uuid} # The call: curl -X GET "https://<mgmt-ip>/api/storage/volumes/cb20da45-4f6b-11e9-9a71-005056a7f717/?fields=quota.state" -H "accept: application/hal+json" # The response: { "uuid": "cb20da45-4f6b-11e9-9a71-005056a7f717", "name": "fv", "quota": { "state": "on" }, "_links": { "self": { "href": "/api/storage/volumes/cb20da45-4f6b-11e9-9a71-005056a7f717/" } } }
Retrieving the constituents of a FlexGroup volume
# The API: /api/storage/volumes/{uuid} # The call: curl -X GET "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057/?fields=constituents" -H "accept: application/hal+json" # The response: { "uuid": "d0c3359c-5448-4a9b-a077-e3295a7e9057", "name": "fg", "constituents": [ { "name": "fg__0001", "space": { "size": 536870912, "available": 479756288, "used": 30273536, "local_tier_footprint": 540958720, "footprint": 389120, "over_provisioned": 0, "metadata": 4087808, "total_footprint": 540958720, "logical_space": { "reporting": false, "enforcement": false, "used_by_afs": 30273536 }, "snapshot": { "reserve_percent": 5, "autodelete_enabled": false } }, "aggregates": { "name": "vs_aggr", "uuid": "2e00716c-eb54-45a9-8ca5-be50ccd40708", "_links": { "self": { "href": "/api/storage/aggregates/2e00716c-eb54-45a9-8ca5-be50ccd40708" } } } }, { "name": "fg__0002", "space": { "size": 536870912, "available": 479756288, "used": 30273536, "local_tier_footprint": 540958720, "footprint": 389120, "over_provisioned": 0, "metadata": 4087808, "total_footprint": 540958720, "logical_space": { "reporting": false, "enforcement": false, "used_by_afs": 30273536 }, "snapshot": { "reserve_percent": 5, "autodelete_enabled": false } }, "aggregates": { "name": "aggr1", "uuid": "f655cf4f-8208-4fc8-bfc8-4f238d434402", "_links": { "self": { "href": "/api/storage/aggregates/f655cf4f-8208-4fc8-bfc8-4f238d434402" } } } }, { "name": "fg__0003", "space": { "size": 536870912, "available": 479756288, "used": 30273536, "local_tier_footprint": 540958720, "footprint": 389120, "over_provisioned": 0, "metadata": 4087808, "total_footprint": 540958720, "logical_space": { "reporting": false, "enforcement": false, "used_by_afs": 30273536 }, "snapshot": { "reserve_percent": 5, "autodelete_enabled": false } }, "aggregates": { "name": "aggr2", "uuid": "c7239f14-b861-46fc-b406-70fe13c1a4fb", "_links": { "self": { "href": "/api/storage/aggregates/c7239f14-b861-46fc-b406-70fe13c1a4fb" } } } }, { "name": "fg__0004", "space": { "size": 536870912, "available": 479756288, "used": 30273536, "local_tier_footprint": 540958720, "footprint": 389120, "over_provisioned": 0, "metadata": 4087808, "total_footprint": 540958720, "logical_space": { "reporting": false, "enforcement": false, "used_by_afs": 30273536 }, "snapshot": { "reserve_percent": 5, "autodelete_enabled": false } }, "aggregates": { "name": "aggr3", "uuid": "4c86137a-06af-482d-a41c-d64acc5dcea4", "_links": { "self": { "href": "/api/storage/aggregates/4c86137a-06af-482d-a41c-d64acc5dcea4" } } } } ], "_links": { "self": { "href": "/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" } } }
Updating the attributes of a volume
Examples
Updating the attributes of a volume
The PATCH request is used to update the attributes of a volume.
# The API: /api/storage/volumes/{uuid} # The call: curl -X PATCH "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -d '{ "size": 26214400, "nas": {"security_style": "mixed"}, "comment": "This is a data volume" }' -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted Date: Tue, 31 Jul 2018 09:36:43 GMT Server: libzapid-httpd Cache-Control: no-cache,no-store,must-revalidate Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "3c5be5a6-94a5-11e8-8ca3-00505695c11b", "_links": { "self": { "href": "/api/cluster/jobs/3c5be5a6-94a5-11e8-8ca3-00505695c11b" } } } }
Updating the attributes of a FlexClone using PATCH
# The API: /api/storage/volumes/{uuid} # The call: curl -X PATCH "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -d '{"clone":{"split_initiated":"true"}}' -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted Date: Mon, 25 Feb 2019 10:10:19 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "8e01747f-38e5-11e9-8a3a-00a09843994b", "_links": { "self": { "href": "/api/cluster/jobs/8e01747f-38e5-11e9-8a3a-00a09843994b" } } } }
Enabling quotas for a FlexVol or a FlexGroup volume using PATCH
# The API: /api/storage/volumes/{uuid} # The call: curl -X PATCH "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -d '{"quota":{"enabled":"true"}}' -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted Date: Mon, 25 Feb 2019 10:10:19 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "d2fe7299-57d0-11e9-a2dc-005056a7f717", "_links": { "self": { "href": "/api/cluster/jobs/d2fe7299-57d0-11e9-a2dc-005056a7f717" } } } }
Disabling quotas for a FlexVol or a FlexGroup volume using PATCH
# The API: /api/storage/volumes/{uuid} # The call: curl -X PATCH "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -d '{"quota":{"enabled":"false"}}' -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted Date: Mon, 25 Feb 2019 10:10:19 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "0c8f6bea-57d1-11e9-a2dc-005056a7f717", "_links": { "self": { "href": "/api/cluster/jobs/0c8f6bea-57d1-11e9-a2dc-005056a7f717" } } } }
Add tiering object tags for a FlexVol using PATCH
# The API: /api/storage/volumes/{uuid} # The call: curl -X PATCH "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -d '{"tiering.object_tags": [ "key1=val1", "key2=val2" ]}' -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted Date: Tue, 11 Feb 2020 19:29:25 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "d05012de-4d04-11ea-836b-005056bb6f9d", "_links": { "self": { "href": "/api/cluster/jobs/d05012de-4d04-11ea-836b-005056bb6f9d" } } } }
Remove tiering object tags for a FlexVol using PATCH
# The API: /api/storage/volumes/{uuid} # The call: curl -X PATCH "https://<mgmt-ip>/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057" -d '{"tiering.object_tags": []}' -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted Date: Fri, 24 Jan 2020 22:28:04 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Content-Length: 189 Content-Type: application/hal+json { "job": { "uuid": "ca234df1-3ef8-11ea-9a56-005056bb69a1", "_links": { "self": { "href": "/api/cluster/jobs/ca234df1-3ef8-11ea-9a56-005056bb69a1" } } } }
Deleting a volume
Example
Deleting a volume
The DELETE request is used to delete a volume.
# The API: /api/storage/volumes # The call: curl -X DELETE "https://<mgmt-ip>/api/storage/volumes/{uuid} " -H "accept: application/hal+json" # The response: HTTP/1.1 202 Accepted cache-control: no-cache,no-store,must-revalidate connection: Keep-Alive content-length: 189 content-type: application/json date: Wed, 01 Aug 2018 09:40:36 GMT keep-alive: timeout=5, max=100 server: libzapid-httpd { "job": { "uuid": "f1aa3eb8-956e-11e8-86bf-0050568e2249", "_links": { "self": { "href": "/api/cluster/jobs/f1aa3eb8-956e-11e8-86bf-0050568e2249" } } } }