Managing targets
Prerequisites
- A target group is created, as described in Creating target groups.
To add a target to a target group
Admin panel
- Open Storage services > Block storage > Target groups, click the name of the desired target group to open it.
- On the Targets tab, click Add target. The Create target wizard will open.
- On the Nodes step, select nodes where new iSCSI targets will run.
-
On the Targets step, specify target names and 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. Note the following:
- 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.
- Though you can create multiple targets on a node, the optimal way is to have one target per node.
- On Summary, review the target details. You can go back to change them if necessary. Click Add.
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
- Open Storage services > Block storage > Target groups.
- 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
- Open Storage services > Block storage > Target groups, click the name of the desired target group to open it.
- On the Targets tab, click the ellipsis button of the desired target, and then click Delete.
- If the target has active connections, select Force.
- 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