7.2. Configuring CLI Tool

Before you can use the vstorage-target CLI tool to export volumes via iSCSI, set it up as described further. 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", log level, ranges from 1 (log errors only) to 7 (log all, including debug messages).
  • "LogPath", 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.
  1. Enable the target monitor service:

    # systemctl start vstorage-target-monitor.service
    # systemctl enable vstorage-target-monitor.service
    
  2. 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