A client host represents a client that intends to access storage resources. After a storage resource is associated with a client host, the corresponding client obtains access permissions to that storage resource.
Procedure
Run the following command on any node in the cluster to view all client hosts in the cluster:
zbs-meta host listOutput example
ID Name Group ID Description
------------------------------------ ------ ------------------------------------ -------------
2dd38a55-f64d-4916-8f51-1fce4cbe844e h1 9fc99f41-c08a-4a3a-9739-a8ee9e22e57b
e3283316-90c6-4d16-a540-50bccce5e109 h2 9fc99f41-c08a-4a3a-9739-a8ee9e22e57b
ee104b5f-74b1-4600-98d6-645dbb91f77b h3Output note
| Parameter | Description |
|---|---|
ID | The client host ID. |
Name | The client host name. |
Group ID | Its client host group ID. |
Description | The client host description. |
Procedure
Run the following command on any node in the cluster to view all client hosts in the client host group:
View by client host group name:
zbs-meta host list_by_group <host_group_name>View by client host group ID:
zbs-meta host list_by_group_id <host_group_id>Output example
ID Name Group ID Description
------------------------------------ ------ ------------------------------------ -------------
2dd38a55-f64d-4916-8f51-1fce4cbe844e h1 9fc99f41-c08a-4a3a-9739-a8ee9e22e57b
e3283316-90c6-4d16-a540-50bccce5e109 h2 9fc99f41-c08a-4a3a-9739-a8ee9e22e57bOutput note
| Parameter | Description |
|---|---|
ID | The client host ID. |
Name | The client host name. |
Group ID | Its client host group ID. |
Description | The client host description. |
Procedure
Run the following command on any node in the cluster to view the basic information, initiator information, and associated storage resources of a specified client host:
View by client host name:
zbs-meta host show <host_name> [--show_initiators] [--show_associated_resources]View by client host ID:
zbs-meta host show_by_id <host_id> [--show_initiators] [--show_associated_resources]| Parameter | Description |
|---|---|
--show_initiators | Optional. Displays the initiator information about the client host. If not specified, the information is not displayed. |
--show_associated_resources | Optional. Displays the associated storage resource information about the client host. If not specified, the information is not displayed. |
host_name | The client host name. |
host_id | The client host ID. |
Output example
----------- ------------------------------------
ID bcfee527-d61e-4a5d-9ba9-ab57210f2e13
Name test-host1
Group ID f9865678-f149-49b5-8f3d-a8010424c50f
Description
----------- ------------------------------------
Host Initiator Info
Identifier Ips Enable Chap Chap Name Chap Secret
-------------------------------------------------------------------- ----- ------------- ----------- -------------
iqn.1994-05.com.redhat:858c488e9b7 False
nqn.2014-08.org.nvmexpress:uuid:26755e30-4e9b-4b1e-bd32-79eff062f7d1 False
Associated Targets
Target ID
------------------------------------
beda75cd-8b44-4baf-b6b5-726414ee3a2d
Associated Luns
Parent Target ID Lun ID
------------------------------------ --------
beda75cd-8b44-4baf-b6b5-726414ee3a2d 1
Associated Subsystems
Subsystem ID
------------------------------------
79d6d69a-42b5-47bb-87a3-5d2d1b2b1e6e
Associated Namespaces
Parent Subsystem ID NS ID
------------------------------------ -------
79d6d69a-42b5-47bb-87a3-5d2d1b2b1e6e 1Output note
Client host basic information
| Parameter | Description |
|---|---|
ID | The client host ID. |
Name | The client host name. |
Group ID | Its client host group ID. |
Description | The client host description. |
Initiator information
| Parameter | Description |
|---|---|
Identifier | The initiator identifier: IQN or NQN. |
Ips | The initiator IP address. |
Enable Chap | Whether to enable CHAP authentication. |
Chap Name | The CHAP name. |
Chap Secret | The CHAP password. |
Associated storage resource information
Associated iSCSI target information
| Parameter | Description |
|---|---|
Target ID | The target ID. |
Associated iSCSI LUN information
| Parameter | Description |
|---|---|
Parent Target ID | The ID of the target to which the LUN belongs. |
Lun ID | The LUN ID. |
Associated NVMe subsystem information
| Parameter | Description |
|---|---|
Subsystem ID | The subsystem ID. |
Associated NVMe namespace information
| Parameter | Description |
|---|---|
Parent Subsystem ID | The ID of the subsystem to which the namespace belongs. |
NS ID | The namespace ID. |
Procedure
Run the following command on any node in the cluster to create a client host and set its name, description, client host group, and initiator information:
zbs-meta host create <host_name> [--desc DESC] [--group_name GROUP_NAME] [--initiators INITIATORS]| Parameter | Description |
|---|---|
host_name | The client host name. |
--desc <DESC> | The client host description. |
--group_name GROUP_NAME | Specifies the name of its client host group. |
--initiators INITIATORS | The initiator information. The specified content must be enclosed in double quotation marks ( ""). Within the quotation marks: Separate multiple initiators by forward slashes (/). Separate multiple elements within a single initiator by semicolons (;). Separate multiple IP addresses by commas (,). The format of a single initiator is: identifier;ips;enable_chap;chap_name;chap_secret. Examples: iqn;ip1,ip2;True;name;secretnqn;ip1;;;;ip1,ip2;;;iqn;ip1;True;name;secret/iqn;;;;/nqn;;;; |
Output example
----------- ------------------------------------
ID 9c312691-0be9-443c-8033-8aa6a60bf712
Name h4
Group ID
Description
----------- ------------------------------------Procedure
Run the following command on any node in the cluster to update the client host. This is a full update command, and all parameters must be specified:
zbs-meta host update <host_name> <new_host_name> <desc> <group_name> <initiators>| Parameter | Description |
|---|---|
host_name | The name of the client host. |
new_host_name | Renames the client host. |
desc | Updates the client host description. |
group_name | Updates its client host group. |
initiators | Updates the initiator information. The specified content must be enclosed in double quotation marks ( ""). Within the quotation marks: Separate multiple initiators by forward slashes (/). Separate multiple elements within a single initiator by semicolons (;). Separate multiple IP addresses by commas (,). The format of a single initiator is: identifier;ips;enable_chap;chap_name;chap_secret. Examples: iqn;ip1,ip2;True;name;secretnqn;ip1;;;;ip1,ip2;;;iqn;ip1;True;name;secret/iqn;;;;/nqn;;;; |
Output example
----------- ------------------------------------
ID ee104b5f-74b1-4600-98d6-645dbb91f77b
Name h3
Group ID
Description new desc
----------- ------------------------------------Procedure
Run the following command on any node of the cluster to batch move client hosts into the client host group. All client hosts must not belong to any client host group before the move.
zbs-meta host batch_add_hosts_to_group <group_name> <host_ids>| Parameter | Description |
|---|---|
group_name | Specifies the client host group to which the client hosts will be moved. |
host_ids | Specifies the IDs of the client hosts. Multiple IDs must be separated by commas (,). |
Output example
ID Name Group ID Description
------------------------------------ ------ ------------------------------------ -------------
2dd38a55-f64d-4916-8f51-1fce4cbe844e h1 9fc99f41-c08a-4a3a-9739-a8ee9e22e57b
e3283316-90c6-4d16-a540-50bccce5e109 h2 9fc99f41-c08a-4a3a-9739-a8ee9e22e57bOutput note
| Parameter | Description |
|---|---|
ID | The client host ID. |
Name | The client host name. |
Group ID | Its client host group ID. |
Description | The client host description. |
Procedure
Run the following command on any node of the cluster to batch move client hosts out of the client host group. All client hosts must belong to the same client host group before the move.
zbs-meta host batch_remove_hosts_from_group <group_name> <host_ids>| Parameter | Description |
|---|---|
group_name | Specifies the client host group to which the client hosts belong. |
host_ids | Specifies the IDs of the client hosts. Multiple IDs must be separated by commas (,). |
Output example
ID Name Group ID Description
------------------------------------ ------ ---------- -------------
2dd38a55-f64d-4916-8f51-1fce4cbe844e h1
e3283316-90c6-4d16-a540-50bccce5e109 h2Output note
| Parameter | Description |
|---|---|
ID | The client host ID. |
Name | The client host name. |
Group ID | Its client host group ID. |
Description | The client host description. |
Procedure
Run the following command on any node in the cluster to delete the client host:
Delete by client host name:
zbs-meta host delete <host_name>
Delete by client host ID:
zbs-meta host delete_by_id <host_id>
| Parameter | Description |
|---|---|
host_name | The name of the client host. |
host_id | The ID of the client host. |
Output note
If the command succeeds, no output is displayed.
Procedure
Run the following command on any node in the cluster to delete client hosts in a batch:
zbs-meta host batch_delete_by_id <host_ids>| Parameter | Description |
|---|---|
host_ids | Specifies the IDs of the client hosts. Multiple IDs must be separated by commas (,). |
Output note
If the command succeeds, no output is displayed.