Skip to main content

Create an NVMe namespace

Contributors

POST /storage/namespaces

Introduced In: 9.6

Creates an NVMe namespace.

Required properties

  • svm.uuid or svm.name - Existing SVM in which to create the NVMe namespace.

  • name, location.volume.name or location.volume.uuid - Existing volume in which to create the NVMe namespace.

  • name or location.namespace - Base name for the NVMe namespace.

  • os_type - Operating system from which the NVMe namespace will be accessed. (Not used for clones, which are created based on the os_type of the source NVMe namespace.)

  • space.size - Size for the NVMe namespace. (Not used for clones, which are created based on the size of the source NVMe namespace.)

Default property values

If not specified in POST, the following default property values are assigned:

  • auto_delete - false

  • space.block_size - 4096 ( 512 when 'os_type' is vmware )

  • volume file clone autodelete

  • volume file clone create

  • vserver nvme namespace convert-from-lun

  • vserver nvme namespace create

Parameters

Name Type In Required Description

return_records

boolean

query

False

The default is false. If set to true, the records are returned.

  • Default value:

Request Body

Name Type Description

_links

_links

auto_delete

boolean

This property marks the NVMe namespace for auto deletion when the volume containing the namespace runs out of space. This is most commonly set on namespace clones.

When set to true, the NVMe namespace becomes eligible for automatic deletion when the volume runs out of space. Auto deletion only occurs when the volume containing the namespace 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 NVMe namespace 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 fields query parameter. See Requesting specific fields to learn more.

clone

clone

This sub-object is used in POST to create a new NVMe namespace as a clone of an existing namespace, or PATCH to overwrite an existing namespace as a clone of another. Setting a property in this sub-object indicates that a namespace clone is desired.

When used in a PATCH, the patched NVMe namespace's data is over-written as a clone of the source and the following properties are preserved from the patched namespace unless otherwise specified as part of the PATCH: auto_delete (unless specified in the request), subsystem_map, status.state, and uuid.

comment

string

A configurable comment available for use by the administrator. Valid in POST and PATCH.

consistency_group

consistency_group

The NVMe namespace's consistency group. This property is populated for NVMe namespaces that are members of a consistency group. If the NVMe namespace is a member of a child consistency group, the parent consistency group is reported.

Platform Specifics

  • Unified ONTAP: An NVMe namespace's consistency group is the consistency group of its containing volume.

  • ASA.Next: An NVMe namespace is optionally associated directly with a consistency group.

  • readOnly: 1

convert

convert

This sub-object is used in POST to convert a valid in-place LUN to an NVMe namespace. Setting a property in this sub-object indicates that a conversion from the specified LUN to NVMe namespace is desired.

create_time

string

The time the NVMe namespace was created.

enabled

boolean

The enabled state of the NVMe namespace. Certain error conditions cause the namespace to become disabled. If the namespace is disabled, you can check the state property to determine what error disabled the namespace. An NVMe namespace is enabled automatically when it is created.

encryption

encryption

Encryption related properties for the NVMe namespace.

Platform Specifics

  • Unified ONTAP: These properties are not available on the NVMe namespace object in the REST API and are not reported for GET requests. See the containing volume object for this information.

  • ASA.Next: Available for GET, POST and PATCH.

location

location

The location of the NVMe namespace within the ONTAP cluster. Valid in POST.

NVMe namespaces do not support rename, or movement between volumes.

  • Introduced in: 9.6

  • readCreate: 1

metric

metric

Performance numbers, such as IOPS latency and throughput

name

string

The fully qualified path name of the NVMe namespace composed of a "/vol" prefix, the volume name, the (optional) qtree name and base name of the namespace. Valid in POST.

NVMe namespaces do not support rename, or movement between volumes.

os_type

string

The operating system type of the NVMe namespace.

Required in POST when creating an NVMe namespace that is not a clone of another. Disallowed in POST when creating a namespace clone.

qos_policy

qos_policy

The QoS policy for the NVMe namspace. Both traditional and adaptive QoS policies are supported. If both property qos_policy.uuid and qos_policy.name are specified in the same request, they must refer to the same QoS policy. To remove the QoS policy from an NVMe namspace, leaving it with no QoS policy, set property qos_policy.name to an empty string ("") in a PATCH request. Valid in POST and PATCH.

Platform Specifics

  • Unified ONTAP: These properties are not available on the NVMe namespace object in the REST API and are not reported for GET requests. You can set a QoS policy on the containing volume.

  • ASA.Next: An NVMe namespace is optionally associated directly with a QoS policy.

space

space

The storage space related properties of the NVMe namespace.

statistics

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

Status information about the NVMe namespace.

subsystem_map

subsystem_map

The NVMe subsystem with which the NVMe namespace is associated. A namespace can be mapped to zero (0) or one (1) subsystems.

There is an added computational cost to retrieving property values for subsystem_map. They are not populated for either a collection GET or an instance GET unless explicitly requested using the fields query parameter. See Requesting specific fields to learn more.

svm

svm

SVM, applies only to SVM-scoped objects.

uuid

string

The unique identifier of the NVMe namespace.

Example request
{
  "_links": {
    "self": {
      "href": "/api/resourcelink"
    }
  },
  "clone": {
    "source": {
      "name": "/vol/volume1/namespace1",
      "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
    }
  },
  "comment": "string",
  "consistency_group": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "cg1",
    "uuid": "4abc2317-4332-9d37-93a0-20bd29c22df0"
  },
  "convert": {
    "lun": {
      "name": "/vol/volume1/lun1",
      "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
    }
  },
  "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"
    },
    "type": "string"
  },
  "location": {
    "namespace": "namespace1",
    "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"
    }
  },
  "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"
  },
  "name": "/vol/volume1/qtree1/namespace1",
  "os_type": "string",
  "qos_policy": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "qos1",
    "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
  },
  "space": {
    "block_size": 512,
    "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"
  },
  "subsystem_map": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "anagrpid": "00103050h",
    "nsid": "00000001h",
    "subsystem": {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      },
      "name": "subsystem1",
      "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
    }
  },
  "svm": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "svm1",
    "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
  },
  "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}

Response

Status: 201, Created
Name Type Description

_links

_links

num_records

integer

The number of records in the response.

records

array[nvme_namespace]

Example response
{
  "_links": {
    "next": {
      "href": "/api/resourcelink"
    },
    "self": {
      "href": "/api/resourcelink"
    }
  },
  "num_records": 1,
  "records": [
    {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      },
      "clone": {
        "source": {
          "name": "/vol/volume1/namespace1",
          "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
        }
      },
      "comment": "string",
      "consistency_group": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "cg1",
        "uuid": "4abc2317-4332-9d37-93a0-20bd29c22df0"
      },
      "convert": {
        "lun": {
          "name": "/vol/volume1/lun1",
          "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
        }
      },
      "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"
        },
        "type": "string"
      },
      "location": {
        "namespace": "namespace1",
        "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"
        }
      },
      "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"
      },
      "name": "/vol/volume1/qtree1/namespace1",
      "os_type": "string",
      "qos_policy": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "qos1",
        "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
      },
      "space": {
        "block_size": 512,
        "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"
      },
      "subsystem_map": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "anagrpid": "00103050h",
        "nsid": "00000001h",
        "subsystem": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "name": "subsystem1",
          "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
        }
      },
      "svm": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "svm1",
        "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
      },
      "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
    }
  ]
}

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 location.volume.uuid and location.volume.name do not refer to the same volume.

1254197

The LUN specified for conversion to a namespace is mapped.

1260121

Cloning a namespace 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 supplied SVM does not exist.

2621706

The specified svm.uuid and svm.name do not refer to the same SVM.

2621707

No SVM was specified. Either svm.name or svm.uuid must be supplied.

5242927

The specified qtree was not found.

5242950

The specified location.qtree.id and location.qtree.name do not refer to the same qtree.

5374127

An invalid namespace name was specified.

5374140

LUN has a non-zero prefix and/or suffix size.

5374141

LUN is part of a SnapMirror active sync relationship.

5374156

A protocol endpoint LUN cannot be converted to an NVMe namespace.

5374157

LUN in an SVM with MetroCluster configured cannot be converted to an NVMe namespace.

5374158

LUN contains an operating system type that is not supported for NVMe namespace.

5374352

An invalid name was provided for the NVMe namespace.

5374858

The volume specified by name is not the same as that specified by location.volume.

5374860

The qtree specified by name is not the same as that specified by location.qtree.

5374861

The NVME namespace base name specified by name is not the same as that specified by location.name.

5374862

No NVMe namespace path base name was provided for the namespace.

5374876

The LUN specified for conversion to a namespace was not found.

13565952

The NVMe namespace clone request failed.

72089636

Creating NVMe namespaces with os_type AIX is not supported until the effective cluster version is 9.13.1 or later.

72089720

NVMe namespaces cannot be created in Snapshot copies.

72089721

The volume specified is in a load sharing mirror relationship. Namespaces are not supported in load sharing mirrors.

72089722

A negative size was provided for the NVMe namespace.

72089723

The specified size is too small for the NVMe namespace.

72089724

The specified size is too large for the NVMe namespace.

72089725

A LUN or NVMe namespace already exists at the specified path.

72089727

NVMe namespaces cannot be created on an SVM root volume.

72089728

NVMe namespaces cannot be created on a FlexGroup volume.

72089732

An NVMe namespace name can only contain characters A-Z, a-z, 0-9, "-", ".", "_", "{" and "}".

72090005

The specified clone.source.uuid and clone.source.name do not refer to the same NVMe namespace.

72090006

The specified clone.source was not found.

72090007

The specified clone.source was not found.

72090009

An error occurred after successfully creating the NVMe namespace. Some properties were not set.

72090012

The property cannot be specified when creating an NVMe namespace clone. The target property of the error object identifies the property.

72090013

The property is required except when creating an NVMe namespace clone. The target property of the error object identifies the property.

72090014

No volume was specified for the NVMe namespace.

72090015

An error occurred after successfully creating the NVMe namespace preventing the retrieval of its properties.

72090033

The clone.source.uuid property is not supported when specifying a source NVMe namespace from a Snapshot copy.

72090039

The property cannot be specified at the same time when creating an NVMe namespace as a clone. The target property of the error object identifies the other property given with clone.

72090040

The property cannot be specified when converting a LUN into an NVMe namespace. The target property of the error object identifies the property.

Also see the table of common errors in the Response body overview section of this documentation.

Name Type Description

error

returned_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

Name Type Description

self

href

source

The source NVMe namespace for a namespace clone operation. This can be specified using property clone.source.uuid or clone.source.name. If both properties are supplied, they must refer to the same namespace.

Valid in POST to create a new NVMe namespace as a clone of the source.

Valid in PATCH to overwrite an existing NVMe namespace's data as a clone of another.

Name Type Description

name

string

The fully qualified path name of the clone source NVMe namespace composed of a "/vol" prefix, the volume name, the (optional) qtree name and base name of the namespace. Valid in POST and PATCH.

uuid

string

The unique identifier of the clone source NVMe namespace. Valid in POST and PATCH.

clone

This sub-object is used in POST to create a new NVMe namespace as a clone of an existing namespace, or PATCH to overwrite an existing namespace as a clone of another. Setting a property in this sub-object indicates that a namespace clone is desired.

When used in a PATCH, the patched NVMe namespace's data is over-written as a clone of the source and the following properties are preserved from the patched namespace unless otherwise specified as part of the PATCH: auto_delete (unless specified in the request), subsystem_map, status.state, and uuid.

Name Type Description

source

source

The source NVMe namespace for a namespace clone operation. This can be specified using property clone.source.uuid or clone.source.name. If both properties are supplied, they must refer to the same namespace.

Valid in POST to create a new NVMe namespace as a clone of the source.

Valid in PATCH to overwrite an existing NVMe namespace's data as a clone of another.

consistency_group

The NVMe namespace's consistency group. This property is populated for NVMe namespaces that are members of a consistency group. If the NVMe namespace is a member of a child consistency group, the parent consistency group is reported.

=== Platform Specifics

  • Unified ONTAP: An NVMe namespace's consistency group is the consistency group of its containing volume.

  • ASA.Next: An NVMe namespace is optionally associated directly with a consistency group.

Name Type Description

_links

_links

name

string

The name of the consistency group.

uuid

string

The unique identifier of the consistency group.

lun

The source LUN for convert operation. This can be specified using property convert.lun.uuid or convert.lun.name. If both properties are supplied, they must refer to the same LUN.

Valid in POST. A convert request from LUN to NVMe namespace cannot be combined with setting any other namespace properties. All other properties of the converted NVMe namespace come from the source LUN.

Name Type Description

name

string

The fully qualified path name of the source LUN composed of a "/vol" prefix, the volume name, the (optional) qtree name and base name of the LUN. Valid in POST.