Create a LUN
POST /storage/luns
Introduced In: 9.6
Creates a LUN.
Required properties
-
svm.uuid
orsvm.name
- Existing SVM in which to create the LUN. -
name
,location.volume.name
orlocation.volume.uuid
- Existing volume in which to create the LUN. -
name
orlocation.logical_unit
- Base name of the LUN. -
os_type
- Operating system from which the LUN will be accessed. Required when creating a non-clone LUN and disallowed when creating a clone of an existing LUN. A clone'sos_type
is taken from the source LUN. -
space.size
- Size of the LUN. Required when creating a non-clone LUN and disallowed when creating a clone of an existing LUN. A clone's size is taken from the source LUN.
Recommended optional properties
-
qos_policy.name
orqos_policy.uuid
- Existing traditional or adaptive QoS policy to be applied to the LUN. All LUNs should be managed by a QoS policy at the volume or LUN level.
Default property values
If not specified in POST, the follow default property values are assigned.
-
auto_delete
- false
Related ONTAP commands
-
lun create
-
lun convert-from-namespace
-
lun copy start
-
volume file clone autodelete
-
volume file clone create
Learn more
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
return_records |
boolean |
query |
False |
The default is false. If set to true, the records are returned.
|
Request Body
Name | Type | Description |
---|---|---|
_links |
||
attributes |
array[attributes] |
An array of name/value pairs optionally stored with the LUN. Attributes are available to callers to persist small amounts of application-specific metadata. They are in no way interpreted by ONTAP. Attribute names and values must be at least one byte and no more than 4091 bytes in length. The sum of the name and value lengths must be no more than 4092 bytes. Valid in POST except when creating a LUN clone. A cloned can already have attributes from its source. You can add, modify, and delete the attributes of a LUN clone in separate requests after creation of the LUN. Attributes may be added/modified/removed for an existing LUN using the /api/storage/luns/{lun.uuid}/attributes endpoint. For further information, see DOC /storage/luns/{lun.uuid}/attributes . There is an added computational cost to retrieving property values for
|
auto_delete |
boolean |
This property marks the LUN for auto deletion when the volume containing the LUN runs out of space. This is most commonly set on LUN clones. When set to true, the LUN becomes eligible for automatic deletion when the volume runs out of space. Auto deletion only occurs when the volume containing the LUN is also configured for auto deletion and free space in the volume decreases below a particular threshold. This property is optional in POST and PATCH. The default value for a new LUN is false. There is an added computational cost to retrieving this property's value. It is not populated for either a collection GET or an instance GET unless it is explicitly requested using the |
class |
string |
The class of LUN. Optional in POST. |
clone |
This sub-object is used in POST to create a new LUN as a clone of an existing LUN, or PATCH to overwrite an existing LUN as a clone of another. Setting a property in this sub-object indicates that a LUN clone is desired. Consider the following other properties when cloning a LUN: When used in a PATCH, the patched LUN's data is over-written as a clone of the source and the following properties are preserved from the patched LUN unless otherwise specified as part of the PATCH: Persistent reservations for the patched LUN are also preserved. |
|
comment |
string |
A configurable comment available for use by the administrator. Valid in POST and PATCH. |
consistency_group |
The LUN's consistency group. This property is populated for LUNs that are members of a consistency group. If the LUN is a member of a child consistency group, the parent consistency group is reported. Platform Specifics
|
|
convert |
This sub-object is used in POST to convert a valid in-place NVMe namespace to a LUN. Setting a property in this sub-object indicates that a conversion from the specified NVMe namespace to LUN is desired. |
|
copy |
This sub-object applies to LUN copy operations. A LUN can be copied with a POST request that supplies Copying a LUN is an asynchronous activity begun by a POST request that specifies the source of the copy in the While LUNs are being copied, the status of the LUN copy operations can be obtained using a GET of the source or destination LUN that requests the There is an added computational cost to retrieving property values for |
|
create_time |
string |
The time the LUN was created. |
enabled |
boolean |
The enabled state of the LUN. LUNs can be disabled to prevent access to the LUN. Certain error conditions also cause the LUN to become disabled. If the LUN is disabled, you can consult the |
encryption |
Encryption related properties for the LUN. Platform Specifics
|
|
location |
The location of the LUN within the ONTAP cluster. Valid in POST and PATCH.
|
|
lun_maps |
array[lun_maps] |
The LUN maps with which the LUN is associated. There is an added computational cost to retrieving property values for |
metric |
Performance numbers, such as IOPS latency and throughput. |
|
movement |
This sub-object applies to LUN movement between volumes. A LUN can be moved to a new volume with a PATCH request that changes either the volume portion of property Moving a LUN between volumes is an asynchronous activity begun by a PATCH request. The data for the LUN is then asynchronously copied from the source volume to the destination volume. The time required to complete the move depends on the size of the LUN and the load on the cluster. The While the LUN is being moved, the status of the LUN movement operation can be obtained using a GET for the LUN that requests the There is an added computational cost to retrieving property values for |
|
name |
string |
The fully qualified path name of the LUN composed of a "/vol" prefix, the volume name, the (optional) qtree name, and base name of the LUN. Valid in POST and PATCH. A PATCH that modifies the qtree and/or base name portion of the LUN path is considered a rename operation. A PATCH that modifies the volume portion of the LUN path begins an asynchronous LUN movement operation. |
os_type |
string |
The operating system type of the LUN. Required in POST when creating a LUN that is not a clone of another. Disallowed in POST when creating a LUN clone. |
qos_policy |
The QoS policy for the LUN. Both traditional and adaptive QoS policies are supported. If both property |
|
serial_number |
string |
The LUN serial number. The serial number is generated by ONTAP when the LUN is created.
|
space |
The storage space related properties of the LUN. |
|
statistics |
These are raw performance numbers, such as IOPS latency and throughput. These numbers are aggregated across all nodes in the cluster and increase with the uptime of the cluster. |
|
status |
Status information about the LUN. |
|
svm |
The SVM in which the LUN is located. |
|
uuid |
string |
The unique identifier of the LUN. The UUID is generated by ONTAP when the LUN is created.
|
vvol |
A VMware virtual volume (vVol) binding is an association between a LUN of class See link:post-protocols-san-vvol-bindings(#-san-vvol-binding-create)tolearnmoreaboutcreatingvvolbindingsanddelete-protocols-san-vvol-bindings.htmlPOST /protocols/san/vvol-bindings to learn more about creating vVol bindings and [DELETE /protocols/san/vvol-bindings] to learn more about deleting vVol bindings. There is an added computational cost to retrieving property values for |
Example request
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"attributes": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "name1",
"value": "value1"
}
],
"class": "string",
"clone": {
"source": {
"name": "/vol/volume1/lun1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
},
"comment": "string",
"consistency_group": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "cg1",
"uuid": "4abc2317-4332-9d37-93a0-20bd29c22df0"
},
"convert": {
"namespace": {
"name": "/vol/volume1/namespace1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
},
"copy": {
"destinations": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"max_throughput": 0,
"name": "/vol/vol1/lun1",
"peer": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "peer1",
"uuid": "4204cf77-4c82-9bdb-5644-b5a841c097a9"
},
"progress": {
"elapsed": 0,
"failure": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"percent_complete": 0,
"state": "string"
},
"uuid": "1bc327d5-4654-5284-a116-f182282240b4"
}
],
"source": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "/vol/vol2/lun1",
"peer": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "peer1",
"uuid": "4204cf77-4c82-9bdb-5644-b5a841c097a9"
},
"progress": {
"elapsed": 0,
"failure": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"percent_complete": 0,
"state": "string"
},
"uuid": "03c05019-40d9-3945-c767-dca4c3be5e90"
}
},
"create_time": "2018-06-04 15:00:00 -0400",
"encryption": {
"action": "string",
"key_create_time": "2022-01-01 14:00:00 -0500",
"key_id": "string",
"key_manager_attribute": "CRN=v1:bluemix:public:containers-kubernetes:us-south:a/asdfghjkl1234:asdfghjkl1234:worker:kubernetes-asdfghjkl-worker1",
"state": "string",
"status": {
"code": "string",
"message": "string"
}
},
"location": {
"logical_unit": "lun1",
"node": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "node1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"qtree": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"id": 1,
"name": "qt1"
},
"volume": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "volume1",
"uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
}
},
"lun_maps": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"igroup": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "igroup1",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
},
"logical_unit_number": 0
}
],
"metric": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"duration": "PT15S",
"iops": {
"read": 200,
"total": 1000,
"write": 100
},
"latency": {
"read": 200,
"total": 1000,
"write": 100
},
"status": "ok",
"throughput": {
"read": 200,
"total": 1000,
"write": 100
},
"timestamp": "2017-01-25 06:20:13 -0500"
},
"movement": {
"paths": {
"destination": "/vol/vol1/lun1",
"source": "/vol/vol2/lun2"
},
"progress": {
"elapsed": 0,
"failure": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"percent_complete": 0,
"state": "string"
}
},
"name": "/vol/volume1/qtree1/lun1",
"os_type": "string",
"qos_policy": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "qos1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"serial_number": "string",
"space": {
"size": 1073741824,
"used": 0
},
"statistics": {
"iops_raw": {
"read": 200,
"total": 1000,
"write": 100
},
"latency_raw": {
"read": 200,
"total": 1000,
"write": 100
},
"status": "ok",
"throughput_raw": {
"read": 200,
"total": 1000,
"write": 100
},
"timestamp": "2017-01-25 06:20:13 -0500"
},
"status": {
"container_state": "string",
"state": "online"
},
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412",
"vvol": {
"bindings": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"id": 1,
"partner": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "/vol/vol1/lun1",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
},
"secondary_id": "0000D20000010000h"
}
]
}
}
Response
Status: 201, Created
Name | Type | Description |
---|---|---|
_links |
||
num_records |
integer |
The number of records in the response. |
records |
array[lun] |
Example response
{
"_links": {
"next": {
"href": "/api/resourcelink"
},
"self": {
"href": "/api/resourcelink"
}
},
"num_records": 1,
"records": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"attributes": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "name1",
"value": "value1"
}
],
"class": "string",
"clone": {
"source": {
"name": "/vol/volume1/lun1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
},
"comment": "string",
"consistency_group": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "cg1",
"uuid": "4abc2317-4332-9d37-93a0-20bd29c22df0"
},
"convert": {
"namespace": {
"name": "/vol/volume1/namespace1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
},
"copy": {
"destinations": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"max_throughput": 0,
"name": "/vol/vol1/lun1",
"peer": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "peer1",
"uuid": "4204cf77-4c82-9bdb-5644-b5a841c097a9"
},
"progress": {
"elapsed": 0,
"failure": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"percent_complete": 0,
"state": "string"
},
"uuid": "1bc327d5-4654-5284-a116-f182282240b4"
}
],
"source": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "/vol/vol2/lun1",
"peer": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "peer1",
"uuid": "4204cf77-4c82-9bdb-5644-b5a841c097a9"
},
"progress": {
"elapsed": 0,
"failure": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"percent_complete": 0,
"state": "string"
},
"uuid": "03c05019-40d9-3945-c767-dca4c3be5e90"
}
},
"create_time": "2018-06-04 15:00:00 -0400",
"encryption": {
"action": "string",
"key_create_time": "2022-01-01 14:00:00 -0500",
"key_id": "string",
"key_manager_attribute": "CRN=v1:bluemix:public:containers-kubernetes:us-south:a/asdfghjkl1234:asdfghjkl1234:worker:kubernetes-asdfghjkl-worker1",
"state": "string",
"status": {
"code": "string",
"message": "string"
}
},
"location": {
"logical_unit": "lun1",
"node": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "node1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"qtree": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"id": 1,
"name": "qt1"
},
"volume": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "volume1",
"uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
}
},
"lun_maps": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"igroup": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "igroup1",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
},
"logical_unit_number": 0
}
],
"metric": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"duration": "PT15S",
"iops": {
"read": 200,
"total": 1000,
"write": 100
},
"latency": {
"read": 200,
"total": 1000,
"write": 100
},
"status": "ok",
"throughput": {
"read": 200,
"total": 1000,
"write": 100
},
"timestamp": "2017-01-25 06:20:13 -0500"
},
"movement": {
"paths": {
"destination": "/vol/vol1/lun1",
"source": "/vol/vol2/lun2"
},
"progress": {
"elapsed": 0,
"failure": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"percent_complete": 0,
"state": "string"
}
},
"name": "/vol/volume1/qtree1/lun1",
"os_type": "string",
"qos_policy": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "qos1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"serial_number": "string",
"space": {
"size": 1073741824,
"used": 0
},
"statistics": {
"iops_raw": {
"read": 200,
"total": 1000,
"write": 100
},
"latency_raw": {
"read": 200,
"total": 1000,
"write": 100
},
"status": "ok",
"throughput_raw": {
"read": 200,
"total": 1000,
"write": 100
},
"timestamp": "2017-01-25 06:20:13 -0500"
},
"status": {
"container_state": "string",
"state": "online"
},
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412",
"vvol": {
"bindings": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"id": 1,
"partner": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "/vol/vol1/lun1",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
},
"secondary_id": "0000D20000010000h"
}
]
}
}
]
}
Headers
Name | Description | Type |
---|---|---|
Location |
Useful for tracking the resource location |
string |
Error
Status: Default
ONTAP Error Response Codes
Error Code | Description |
---|---|
917927 |
The specified volume was not found. |
918236 |
The specified |
1260121 |
Cloning a LUN to a volume different than the source volume is not supported. |
1260136 |
The specified destination for a clone operation already exists as a LUN, namespace, or file. |
2621462 |
The specified SVM does not exist. |
2621706 |
The specified |
2621707 |
No SVM was specified. Either |
5242927 |
The specified qtree was not found. |
5242950 |
The specified |
5374121 |
A LUN name can only contain characters A-Z, a-z, 0-9, "-", ".", "_", "{" and "}". |
5374123 |
A negative size was provided for the LUN. |
5374124 |
The specified size is too small for the LUN. |
5374125 |
The specified size is too large for the LUN. |
5374127 |
An invalid LUN name was specified. |
5374129 |
LUNs cannot be created on a load sharing mirror volume. |
5374130 |
An invalid size value was provided. |
5374237 |
LUNs cannot be created on an SVM root volume. |
5374238 |
LUNs cannot be created in Snapshot copies. |
5374241 |
A size value with invalid units was provided. |
5374242 |
A LUN or NVMe namespace already exists at the specified path. |
5374352 |
An invalid name was provided for the LUN. |
5374707 |
Creating a LUN in the specific volume is not allowed because the volume is reserved for an application. |
5374858 |
The volume specified by |
5374859 |
No volume was specified for the LUN. |
5374860 |
The qtree specified by |
5374861 |
The LUN base name specified by |
5374862 |
No LUN path base name was provided for the LUN. |
5374863 |
An error occurred after successfully creating the LUN. Some properties were not set. |
5374874 |
The specified |
5374875 |
The specified |
5374876 |
The specified |
5374883 |
The property cannot be specified when creating a LUN clone. The |
5374884 |
A property that is required when creating a new LUN that is not a LUN clone or LUN copy was not supplied. The |
5374886 |
An error occurred after successfully creating the LUN preventing the retrieval of its properties. |
5374899 |
The |
5374928 |
An incomplete attribute name/value pair was supplied. |
5374929 |
The combined sizes of an attribute name and value are too large. |
5374932 |
A name for an attribute was duplicated. |
5374942 |
The property cannot be specified at the same time when creating a LUN as a clone. The |
5374943 |
The property cannot be specified at the same time when creating a LUN as a copy. The |
5374944 |
The property cannot be specified when converting an NVMe namespace into a LUN. The |
5375054 |
The source LUN is required when requesting an SVM copy operation. |
5375059 |
An unsuitable QoS policy was specified. |
7018877 |
Maximum combined total (50) of file and LUN copy and move operations reached. When one or more of the operations has completed, try the command again. |
13565952 |
The LUN clone request failed. |
26345672 |
An SVM peer relationship was not found with the provided 'copy.source.peer.uuid'. |
26345673 |
An SVM peer relationship between the SVM provided in 'copy.source.peer.name' and the SVM provided in either 'svm.name' or 'svm.uuid' was not found. |
26345674 |
The SVM peer relationship provided in 'copy.source.peer.uuid' does not match a peer relationship between the local SVM provided in either 'svm.uuid' or 'svm.name' and the peer SVM provided in 'copy.source.peer.name'. |
26345675 |
The destination SVM provided via 'svm.name' or 'svm.uuid' does not match the local SVM for the provided SVM peer relationship UUID in 'copy.source.peer.uuid'. |
72089755 |
NVMe namespace with a block size of 4096 bytes cannot be converted to a LUN. |
72089756 |
Namespace is currently mapped to subsystem. |
72089757 |
NVMe namespace in a Snapshot copy cannot be converted to a LUN. |
Also see the table of common errors in the Response body overview section of this documentation.
Name | Type | Description |
---|---|---|
error |
Example error
{
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist",
"target": "uuid"
}
}
Definitions
See Definitions
href
Name | Type | Description |
---|---|---|
href |
string |
_links
Name | Type | Description |
---|---|---|
self |
attributes
A name/value pair optionally stored with the LUN. Attributes are available to callers to persist small amounts of application-specific metadata. They are in no way interpreted by ONTAP.
Attribute names and values must be a