Skip to main content

iSCSI initiator

v0.1.6

Inspect the host's iSCSI initiator (open-iscsi): active sessions, per-session detail (targets, connections, negotiated parameters), configured target nodes, and initiator interfaces. Read-only.

4 allowed by default
Pack ID
iscsi
Vendor
emisar
OS
linux
Actions
4
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
iscsiadm

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install iscsi --hash sha256:2a7249c1497d8e154257f76c42e9e0efeb34c079fe9da07c3e89c0d56ed2c3e8

Setup

Reads the local host's iSCSI initiator state via iscsiadm — no credentials needed. iscsiadm needs root (it reads /sys and the initiator DB).

Host access

Run these commands yourself on the runner host. Emisar shows and copies setup recipes; it never runs them.

Read iSCSI netlink, sysfs, and the initiator database as root.

iscsi.sessionsiscsi.session_detailiscsi.nodesiscsi.ifaces

Run the Emisar service as root

Grant access
sudo install -d -m 0755 /etc/systemd/system/emisar.service.d
printf '%s\n' '[Service]' 'User=root' 'Group=root' | sudo tee /etc/systemd/system/emisar.service.d/10-iscsi-host-access.conf >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart emisar
Verify access
test "$(systemctl show emisar --property=User --value)" = root

Impact: Every Emisar action on this runner executes as root, including actions from other installed packs. iscsiadm receives full initiator and device authority.

Notes

  • Running as root applies to every action on that host, not just these; on a dedicated storage host that's expected, and the cloud policy + approval gates still govern what runs.

Verify it works

Runs iscsi.sessions, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify iscsi

Install and configure a pack walks through the whole sequence on a host.

Actions 4 total

View on GitHub
  • iscsi.ifaces exec low Low — read-only or trivially reversible

    iscsiadm -m iface

    List initiator interfaces (the iface bindings sessions run over).

    View source on GitHub
  • iscsi.nodes exec low Low — read-only or trivially reversible

    iscsiadm -m node

    List configured / discovered target nodes in the initiator database.

    View source on GitHub
  • iscsi.session_detail exec low Low — read-only or trivially reversible

    iscsiadm -m session -P 3

    Show full per-session detail at print level 3 — target IQN, portal, session and connection state, negotiated parameters, and the attached SCSI disks.

    View source on GitHub
  • iscsi.sessions exec low Low — read-only or trivially reversible

    iscsiadm -m session

    List active iSCSI sessions — one line per session (transport, target IQN, sid). Returns nothing and succeeds when there are no active sessions (iscsiadm exits 21 in that case, which is treated as success, not failure).

    View source on GitHub