Managing iSCSI targets with targetcli
The
targetcli
command is a shell to view, edit, save, and load the iSCSI target configuration. When you look at the configuration, you will see that targetcli
provides a hierarchical structure in a similar way to a filesystem.
To invoke the targetcli
shell, we will run this command as root using sudo
. You will see that on the first run of the command, a preferences file is created. This is illustrated in the following screenshot:
As you can see in the preceding output, you can enter help
to display a list of commands that can be entered. To view the available configuration objects, we can use the ls
command. The output is shown in the following screenshot:
We will work with backstores
objects to start with so that we can add it to the LVM block device in the configuration in addition to the fileio
backstore. As the name suggests, this will be a file within the filesystem; we can share this to a network as a virtual disk.
Creating storage backstores
We will...