7.5. Managing Nodes in Target Groups

This section describes how to manage nodes in relation to target groups.

7.5.1. Adding Nodes to Target Groups

To add a node to a target group, create a configuration file with details about target WWN and portal. The target will be created automatically on the added node. One node can be added to multiple target groups, and the same network interfaces on it can be used simultaneously by multiple targets from different groups.

For example:

# vstorage-target node-add -node bbfd0e7a26b1406d -tg 3d8364f5-b830-4211-85af-3a19d30ebac4 \
-targets target.json

This command adds the node with the ID bbfd0e7a26b1406d to the target group with the ID 3d8364f5-b830-4211-85af-3a19d30ebac4. It also creates a target on it according to the target.json configuration file that looks as follows:

[
  {
    "NodeId": "bbfd0e7a26b1406d",
    "WWN": "iqn.2013-10.com.vstorage:test2",
    "Portals": [
      {
        "Addr": "10.94.104.89",
        "Port": 3260
      }
    ]
  }
]

7.5.2. Listing Nodes in Target Groups

You can list all nodes in all target groups and their detailed information using the vstorage-target node-list command. For example:

# vstorage-target node-list
[
  {
    "ID": "bbfd0e7a26b1406d",
    "Status": "STABLE",
    "Enabled": true,
    "MonitorOnline": true,
    "Version": "7.10.32",
    "Address": "10.94.104.89:40135",
    "ActiveVolumes": [
      "0937f0e3-91a9-4dfc-8c10-6202bdc792c8"
    ]
  },
]

7.5.3. Enabling and Disabling Nodes in Target Groups

To enable or disable a node in all target groups it belongs to, use the vstorage-target node-set command. Enabling a node starts its targets, while disabling a node stops its targets and moves the active path to another node. These operations are also performed when the node exits and enters maintenance, respectively.

For example, to enable a node with the ID bbfd0e7a26b1406d, run

# vstorage-target node-set -node bbfd0e7a26b1406d -enable

Before disabling a node, make sure there are other STABLE nodes where the Active/Optimized path can be moved. Otherwise, an I/O error will occur.

To disable a node with the ID bbfd0e7a26b1406d, run

# vstorage-target node-set -node bbfd0e7a26b1406d -disable

You can check the node status with the vstorage-target node-list command, see Listing Nodes in Target Groups.

7.5.4. Deleting Nodes from Target Groups

To delete a node from a target group, use the vstorage-target node-del command. You can only delete a node if it is not on the Active/Optimized path. Otherwise, you need to move the A/O path to another node either by disabling the node (see Enabling and Disabling Nodes in Target Groups) or manually (see Setting the Active/Optimized Path for iSCSI Volumes).

# vstorage-target node-del -tg 3d8364f5-b830-4211-85af-3a19d30ebac4 -node bbfd0e7a26b1406d

This command deletes the node with the ID bbfd0e7a26b1406d from the target group with the ID 3d8364f5-b830-4211-85af-3a19d30ebac4.