Module netapp_ontap.resources.volume
Copyright © 2019 NetApp Inc. All rights reserved.
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.
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 will be enabled by default on volume creation. Options such as "background/inline/both" will be treated as both, which means both background and inline will be enabled for any efficiency option. The option "none" will disable 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/{volume-uuid} -d '{"quota.enabled":"true"}'
– PATCH
/api/storage/volumes/{volume-uuid} -d '{"quota.enabled":"false"}'
– GET
/api/storage/volumes/{volume-uuid}/?fields=quota.state
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 an a node which 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 FlexVols 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 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", "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"
}
}
}
}
# 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"}},"svm":{"name": "vs0"}, {"clone": "is_flexclone":"true"}}'
# 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 volume
–
FlexGroup volume
–
FlexCache volume
–
FlexClone volume
The following types of volumes are not reported:
– DEL volume – TEMP volume – Node Root volume – System Vserver volume – FlexGroup constituent – FlexCache constituent
Examples
Retrieving the attributes of a volume
# 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 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
}
},
"metric": {
"timestamp": "2019-04-09T05:50:15Z",
"duration": "PT15S",
"status": "ok",
"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
}
},
"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
}
},
"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": "2018-08-20T13:17:43+05:30",
"expiry_time": "2018-10-30T05:30:00+05:30",
"is_audit_log": false,
"litigation_count": 0,
"privileged_delete": "permanently_disabled",
"type": "compliance",
"retention": {
"default": "30 years",
"minimum": "0 years",
"maximum": "30 years"
}
},
"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/"
}
}
}
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"
}
}
}
}
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/{volume.id} " -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"
}
}
}
}
Classes
class Volume (*args, **kwargs)
-
Allows interaction with Volume objects on the host
Initialize the instance of the resource.
Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:
MyResource(name='foo').name == 'foo'
Args
*args
- Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
**kwargs
- each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.
Ancestors
Static methods
def delete_collection(*args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Deletes a volume. If the UUID belongs to a volume, all of its blocks are freed and returned to its containing aggregate. If a volume is online, it is offlined before deletion.
Related ONTAP commands
volume delete
volume clone delete
Learn more
Delete all objects in a collection which match the given query.
All records on the host which match the query will be deleted.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to delete the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves volumes.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *application.*
*encryption.*
*clone.*
*efficiency.*
*error_state.*
*files.*
*nas.export_policy.id
*nas.gid
*nas.path
*nas.security_style
*nas.uid
*nas.unix_permissions
*snaplock.*
*restore_to.*
*snapshot_policy.uuid
*quota.*
*qos.*
*flexcache_endpoint_type
*space.block_storage_inactive_user_data
*space.capacity_tier_footprint
*space.footprint
*space.over_provisioned
*space.metadata
*space.logical_space.*
*space.snapshot.*
*guarantee.*
*autosize.*
*movement.*
*statistics.*
Related ONTAP commands
volume show
volume clone show
volume efficiency show
volume encryption show
volume flexcache show
volume flexgroup show
volume move show
volume quota show
volume show-space
volume snaplock show
Learn more
Find an instance of an object on the host given a query.
The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found or if more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
Resource
object containing the details of the object.Raises
NetAppRestError
: If the API call did not return exactly 1 matching resource. def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> typing.Iterable
-
Retrieves volumes.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *application.*
*encryption.*
*clone.*
*efficiency.*
*error_state.*
*files.*
*nas.export_policy.id
*nas.gid
*nas.path
*nas.security_style
*nas.uid
*nas.unix_permissions
*snaplock.*
*restore_to.*
*snapshot_policy.uuid
*quota.*
*qos.*
*flexcache_endpoint_type
*space.block_storage_inactive_user_data
*space.capacity_tier_footprint
*space.footprint
*space.over_provisioned
*space.metadata
*space.logical_space.*
*space.snapshot.*
*guarantee.*
*autosize.*
*movement.*
*statistics.*
Related ONTAP commands
volume show
volume clone show
volume efficiency show
volume encryption show
volume flexcache show
volume flexgroup show
volume move show
volume quota show
volume show-space
volume snaplock show
Learn more
Fetch a list of all objects of this type from the host.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. max_records
- The maximum number of records to return per call
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A list of
Resource
objectsRaises
NetAppRestError
: If there is no connection available to use either passed in or on the library. def patch_collection(body: dict, *args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Updates the attributes of a volume. For movement, use the "validate_only" field on the request to validate but not perform the operation. The PATCH API can be used to enable or disable quotas for a FlexVol or a FlexGroup volume.
Related ONTAP commands
volume modify
volume clone modify
volume efficiency modify
volume quota on
volume quota off
Learn more
Patch all objects in a collection which match the given query.
All records on the host which match the query will be patched with the provided body.
Args
body
- A dictionary of name/value pairs to set on all matching members of the collection.
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to patch the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400
Methods
def delete(self, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Deletes a volume. If the UUID belongs to a volume, all of its blocks are freed and returned to its containing aggregate. If a volume is online, it is offlined before deletion.
Related ONTAP commands
volume delete
volume clone delete
Learn more
Send a deletion request to the host for this object.
Args
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def get(self, **kwargs) -> NetAppResponse
-
Retrieves a volume. The GET API can be used to retrieve the quota state for a FlexVol or a FlexGroup volume.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *application.*
*encryption.*
*clone.*
*efficiency.*
*error_state.*
*files.*
*nas.export_policy.id
*nas.gid
*nas.path
*nas.security_style
*nas.uid
*nas.unix_permissions
*snaplock.*
*restore_to.*
*snapshot_policy.uuid
*quota.*
*qos.*
*flexcache_endpoint_type
*space.block_storage_inactive_user_data
*space.capacity_tier_footprint
*space.footprint
*space.over_provisioned
*space.metadata
*space.logical_space.*
*space.snapshot.*
*guarantee.*
*autosize.*
*movement.*
*statistics.*
Related ONTAP commands
volume show
volume clone show
volume efficiency show
volume encryption show
volume flexcache show
volume flexgroup show
volume move show
volume quota show
volume show-space
volume snaplock show
Learn more
Fetch the details of the object from the host.
Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Updates the attributes of a volume. For movement, use the "validate_only" field on the request to validate but not perform the operation. The PATCH API can be used to enable or disable quotas for a FlexVol or a FlexGroup volume.
Related ONTAP commands
volume modify
volume clone modify
volume efficiency modify
volume quota on
volume quota off
Learn more
Send the difference in the object's state to the host as a modification request.
Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.
Args
hydrate
- If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Creates a volume on a specified SVM and storage aggregates.
Required properties
svm.uuid
orsvm.name
- Existing SVM in which to create the volume.name
- Name of the volume.aggregates.name
oraggregates.uuid
- Existing aggregates in which to create the volume.
Default property values
state
- onlinesize
- 20MBstyle
- flexvoltype
- rwencryption.enabled
- falsesnapshot_policy.name
- defaultgaurantee.type
- volume
Related ONTAP commands
volume create
volume clone create
Learn more
Send this object to the host as a creation request.
Args
hydrate
- If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400
Inherited members
class VolumeSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the Volume object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var aggregates
-
Aggregate hosting the volume. Required on POST.
var application
-
The application field of the volume.
var autosize
-
The autosize field of the volume.
var clone
-
The clone field of the volume.
var comment
-
A comment for the volume. Valid in POST or PATCH.
var constituents_per_aggregate
-
Specifies the number of times to iterate over the aggregates listed with the "aggregates.name" or "aggregates.uuid" when creating or expanding a FlexGroup. If a volume is being created on a single aggregate, the system will create a flexible volume if the "constituents_per_aggregate" field is not specified, and a FlexGroup if it is specified. If a volume is being created on multiple aggregates, the system will always create a FlexGroup.
var create_time
-
Creation time of the volume. This field is generated when the volume is created.
Example: 2018-06-04T19:00:00.000+0000
var efficiency
-
The efficiency field of the volume.
var encryption
-
The encryption field of the volume.
var error_state
-
The error_state field of the volume.
var files
-
The files field of the volume.
var flexcache_endpoint_type
-
FlexCache endpoint type.
none ‐ The volume is neither a FlexCache nor origin of any FlexCache.
cache ‐ The volume is a FlexCache volume.
origin ‐ The volume is origin of a FlexCache volume.Valid choices:
- none
- cache
- origin
var guarantee
-
The guarantee field of the volume.
var language
-
Language encoding setting for volume. If no language is specified, the volume inherits its SVM language encoding setting.
Valid choices:
- ar
- ar.utf_8
- c
- c.utf_8
- cs
- cs.utf_8
- da
- da.utf_8
- de
- de.utf_8
- en
- en.utf_8
- en_us
- en_us.utf_8
- es
- es.utf_8
- fi
- fi.utf_8
- fr
- fr.utf_8
- he
- he.utf_8
- hr
- hr.utf_8
- hu
- hu.utf_8
- it
- it.utf_8
- ja
- ja.utf_8
- ja_jp.932
- ja_jp.932.utf_8
- ja_jp.pck
- ja_jp.pck.utf_8
- ja_jp.pck_v2
- ja_jp.pck_v2.utf_8
- ja_v1
- ja_v1.utf_8
- ko
- ko.utf_8
- nl
- nl.utf_8
- no.utf_8
- pl
- pl.utf_8
- pt
- pt.utf_8
- ro
- ro.utf_8
- ru
- ru.utf_8
- sk
- sk.utf_8
- sl
- sl.utf_8
- sv
- sv.utf_8
- tr
- tr.utf_8
- utf8mb4
- zh
- zh.gbk
- zh.gbk.utf_8
- zh.utf_8
- zh_tw
- zh_tw.big5
- zh_tw.big5.utf_8
- zh_tw.utf_8
var links
-
The links field of the volume.
var metric
-
The metric field of the volume.
var movement
-
The movement field of the volume.
var name
-
Volume name. The name of volume must start with an alphabetic character (a to z or A to Z) or an underscore (_). The name must be 197 or fewer characters in length for FlexGroups, and 203 or fewer characters in length for all other types of volumes. Volume names must be unique within an SVM. Required on POST.
Example: vol_cs_dept
var nas
-
The nas field of the volume.
var opts
var qos
-
The qos field of the volume.
var quota
-
The quota field of the volume.
var size
-
Physical size of the volume. The minimum size for a FlexVol volume is 20MB and the minimum size for a FlexGroup volume is 200MB per constituent. The recommended size for a FlexGroup volume is a minimum of 100GB per constituent. For all volumes, the default size is equal to the minimum size.
var snaplock
-
The snaplock field of the volume.
var snapshot_policy
-
The snapshot_policy field of the volume.
var space
-
The space field of the volume.
var state
-
Volume state. A volume can only be brought online if it is offline. The 'mixed' state applies to FlexGroup volumes only and cannot be specified as a target state. An 'error' state implies that the volume is not in a state to serve data.
Valid choices:
- error
- mixed
- offline
- online
var statistics
-
The statistics field of the volume.
var style
-
The style of the volume. If "style" is not specified, the volume type is determined based on the specified aggregates. Specifying a single aggregate, without "constituents_per_aggregate" creates a flexible volume. Specifying multiple aggregates, or a single aggregate with "constituents_per_aggregate" creates a FlexGroup. If "style" is specified, a volume of that type is created. That is, if style is "flexvol", a single aggregate must be specified. If style is "flexgroup", the system either uses the specified aggregates, or automatically provisions if no aggregates are specified.
flexvol ‐ flexible volumes and FlexClone volumes
flexgroup ‐ FlexGroups.Valid choices:
- flexvol
- flexgroup
var svm
-
The svm field of the volume.
var tiering
-
The tiering field of the volume.
var type
-
Type of the volume.
rw ‐ read-write volume.
dp ‐ data-protection volume.
ls ‐ load-sharingdp
volume. Valid in GET.Valid choices:
- rw
- dp
- ls
var use_mirrored_aggregates
-
Specifies whether mirrored aggregates are selected when provisioning a FlexGroup without specifying "aggregates.name" or "aggregates.uuid". Only mirrored aggregates are used if this parameter is set to 'true' and only unmirrored aggregates are used if this parameter is set to 'false'. Aggregate level mirroring for a FlexGroup can be changed by moving all of the constituents to the required aggregates. The default value is 'true' for a MetroCluster configuration and is 'false' for a non-MetroCluster configuration.
var uuid
-
Unique identifier for the volume. This corresponds to the instance-uuid that is exposed in the CLI and ONTAPI. It does not change due to a volume move.
Example: 028baa66-41bd-11e9-81d5-00a0986138f7