Iscsi Cake 18 Install (2024)
The Ultimate Guide to iSCSI Cake 18 Install: Step-by-Step Setup for High-Performance Storage
Creating the Storage Backend (The "Cake Sponge")
The "Cake" layer needs a sponge to absorb writes. Let's create a logical volume.
# Create a physical volume (if using a spare disk /dev/sdb)
sudo pvcreate /dev/sdb
# Create a volume group named 'iscsi-vg'
sudo vgcreate iscsi-vg /dev/sdb
# Create a logical volume named 'cake-lun'
sudo lvcreate -L 50G -n cake-lun iscsi-vg
Now launch the targetcli shell:
sudo targetcli
Inside targetcli, run these commands:
/> backstores/block create cake_disk /dev/iscsi-vg/cake-lun
/> cd /iscsi
/iscsi> create iqn.2024.com.example:cake18target
/iscsi> set global auto_add_default_portal=false
/iscsi> cd iqn.2024.com.example:cake18target/tpg1/
/iscsi/iqn...tpg1> luns create /backstores/block/cake_disk
/iscsi/iqn...tpg1> portals create 192.168.100.10 3260
/iscsi/iqn...tpg1> set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1
/iscsi/iqn...tpg1> saveconfig
/iscsi/iqn...tpg1> exit
Explanation of "Cake" attributes:
generate_node_acls=1: Allows any initiator to connect (use ACLs in production).demo_mode_write_protect=0: Enables writes.cache_dynamic_acls=1: Boosts performance for small I/O.
Step 8 — Save and Exit
/> saveconfig
/> exit
Part 2: Installing iSCSI Target on CakeOS 18
The keyword iscsi cake 18 install primarily refers to setting up the target side. We’ll use targetcli, the standard Linux userspace tool for managing iSCSI targets. iscsi cake 18 install
Step 11 — Make Persistent (Client Side)
sudo iscsiadm -m node --op=update --name node.startup --value automatic
2. Key Features in iSCSI Cake 1.8
Version 1.8 is a mature build that focuses on stability and caching. Here are the primary features:
- Virtual Disk Creation:
The core feature allows you to take a large file (such as an
.imgor a folder) and mount it as a physical hard drive on the server. - iSCSI Target Support: The software turns your Windows machine into an iSCSI Target (Server). Other devices (Initiators) can connect to this server over the local network (LAN) and see the shared disk as if it were a local hard drive attached to their own motherboard.
- Smart Cache (Memory Caching):
This is the defining feature of iSCSI Cake. It uses the server's RAM to cache frequently accessed data.
- Read Cache: Speeds up boot times for diskless clients by storing the OS image in RAM.
- Write Cache: Temporarily holds write commands in RAM before writing them to the physical disk, significantly improving write performance and reducing wear on SSDs/HDDs.
- Multi-User Support: It allows multiple clients (Initiators) to connect to the same image simultaneously. It handles the locking mechanisms required so that multiple computers don't corrupt the data when trying to write at the same time.
- Snapshot / Recovery Mode: Often used in internet cafes, this feature allows clients to write changes to a temporary file. When the client restarts, the changes are discarded, and the disk reverts to its original "clean" state (similar to "Deep Freeze" but over iSCSI).
- IP Access Control: You can configure which IP addresses are allowed to connect to the iSCSI target for basic security.
4.1 CHAP Authentication (Two-Way)
On target, enable mutual CHAP:
targetcli
/iscsi/iqn.2024-05.cakeos18:storage.target1/tpg1 set attribute authentication=1
/iscsi/iqn.2024-05.cakeos18:storage.target1/tpg1 set attribute generate_node_acls=0
/iscsi/iqn.2024-05.cakeos18:storage.target1/tpg1/acls/iqn.1994-05.com.redhat:client1 set auth userid=targetuser
/iscsi/iqn.2024-05.cakeos18:storage.target1/tpg1/acls/iqn.1994-05.com.redhat:client1 set auth password=targetpass
Then on initiator, configure /etc/iscsi/iscsid.conf:
node.session.auth.authmethod = CHAP
node.session.auth.username = targetuser
node.session.auth.password = targetpass
10. Troubleshooting checklist
- Connectivity: tcpdump -i eth0 port 3260
- Discovery fails: check firewall, target service, correct portal IP.
- Login fails with CHAP errors: verify IQNs and credentials match.
- Device not seen: rescan SCSI bus: echo "- - -" > /sys/class/scsi_host/host0/scan
- Performance issues: check multipath config, network saturation, queue_depth and ALUA settings.