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.
Create a configuration file
/etc/vstorage/iscsi/config.jsonwith at least these mandatory parameters:{ "ClusterName": "cluster1", "VolumesRoot": "/vols/iscsi/vols", }Where
ClusterNameis the name of your storage cluster andVolumesRootis 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 tovstorage-target.log)."GetTimeout", the timeout for the initiator’s command to read target port group status, the default is 3000 ms.
Enable the target monitor service:
# systemctl start vstorage-target-monitor.service # systemctl enable vstorage-target-monitor.service
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
Jul 21, 2020