Contributors – Pravallika Chandolu, Yadagiri Rajaboina, Harsha Kotapati
Introduction:
In NVMe® technology, a namespace is a collection of Logical Block Addresses (LBA) accessible to host software. A namespace ID (NSID) is an identifier used by a controller to provide access to a namespace. Each namespace appears as a discrete storage device to the host. NVMe specifications support two types of namespaces – private and shared.
A private namespace can be attached to one controller at a time whereas a shared namespace can be attached and accessible to multiple controllers in an NVM subsystem concurrently. The namespace ‘NS A’, ‘NS C’ are private namespaces and NS B is shared namespace depicted with the below figure.

This blog explains the namespace management operations: Create, Attach, Delete and Detach etc., using System Management Interface Tool(SMIT) menu in AIX operating system.
On AIX host, use “smit nvme” command to enter the NVMe Manager menu. The menu lists “Namespace Management and Attachment” option which can be used to navigate through various options to perform the respective task as depicted in below picture.
#smit nvme

Creating a namespace:
Namespace creation requires various attributes such as the size of the namespace to be created. By default, this size is set to the maximum drive capacity. Any other required size of namespace must be mentioned explicitly using “Namespace Size” parameter. AIX supports two LBA formats: 512 and 4096 sizes.
If the user wants to attach the namespace to the controller during creation, then the “Attach after Create” attribute should be set as “yes”.

The following example shows NVMe namespace, after successful completion of namespace create operation with AIX.

The Namespace can be created as shared or private using “Create as shared” option. To create a shared namespace, this option should be set to “yes”. Regarding more information about shared namespaces, refer to blog in the reference section[i]
Attaching a namespace:
The namespace is attached to the same controller, through which it is created as explained in “Creating a namespace” section of this document. With NVMe expansion drawer supporting multipath I/O(MPIO) configuration, the shared namespace should be attached explicitly to second controller(drive ports) accessible from ESM2 as shown in below example.


For more details about supporting multipath capability refer to reference section[ii]
Detaching a namespace:
The detach namespace operation helps the user to disassociate the namespace with a given controller. This operation preserves the namespace on the drive as shown in below example. NVMe expansion drawer supporting multipath I/O(MPIO) configuration is one of the use cases of detach operation, which is prerequisite for moving the drive across the ESMs.


Delete a namespace:
Namespace deletion requires user to either input disk name corresponding to namespace or namespace id. With NVMe expansion drawer supporting multipath I/O(MPIO) configuration, a shared namespace can be deleted from a nvme controller only after detaching it from partner nvme controller.


References: