vinfra node iscsi target add

If you have restricted outbound traffic in your cluster, you need to manually add a rule that will allow outbound traffic on the port used by the added iSCSI device, as described in Restricting outbound traffic from cluster nodes.

Add an iSCSI target as a disk to a node:

usage: vinfra node iscsi target add [--auth-username <auth-username>]
                                    [--auth-password <auth-password>]
                                    --portal <portal> --node <node> <target-name>
--auth-username <auth-username>
User name
--auth-password <auth-password>
User password
--portal <portal>
Portal IP address in the format IP:port (this option can be specified multiple times)
--node <node>
Node ID or hostname
<target-name>
Target name

Example:

# vinfra node iscsi target add iqn.2014-06.com.vstorage:target1 \
--portal 172.16.24.244:3260 --node f1931be7-0a01-4977-bfef-51a392adcd94
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | c42bfbe5-7292-41c2-91cb-446795535ab9 |
+---------+--------------------------------------+

This command creates a task to connect a remote iSCSI target iqn.2014-06.com.vstorage:target1 with the IP address 172.16.24.244 and port 3260 to the node with the ID f1931be7-0a01-4977-bfef-51a392adcd94.

Task outcome:

# vinfra task show c42bfbe5-7292-41c2-91cb-446795535ab9
+---------+---------------------------------------------------------------+
| Field   | Value                                                         |
+---------+---------------------------------------------------------------+
| args    | - f1931be7-0a01-4977-bfef-51a392adcd94                        |
| kwargs  | portals:                                                      |
|         | - address: 172.16.24.244                                      |
|         |   port: 3260                                                  |
|         | target_name: iqn.2014-06.com.vstorage:target1                 |
| name    | backend.presentation.nodes.iscsi_initiators.tasks.ConnectTask |
| result  | connected: true                                               |
|         | portals:                                                      |
|         | - address: 172.16.24.244                                      |
|         |   port: 3260                                                  |
|         | state: connected                                              |
|         | target_name: iqn.2014-06.com.vstorage:target1                 |
| state   | success                                                       |
| task_id | c42bfbe5-7292-41c2-91cb-446795535ab9                          |
+---------+---------------------------------------------------------------+