Module netapp_ontap.resources.nvme_namespace
Copyright © 2024 NetApp Inc. All rights reserved.
This file has been automatically generated based on the ONTAP REST API documentation.
Overview
An NVMe namespace is a collection of addressable logical blocks presented to hosts connected to the storage virtual machine using the NVMe over Fabrics protocol.
The NVMe namespace REST API allows you to create, update, delete and discover NVMe namespaces.
An NVMe namespace must be mapped to an NVMe subsystem to grant access to the subsystem's hosts. Hosts can then access the NVMe namespace and perform I/O using the NVMe over Fabrics protocol.
See the NVMe namespace object model to learn more about each of the properties supported by the NVMe namespace REST API.
Platform Specifics
Unified ONTAP
An NVMe namespace is located within a volume. Optionally, it can be located within a qtree in a volume.
NVMe namespace names are paths of the form "/vol/\
An NVMe namespace is created to a specified size using thin or thick provisioning as determined by the volume on which it is created. An NVMe namespace can then be resized or cloned. An NVMe namespace cannot be renamed, or moved to a different volume. NVMe namespaces do not support the assignment of a QoS policy for performance management, but a QoS policy can be assigned to the volume containing the namespace.
ASA r2
NVMe namespace names are simple names that share a namespace with LUNs within the same SVM. The name must begin with a letter or "_" and contain only "_" and alphanumeric characters. In specific cases, an optional snapshot-name can be used of the form "\
An NVMe namespace can be created to a specified size. An NVMe namespace can then be renamed, resized, or cloned. NVMe namespaces support the assignment of a QoS policy for performance management.
Note: NVMe namespace related REST API examples use the Unified ONTAP form for NVMe namespace names. On ASA r2, the ASA r2 format must be used.
Performance monitoring
Performance of an NVMe namespace can be monitored by observing the metric.*
and statistics.*
properties. These properties show the space utilization and performance of an NVMe namespace in terms of IOPS, latency, and throughput. The metric.*
properties denote an average, whereas statistics.*
properties denote a real-time monotonically increasing value aggregated across all nodes.
Examples
Creating an NVMe namespace
This example creates a 300 gigabyte NVMe namespace, with 4096-byte blocks, in SVM svm1, volume vol1, configured for use by linux hosts. The return_records
query parameter is used to retrieve properties of the newly created NVMe namespace in the POST response.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace()
resource.svm = {"name": "svm1"}
resource.os_type = "linux"
resource.space = {"block_size": "4096", "size": "300G"}
resource.name = "/vol/vol1/namespace1"
resource.post(hydrate=True)
print(resource)
NvmeNamespace(
{
"name": "/vol/vol1/namespace1",
"enabled": True,
"_links": {
"self": {
"href": "/api/storage/namespaces/dccdc3e6-cf4e-498f-bec6-f7897f945669"
}
},
"svm": {
"name": "svm1",
"_links": {
"self": {"href": "/api/svm/svms/6bf967fd-2a1c-11e9-b682-005056bbc17d"}
},
"uuid": "6bf967fd-2a1c-11e9-b682-005056bbc17d",
},
"uuid": "dccdc3e6-cf4e-498f-bec6-f7897f945669",
"location": {
"volume": {
"name": "vol1",
"_links": {
"self": {
"href": "/api/storage/volumes/71cd0dba-2a1c-11e9-b682-005056bbc17d"
}
},
"uuid": "71cd0dba-2a1c-11e9-b682-005056bbc17d",
},
"namespace": "namespace1",
},
"os_type": "linux",
"status": {"read_only": False, "state": "online", "container_state": "online"},
"space": {
"block_size": 4096,
"used": 0,
"guarantee": {"requested": False, "reserved": False},
"size": 322122547200,
},
}
)
Updating an NVMe namespace comment
This example sets the comment
property of an NVMe namespace.
# The API:
PATCH /api/storage/namespaces/{uuid}
# The call:
Updating the size of an NVMe namespace
This example increases the size of an NVMe namespace.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace(uuid="dccdc3e6-cf4e-498f-bec6-f7897f945669")
resource.space = {"size": "1073741824"}
resource.patch()
Retrieving NVMe namespaces
This example retrieves summary information for all online NVMe namespaces in SVM svm1. The svm.name
and status.state
query parameters are to find the desired NVMe namespaces.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
print(
list(
NvmeNamespace.get_collection(
**{"svm.name": "svm1", "status.state": "online"}
)
)
)
[
NvmeNamespace(
{
"name": "/vol/vol1/namespace2",
"_links": {
"self": {
"href": "/api/storage/namespaces/5c254d22-96a6-42ac-aad8-0cd9ebd126b6"
}
},
"svm": {"name": "svm1"},
"uuid": "5c254d22-96a6-42ac-aad8-0cd9ebd126b6",
"status": {"state": "online"},
}
),
NvmeNamespace(
{
"name": "/vol/vol1/namespace1",
"_links": {
"self": {
"href": "/api/storage/namespaces/dccdc3e6-cf4e-498f-bec6-f7897f945669"
}
},
"svm": {"name": "svm1"},
"uuid": "dccdc3e6-cf4e-498f-bec6-f7897f945669",
"status": {"state": "online"},
}
),
NvmeNamespace(
{
"name": "/vol/vol2/namespace3",
"_links": {
"self": {
"href": "/api/storage/namespaces/be732687-20cf-47d2-a0e2-2a989d15661d"
}
},
"svm": {"name": "svm1"},
"uuid": "be732687-20cf-47d2-a0e2-2a989d15661d",
"status": {"state": "online"},
}
),
]
Retrieving details for a specific NVMe namespace
In this example, the fields
query parameter is used to request all fields, including advanced fields, that would not otherwise be returned by default for the NVMe namespace.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace(uuid="dccdc3e6-cf4e-498f-bec6-f7897f945669")
resource.get(fields="**")
print(resource)
NvmeNamespace(
{
"name": "/vol/vol1/namespace1",
"enabled": True,
"_links": {
"self": {
"href": "/api/storage/namespaces/dccdc3e6-cf4e-498f-bec6-f7897f945669?fields=**"
}
},
"svm": {
"name": "svm1",
"_links": {
"self": {"href": "/api/svm/svms/6bf967fd-2a1c-11e9-b682-005056bbc17d"}
},
"uuid": "6bf967fd-2a1c-11e9-b682-005056bbc17d",
},
"metric": {
"status": "ok",
"iops": {"total": 0, "write": 0, "other": 0, "read": 0},
"latency": {"total": 0, "write": 0, "other": 0, "read": 0},
"timestamp": "2019-04-09T05:50:15+00:00",
"throughput": {"total": 0, "write": 0, "read": 0},
"duration": "PT15S",
},
"uuid": "dccdc3e6-cf4e-498f-bec6-f7897f945669",
"subsystem_map": {
"subsystem": {
"name": "subsystem1",
"uuid": "01f17d05-2be9-11e9-bed2-005056bbc17d",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/01f17d05-2be9-11e9-bed2-005056bbc17d"
}
},
},
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystem-maps/dccdc3e6-cf4e-498f-bec6-f7897f945669/01f17d05-2be9-11e9-bed2-005056bbc17d"
}
},
"nsid": "00000001h",
"anagrpid": "00000001h",
},
"location": {
"volume": {
"name": "vol1",
"_links": {
"self": {
"href": "/api/storage/volumes/71cd0dba-2a1c-11e9-b682-005056bbc17d"
}
},
"uuid": "71cd0dba-2a1c-11e9-b682-005056bbc17d",
},
"namespace": "namespace1",
},
"os_type": "linux",
"statistics": {
"status": "ok",
"iops_raw": {"total": 3, "write": 0, "other": 3, "read": 0},
"latency_raw": {"total": 38298, "write": 0, "other": 38298, "read": 0},
"throughput_raw": {"total": 0, "write": 0, "read": 0},
"timestamp": "2019-04-09T05:50:42+00:00",
},
"comment": "Data for the research department.",
"status": {
"read_only": False,
"state": "online",
"mapped": True,
"container_state": "online",
},
"auto_delete": False,
"space": {
"block_size": 4096,
"used": 0,
"guarantee": {"requested": False, "reserved": False},
"size": 322122547200,
},
}
)
Cloning NVMe namespaces
A clone of an NVMe namespace is an independent "copy" of the namespace that shares unchanged data blocks with the original. As blocks of the source and clone are modified, unique blocks are written for each. NVMe namespace clones can be created quickly and consume very little space initially. They can be created for the purpose of back-up, or to replicate data for multiple consumers.
An NVMe namespace clone can also be set to auto-delete by setting the auto_delete
property. If the namespace's volume is configured for automatic deletion, NVMe namespaces that have auto-delete enabled are deleted when a volume is nearly full to reclaim a target amount of free space in the volume.
Creating a new NVMe namespace clone
You create an NVMe namespace clone as you create any NVMe namespace – a POST to /storage/namespaces
. Set clone.source.uuid
or clone.source.name
to identify the source NVMe namespace from which the clone is created. The NVMe namespace clone and its source must reside in the same volume.
The source NVMe namespace can reside in a snapshot, in which case, the clone.source.name
field must be used to identify it. Add /.snapshot/<snapshot_name>
to the path after the volume name to identify the snapshot. For example /vol/vol1/.snapshot/snap1/namespace1
.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace()
resource.svm = {"name": "svm1"}
resource.name = "/vol/vol1/namespace2clone1"
resource.clone = {"source": {"name": "/vol/vol1/namespace2"}}
resource.post(hydrate=True)
print(resource)
Over-writing an existing NVMe namespace's data as a clone of another
You can over-write an existing NVMe namespace as a clone of another. You do this as a PATCH on the NVMe namespace to overwrite – a PATCH to /storage/namespaces/{uuid}
. Set the clone.source.uuid
or clone.source.name
property to identify the source NVMe namespace from which the clone data is taken. The NVMe namespace clone and its source must reside in the same volume.
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
, subsystem_map
, status.state
, and uuid
.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace(uuid="dccdc3e6-cf4e-498f-bec6-f7897f945669")
resource.clone = {"source": {"name": "/vol/vol1/namespace2"}}
resource.patch()
Converting a LUN into an NVMe namespace
An existing LUN can be converted in-place to an NVMe namespace with no modification to the data blocks. In other words, there is no additional copy created for the data blocks. There are certain requirements when converting a LUN to an NVMe namespace. For instance, the LUN should not be mapped to an initiator group, or exist as a protocol endpoint LUN, or in a foreign LUN import relationship. If the LUN exists as a VM volume, it should not be bound to a protocol endpoint LUN. Furthermore, only LUN with a supported operating system type for NVMe namespace can be converted.
The conversion process updates the metadata to the LUN, making it an NVMe namespace. The conversion is both time and space efficient. After conversion, the new namespace behaves as a regular namespace and may be mapped to an NVMe subsystem.
Convert a LUN into an NVMe namespace
You convert a LUN into an NVMe namespace by calling a POST to /storage/namespaces
. Set convert.lun.uuid
or convert.lun.name
to identify the source LUN which is to be converted in-place into an NVMe namespace.
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace()
resource.svm = {"name": "svm1"}
resource.convert = {"lun": {"name": "/vol/vol1/lun1"}}
resource.post(hydrate=True)
print(resource)
Deleting an NVMe namespace
from netapp_ontap import HostConnection
from netapp_ontap.resources import NvmeNamespace
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = NvmeNamespace(uuid="5c254d22-96a6-42ac-aad8-0cd9ebd126b6")
resource.delete()
Classes
class NvmeNamespace (*args, **kwargs)
-
An NVMe namespace is a collection of addressable logical blocks presented to hosts connected to the storage virtual machine using the NVMe over Fabrics protocol.
An NVMe namespace must be mapped to an NVMe subsystem to grant access to the subsystem's hosts. Hosts can then access the NVMe namespace and perform I/O using the NVMe over Fabrics protocol.
See the NVMe namespace object model to learn more about each of the properties supported by the NVMe namespace REST API.Platform Specifics
Unified ONTAP
An NVMe namespace is located within a volume. Optionally, it can be located within a qtree in a volume.
NVMe namespace names are paths of the form "/vol/\[/\ ]/\ " where the qtree name is optional.
An NVMe namespace is created to a specified size using thin or thick provisioning as determined by the volume on which it is created. An NVMe namespace can then be resized or cloned. An NVMe namespace cannot be renamed, or moved to a different volume. NVMe namespaces do not support the assignment of a QoS policy for performance management, but a QoS policy can be assigned to the volume containing the namespace.ASA r2
NVMe namespace names are simple names that share a namespace with LUNs within the same SVM. The name must begin with a letter or "_" and contain only "_" and alphanumeric characters. In specific cases, an optional snapshot-name can be used of the form "\
[@\ ]". The snapshot name must not begin or end with whitespace.
An NVMe namespace can be created to a specified size. An NVMe namespace can then be renamed, resized, or cloned. NVMe namespaces support the assignment of a QoS policy for performance management.
Note: NVMe namespace related REST API examples use the Unified ONTAP form for NVMe namespace names. On ASA r2, the ASA r2 format must be used.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 count_collection (*args, connection: HostConnection = None, **kwargs) -> int
-
Returns a count of all NvmeNamespace resources that match the provided query
This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.
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 count 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. These query parameters can affect the count. A return_records query param will be ignored.
Returns
On success, returns an integer count of the objects of this type. On failure, returns -1.
Raises
NetAppRestError
: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library. def delete_collection (*args, records: Iterable[ForwardRef('NvmeNamespace')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Deletes an NVMe namespace.
Related ONTAP commands
vserver nvme namespace delete
Platform Specifics
- ASA r2: DELETE is asynchronous.
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.
records
- Can be provided in place of a query. If so, this list of objects will be deleted from the host.
body
- The body of the delete request. This could be a Resource instance or a dictionary 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.
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 deleted.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def fast_get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[RawResource]
-
Returns a list of RawResources that represent NvmeNamespace resources that match the provided query
Fetch a list of all objects of this type from the host.
This is a lazy fetch, making API calls only as necessary when the result of this call is iterated over. For instance, if max_records is set to 5, then iterating over the collection causes an API call to be sent to the server once for every 5 records. If the client stops iterating before getting to the 6th record, then no additional API calls are made.
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
raw
- return a list of
netapp_ontap.resource.RawResource
objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server. **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. This would be not be raised when get_collection() is called, but rather when the result is iterated. def find (*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves NVMe namespaces.
Expensive properties
There is an added computational 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. SeeRequesting specific fields
to learn more. *auto_delete
*space.physical_used
*space.physical_used_by_snapshots
*space.efficiency_ratio
*subsystem_map.*
*status.mapped
*statistics.*
*metric.*
Related ONTAP commands
vserver nvme namespace show
vserver nvme subsystem map show
Learn more
DOC /storage/namespaces
to learn more and examples.
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, None will be returned. 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 or None if no matches were found.Raises
NetAppRestError
: If the API call returned more than 1 matching resource. def get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[Resource]
-
Retrieves NVMe namespaces.
Expensive properties
There is an added computational 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. SeeRequesting specific fields
to learn more. *auto_delete
*space.physical_used
*space.physical_used_by_snapshots
*space.efficiency_ratio
*subsystem_map.*
*status.mapped
*statistics.*
*metric.*
Related ONTAP commands
vserver nvme namespace show
vserver nvme subsystem map show
Learn more
DOC /storage/namespaces
to learn more and examples.
Fetch a list of all objects of this type from the host.
This is a lazy fetch, making API calls only as necessary when the result of this call is iterated over. For instance, if max_records is set to 5, then iterating over the collection causes an API call to be sent to the server once for every 5 records. If the client stops iterating before getting to the 6th record, then no additional API calls are made.
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
raw
- return a list of
netapp_ontap.resource.RawResource
objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server. **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. This would be not be raised when get_collection() is called, but rather when the result is iterated. def patch_collection (body: dict, *args, records: Iterable[ForwardRef('NvmeNamespace')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Updates an NVMe namespace.
Related ONTAP commands
volume file clone autodelete
vserver nvme namespace modify
Platform Specifics
- ASA r2: PATCH is asynchronous when modifying
name
orqos_policy
.
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. The body argument will be ignored if records is provided.
*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.
records
- Can be provided in place of a query. If so, this list of objects will be patched on the host.
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.
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 post_collection (records: Iterable[ForwardRef('NvmeNamespace')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[NvmeNamespace], NetAppResponse]
-
Creates an NVMe namespace.
Required properties
svm.uuid
orsvm.name
- Existing SVM in which to create the NVMe namespace.name
,location.volume.name
orlocation.volume.uuid
- Existing volume in which to create the NVMe namespace.name
orlocation.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 theos_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 )Related ONTAP commands
volume file clone autodelete
volume file clone create
vserver nvme namespace convert-from-lun
vserver nvme namespace create
Platform Specifics
- ASA r2: The
name
property is required when creating a new namespace. The name must start with an alphabetic character (a to z or A to Z) or an underscore (_). The name must be 203 characters or less in length. Thelocation
properties are not supported. POST is asynchronous when creating a new namespace. It is synchronous when converting a LUN to a namespace via theconvert
property.
Learn more
Send this collection of objects to the host as a creation request.
Args
records
- A list of
Resource
objects to send to the server to be created. *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 create a bar for a particular foo, the foo.name value should be passed.
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 each object. When hydrate is set to True, poll must also be set to True.
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.
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 list of
Resource
objects matching the provided type which have been created by the host and returned. This is not the same list that was provided, so to continue using the object, you should save this list. If poll is set to False, then aNetAppResponse
object is returned instead.Raises
NetAppRestError
: If the API call returned a status code >= 400
Methods
def delete (self, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse
-
Deletes an NVMe namespace.
Related ONTAP commands
vserver nvme namespace delete
Platform Specifics
- ASA r2: DELETE is asynchronous.
Learn more
Send a deletion request to the host for this object.
Args
body
- The body of the delete request. This could be a Resource instance or a dictionary 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.
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
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 an NVMe namespace.
Expensive properties
There is an added computational 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. SeeRequesting specific fields
to learn more. *auto_delete
*space.physical_used
*space.physical_used_by_snapshots
*space.efficiency_ratio
*subsystem_map.*
*status.mapped
*statistics.*
*metric.*
Related ONTAP commands
vserver nvme namespace show
vserver nvme subsystem map 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 or if not all of the keys required are present and config.STRICT_GET has been set to True. def patch (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse
-
Updates an NVMe namespace.
Related ONTAP commands
volume file clone autodelete
vserver nvme namespace modify
Platform Specifics
- ASA r2: PATCH is asynchronous when modifying
name
orqos_policy
.
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.
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 normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.
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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse
-
Creates an NVMe namespace.
Required properties
svm.uuid
orsvm.name
- Existing SVM in which to create the NVMe namespace.name
,location.volume.name
orlocation.volume.uuid
- Existing volume in which to create the NVMe namespace.name
orlocation.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 theos_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 )Related ONTAP commands
volume file clone autodelete
volume file clone create
vserver nvme namespace convert-from-lun
vserver nvme namespace create
Platform Specifics
- ASA r2: The
name
property is required when creating a new namespace. The name must start with an alphabetic character (a to z or A to Z) or an underscore (_). The name must be 203 characters or less in length. Thelocation
properties are not supported. POST is asynchronous when creating a new namespace. It is synchronous when converting a LUN to a namespace via theconvert
property.
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.
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 normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.
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 NvmeNamespaceSchema (*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)
-
The fields of the NvmeNamespace object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.base.SchemaABC
- abc.ABC
Class variables
-
auto_delete: bool GET POST PATCH
-
-
Unified ONTAP: 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 thefields
query parameter. SeeRequesting specific fields
to learn more. -
ASA r2: This property is not supported. It cannot be set in POST or PATCH and will not be returned by GET.
-
-
clone: NvmeNamespaceClone POST PATCH
-
-
Unified ONTAP: 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
, anduuid
. -
ASA r2: This endpoint does not support clones. No properties in this sub-object can be set for POST or PATCH and none will be returned by GET.
Cloning is supported through the /api/storage/storage-units endpoint. See thePOST /ap/storage/storage-units
to learn more about cloning NVMe namespaces.
-
-
comment: str GET POST PATCH
-
A configurable comment available for use by the administrator. Valid in POST and PATCH.
-
consistency_group: NvmeNamespaceConsistencyGroup GET
-
The namespace's consistency group. This property is populated for namespaces that are members of a consistency group. If the namespace is a member of a child consistency group, the parent consistency group is reported.
Platform Specifics
- Unified ONTAP: A namespace's consistency group is the consistency group of its containing volume.
- ASA r2: A namespace is optionally associated directly with a consistency group.
-
convert: NvmeNamespaceConvert POST
-
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: ImpreciseDateTime GET
-
The time the NVMe namespace was created.
Example: 2018-06-04T19:00:00.000+0000
-
enabled: bool GET
-
The enabled state of the NVMe namespace. Certain error conditions cause the namespace to become disabled. If the namespace is disabled, check the
status.state
property to determine what error disabled the namespace. An NVMe namespace is enabled automatically when it is created. -
encryption: StorageUnitEncryption GET
-
The encryption field of the nvme_namespace.
-
links: SelfLink GET
-
The links field of the nvme_namespace.
-
location: NvmeNamespaceLocation GET POST
-
The location of the NVMe namespace within the ONTAP cluster.
Platform Specifics
-
Unified ONTAP: NVMe namespaces do not support rename, or movement between volumes. Valid in POST.
-
ASA r2: The NVMe namespace name can be changed by PATCHing the
name
property. Thelocation
properties are read-only.
-
-
metric: PerformanceMetricReducedThroughput GET
-
Performance numbers, such as IOPS latency and throughput
-
name: str GET POST PATCH
-
The name of the NVMe namespace.
Platform Specifics
-
Unified ONTAP: An NVMe namespace is located within a volume. Optionally, it can be located within a qtree in a volume.
NVMe namespace names are paths of the form "/vol/\[/\ ]/\ " where the qtree name is optional.
Renaming an NVMe namespace is not supported. Valid in POST. -
ASA r2: NVMe namespace names are simple names that share a namespace with LUNs within the same SVM. The name must begin with a letter or "_" and contain only "_" and alphanumeric characters. In specific cases, an optional snapshot-name can be used of the form "\
[@\ ]". The snapshot name must not begin or end with whitespace.
Renaming an NVMe namespace is supported. Valid in POST and PATCH.
Example: /vol/volume1/qtree1/namespace1
-
-
os_type: str GET POST
-
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.Valid choices:
- aix
- linux
- vmware
- windows
-
provisioning_options: NvmeNamespaceProvisioningOptions POST
-
Options that are applied to the operation.
-
qos_policy: NvmeNamespaceQosPolicy GET POST PATCH
-
The QoS policy for the NVMe namspace. Both traditional and adaptive QoS policies are supported. If both property
qos_policy.uuid
andqos_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 propertyqos_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 r2: An NVMe namespace is optionally associated directly with a QoS policy. To remove the QoS policy, set it to
null
in a PATCH request.
-
space: NvmeNamespaceSpace GET POST PATCH
-
The storage space related properties of the NVMe namespace.
-
statistics: PerformanceMetricRawReducedThroughput GET
-
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: NvmeNamespaceStatus GET
-
Status information about the NVMe namespace.
-
subsystem_map: NvmeNamespaceSubsystemMap GET POST
-
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 forsubsystem_map
. They are not populated for either a collection GET or an instance GET unless explicitly requested using thefields
query parameter. SeeRequesting specific fields
to learn more.Platform Specifics
- Unified ONTAP: These properties are supported only for GET.
- ASA r2: These properties are supported for GET and POST. During POST, a new or existing subsystem can be referenced. When referencing an existing subsystem, only the
name
anduuid
properties are supported.
-
svm: Svm GET POST
-
The svm field of the nvme_namespace.
-
uuid: str GET
-
The unique identifier of the NVMe namespace.
Example: 1cd8a442-86d1-11e0-ae1c-123478563412