Configuring CLI tool

Before you can use the vstorage-target CLI tool to export volumes via iSCSI, set it up, as described below. Perform these steps on each node where you plan to run iSCSI targets.

  1. Create a configuration file /etc/vstorage/iscsi/config.json with at least these mandatory parameters:

      "ClusterName": "cluster1",
      "VolumesRoot": "/vols/iscsi/vols",

    Where ClusterName is the name of your storage cluster and VolumesRoot is the path to the directory for iSCSI volumes.

    You can also set these optional parameters:

    • "PcsLogLevel": the log level, ranges from 1 (log errors only) to 7 (log all, including debug messages).
    • "LogPath": the path to log files, the default is /var/log/vstorage (the log will be saved to vstorage-target.log).
    • "GetTimeout": the timeout for the initiator’s command to read target port group status, the default is 3000 ms.
  2. Enable the target monitor service:

    # systemctl start vstorage-target-monitor.service
    # systemctl enable vstorage-target-monitor.service
  3. Create the iSCSI volume directory if it does not exist:

    # mkdir -p /mnt/vstorage/vols/iscsi/

If you modify the configuration file later, restart the TCM monitor service to apply changes:

# systemctl restart vstorage-target-monitor.service