iSCSI (Internet Small Computer System Interface) is a protocol for transmitting SCSI commands over a network, allowing storage devices to communicate over a network, similar to directly connected storage. It can virtualize storage resources, achieve centralized management, network sharing, and remote access, and is suitable for scenarios such as data centers, virtualized environments, and backup and recovery.
Through this tutorial, you will learn how to configure and use iSCSI in ZimaOS to improve storage management efficiency, simplify network storage architecture, and achieve flexible data access methods.
Prerequisites
- The hard disk used is not in use
- Confirm the client’s IQN
Operation steps
Server
Make sure your ZimaOS has been upgraded to 1.2.5 or above.
- Use the command
sudo -i
to enter superuser mode,Start targetclitargetcli
- Create a LUN, assuming
/dev/sde
is used as the storage backend(Here we use sde. You can use thelsblk
to view the device status and change tosda
orsdb
..):cd backstores/block
create myblockdev /dev/sde
- Create an iSCSI target (
iqn.2024-10.com.zima:target1
is an example)cd /iscsi
create iqn.2024-10.com.zima:target1
- Add a LUN to the target
cd iqn.2024-10.com.zima:target1/tpg1/luns
create /backstores/block/myblockdev
- Set the ACL (access control list) to allow the connection. The IQN here needs to be consistent with the client(Open iSCSI Initiator, it is in the Configuration tab)
cd ../acls
create iqn.1993-08.org.debian:01:bb1e6772dfb6
Client
Windows
Open iSCSI Initiator, in the Discovery tab, click Discover Portal
Configure the IP address, click OK
In the Targets tab, click Connect
Open Computer Management, click Storage > Disk Management, and you can see the newly connected iSCSI volume
Linux
- Discover iSCSI targets
iscsiadm -m discovery -t sendtargets -p <IP_ADDRESS>
Replace <IP_ADDRESS>
with the IP address of the server
- Log in to the iSCSI target
iscsiadm -m node --login