Dynamic mapping of NVME (non-volatile memory express) namespaces to hosts
An add host group mapping command is received that indicates a host group and a host to which the host group is to be mapped. The host group indicates an NVMe namespace that includes a boot drive that is used by the host to boot up. In response to the add group mapping command, the host group is mapped to the host by adding the host group to a host object corresponding to the host. The addition of the host group to the host object enables the host to subsequently access the NVMe namespace.
1 . A method comprising:
receiving an add host group mapping command, the add host group mapping command indicating a first host group and a host to which the first host group is to be mapped, wherein the host first group indicates a namespace that includes a boot drive that is used by the host to boot up;
in response to the add group mapping command, mapping the first host group to the host by adding the first host group to a host object corresponding to the host, wherein adding the first host group to the host object includes adding an indication of the first host group to an array in the host object that stores an indication of a second host group, and wherein adding the indication of the first host group to the array comprises storing the indication of the first host group into an array entry in the array that follows an array entry storing the indication of the second host group;
wherein the addition of the first host group to the host object enables the host to subsequently access the namespace; and
after the first host group is added to the host object and prior to indicating completion of the add host group mapping command, ensuring that all host I/O (Input/Output) request processing threads that are currently waiting to access the host object have accessed the host object with the indication of the first host group having been added to the array in the host object.
2 . The method of claim 1 , further comprising after the first host group is added to the host object, allowing access to the namespace by the host in order to access the boot drive in order to boot the host.
3 . The method of claim 1 , further comprising:
receiving a remove host group mapping command, the remove group mapping command indicating the first host group and the host;
in response to the remove host group mapping command, removing the first host group from the host object corresponding to the host by removing the indication of the first host group from the array in the host object; and
wherein the removal of the first host group from the host object prevents the host from accessing the namespace.
4 . The method of claim 3 , further comprising:
after the first host group is removed from the host object, and prior to indicating completion of the remove group mapping command, ensuring that each host I/O (Input/Output) request processing thread that has accessed the host object has completed and issued a response to the host.
5 . The method of claim 1 , wherein the namespace comprises an NVMe (Non-Volatile Memory Express) namespace.
6 . A data storage system comprising:
processing circuitry and memory coupled to the processing circuitry, the memory storing instructions, wherein the instructions, when executed by the processing circuitry, cause the processing circuitry to:
receive an add host group mapping command, the add host group mapping command indicating a first host group and a host to which the first host group is to be mapped, wherein the first host group indicates a namespace that includes a boot drive that is used by the host to boot up,
in response to the add group mapping command, map the first host group to the host by adding the first host group to a host object corresponding to the host, wherein adding the first host group to the host object includes adding an indication of the first host group to an array in the host object that stores an indication of a second host group, and wherein adding the indication of the first host group to the array comprises storing the indication of the first host group into an array entry in the array that follows an array entry storing the indication of the second host group,
wherein the addition of the first host group to the host object enables the host to subsequently access the namespace; and
after the first host group is added to the host object and prior to indicating completion of the add host group mapping command, ensure that all host I/O (Input/Output) request processing threads that are currently waiting to access the host object have accessed the host object with the indication of the first host group having been added to the array in the host object.
7 . The data storage system of claim 6 , wherein the instructions, when executed by the processing circuitry, further cause the processing circuitry to:
after the first host group is added to the host object, allow access to the namespace by the host in order to access the boot drive in order to boot the host.
8 . The data storage system of claim 6 , wherein the instructions, when executed by the processing circuitry, further cause the processing circuitry to:
receive a remove host group mapping command, the remove group mapping command indicating the first host group and the host;
in response to the remove host group mapping command, remove the first host group from the host object corresponding to the host by removing the indication of the first host group from the array in the host object; and
wherein the removal of the first host group from the host object prevents the host from accessing the namespace.
9 . The data storage system of claim 8 , wherein the instructions, when executed by the processing circuitry, further cause the processing circuitry to:
after the first host group is removed from the host object, and prior to indicating completion of the remove group mapping command, ensure that each host I/O (Input/Output) request processing thread that has accessed the host object has completed and issued a response to the host.
10 . The data storage system of claim 6 , wherein the namespace comprises an NVMe (Non-Volatile Memory Express) namespace.
11 . A computer program product including a non-transitory computer readable medium having instructions stored thereon, wherein the instructions, when executed on processing circuitry, cause the processing circuitry to perform steps including:
receiving an add host group mapping command, the add host group mapping command indicating a first host group and a host to which the first host group is to be mapped, wherein the first host group indicates a namespace that includes a boot drive that is used by the host to boot up;
in response to the add group mapping command, mapping the first host group to the host by adding the first host group to a host object corresponding to the host, wherein adding the first host group to the host object includes adding an indication of the first host group to an array in the host object that stores an indication of a second host group, and wherein adding the indication of the first host group to the array comprises storing the indication of the first host group into an array entry in the array that follows an array entry storing the indication of the second host group;
wherein the addition of the first host group to the host object enables the host to subsequently access the namespace; and
after the first host group is added to the host object and prior to indicating completion of the add host group mapping command, ensuring that all host I/O (Input/Output) request processing threads that are currently waiting to access the host object have accessed the host object with the indication of the first host group having been added to the array in the host object.
12 . The computer program product of claim 11 , the steps further comprising after the first host group is added to the host object, allowing access to the namespace by the host in order to access the boot drive in order to boot the host.
13 . The computer program product of claim 11 , the steps further comprising:
receiving a remove host group mapping command, the remove group mapping command indicating the first host group and the host;
in response to the remove host group mapping command, removing the first host group from the host object corresponding to the host by removing the indication of the first host group from the array in the host object; and
wherein the removal of the first host group from the host object prevents the host from accessing the namespace.
14 . The computer program product of claim 13 , wherein the namespace comprises an NVMe (Non-Volatile Memory Express) namespace, the steps further comprising:
after the first host group is removed from the host object, and prior to indicating completion of the remove group mapping command, ensuring that each host I/O (Input/Output) request processing thread that has accessed the host object has completed and issued a response to the host.