6.5. Managing Nodes¶
This section describes how to manage nodes in relation to target groups.
6.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
and 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
}
]
}
]
6.5.2. Setting Node Status¶
To enable or disable a node in a specific target group or all target groups at once, use the vstorage-target node-set
command. Enabling a node starts its targets while disabling a node stops its targets and moves the PREFERRED
bit to another node.
For example, to enable a node with the ID bbfd0e7a26b1406d
in all target groups it belongs to, run
# vstorage-target node-set -tg any -node bbfd0e7a26b1406d -enable
To disable a node with the ID bbfd0e7a26b1406d
in the target group with the ID 3d8364f5-b830-4211-85af-3a19d30ebac4
, allowing 60 seconds to move the preferred path to another node (i.e. target), run
# vstorage-target node-set -tg 3d8364f5-b830-4211-85af-3a19d30ebac4 -node bbfd0e7a26b1406d \
-disable -release-timeout 60
The release-timeout
parameter sets time in seconds that the initiator has to move the preferred (Active/Optimized) path following the PREFERRED
bit. If the initiator fails to do so within the given time, the disable operation is cancelled and the node remains enabled. The PREFERRED
bit, however, is still moved to another node.
The -force
parameter stops the target(s) on the node at once without moving the PREFERRED
bit.
6.5.3. Deleting Nodes from Target Groups¶
To delete a node from a target group, use the vstorage-target node-del
command. You can delete nodes only after disabling them in specified target groups. Deleting a node also deletes the targets on that node. For example:
# 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
. The node is already disabled in the target group (see Setting Node Status).