Managing targets

Prerequisites

To add a target to a target group

Admin panel

  1. Open Storage services > Block storage > Target groups, click the name of the desired target group to open it.

  2. On the Targets tab, click Add target. The Create target wizard will open.
  3. On Nodes, select nodes to add to the target group. On these nodes, iSCSI targets will run. You can only choose nodes with network interfaces that are assigned the iSCSI traffic type. It is recommended to have at least two nodes in the target group to achieve high availability. If you plan to use multiple iSCSI initiators, you should have as many nodes in the target group. The optimal way is to create a single target per node.

    If the node network interfaces are not configured, click the cogwheel icon, select the networks as required, and then click Apply.

  4. On Targets, select iSCSI interfaces to add to the target group. You can choose from a list of network interfaces that are assigned the iSCSI traffic type. If you plan to use multiple iSCSI initiators, you should select as many interfaces per node. One interface can be added to multiple target groups, although it may reduce performance.

  5. On Summary, review the target details. You can go back to change them if necessary. Click Next.

The created target will appear on the Targets tab.

Command-line interface

Use the following command:

vinfra service block-storage target-group target create --node <node> --ip <ip> <target-group> <name>
--node <node>
Node ID or hostname
--ip <ip>
Target IP address
<target-group>
Target group name or ID
<name>
Target name

For example, to add the target target3 to the target group tg1 that will run on the node node003 with the IP address 10.10.10.13, run:

# vinfra service block-storage target-group target create --node node003 --ip 10.10.10.13 tg1 target3

The added target will appear in the vinfra service block-storage target-group target list output:

# vinfra service block-storage target-group target list tg1
+------------------+----------------------------------+---------+-----------------------+
| node_id          | iqn                              | state   | portals               |
+------------------+----------------------------------+---------+-----------------------+
| 7a8f9a2f-fd11<…> | iqn.2014-06.com.vstorage:target1 | offline | - ipaddr: 10.10.10.11 |
|                  |                                  |         |   port: 3260          |
| a32ba24a-2473<…> | iqn.2014-06.com.vstorage:target2 | offline | - ipaddr: 10.10.10.12 |
|                  |                                  |         |   port: 3260          |
| 2cef3925-51dc<…> | iqn.2014-06.com.vstorage:target3 | offline | - ipaddr: 10.10.10.13 |
|                  |                                  |         |   port: 3260          |
+------------------+----------------------------------+---------+-----------------------+

To start or stop all targets in a target group

Admin panel

  1. Open Storage services > Block storage > Target groups.
  2. Click the ellipsis icon of the desired target group, and then click Start targets or Stop targets.

Command-line interface

Use the following commands:

  • To start all targets in your target group:

    vinfra service block-storage target-group start <target-group>
  • To stop all targets in your target group:

    vinfra service block-storage target-group stop <target-group>

To delete a target from a target group

Admin panel

  1. Open Storage services > Block storage > Target groups, click the name of the desired target group to open it.

  2. On the Targets tab, click the ellipsis button of the desired target, and then click Delete.
  3. If the target has active connections, select Force.
  4. Click Delete in the confirmation window.

If you delete a target on the Active/Optimized path (indicated in LUN details), said path will switch to another target.

Command-line interface

Use the following command:

vinfra service block-storage target-group target delete [--force] <target-group> <target>
--force
Forcibly remove a target
<target-group>
Target group name or ID
<target>
Target IQN

For example, to remove the target with the IQN iqn.2014-06.com.vstorage:target3 from the target group tg1, run:

# vinfra service block-storage target-group target delete tg1 iqn.2014-06.com.vstorage:target3