All Projects → DavidButterfield → SCST-Usermode-Adaptation

DavidButterfield / SCST-Usermode-Adaptation

Licence: other
Adaptation of iSCSI-SCST and DRBD software to run entirely in usermode

Programming Languages

c
50402 projects - #5 most used programming language
perl
6916 projects
HTML
75241 projects
Makefile
30231 projects
shell
77523 projects
Roff
2310 projects

Projects that are alternatives of or similar to SCST-Usermode-Adaptation

scst
No description or website provided.
Stars: ✭ 61 (+177.27%)
Mutual labels:  iscsi, scsi
IPoverFC
IP over ATA over FC (Cheap Ethernet over SCSI)
Stars: ✭ 37 (+68.18%)
Mutual labels:  scsi, scst
moneta
Moneta is a live usermode memory analysis tool for Windows with the capability to detect malware IOCs
Stars: ✭ 384 (+1645.45%)
Mutual labels:  usermode
ToolBin
All the great tools we have for the field.
Stars: ✭ 91 (+313.64%)
Mutual labels:  scsi
Middleware
TrueNAS CORE/Enterprise/SCALE Middleware Git Repository
Stars: ✭ 1,851 (+8313.64%)
Mutual labels:  iscsi
vmSafeguard
vmSafeguard is a management, planning, backup system for a Vmware ESXi(s) solution, orchestrated through a Web Admin Panel. RTFM for more info. Under develop since Jun 2020
Stars: ✭ 20 (-9.09%)
Mutual labels:  iscsi
freenas-proxmox
ZFS over iSCSI to FreeNAS API's from Proxmox VE
Stars: ✭ 129 (+486.36%)
Mutual labels:  iscsi
freenas-iscsi-provisioner
FreeNAS iscsi provisioner
Stars: ✭ 30 (+36.36%)
Mutual labels:  iscsi
target-isns
Target-isns is an iSNS client for the Linux LIO iSCSI target
Stars: ✭ 15 (-31.82%)
Mutual labels:  iscsi
sasutils
Serial Attached SCSI (SAS) Linux utilities and Python library
Stars: ✭ 36 (+63.64%)
Mutual labels:  scsi
stenc
SCSI Tape Encryption Manager - stenc (formerly on https://sourceforge.net/projects/stenc/)
Stars: ✭ 41 (+86.36%)
Mutual labels:  scsi
Apex-Legends-SDK
Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified source engine as well as their Easy Anti Cheat Implementation.
Stars: ✭ 101 (+359.09%)
Mutual labels:  usermode
Poseidon
stealthy UM <-> KM communication system without creating any system threads, permanent hooks, driver objects, section objects or device objects.
Stars: ✭ 189 (+759.09%)
Mutual labels:  usermode

SCST-Usermode-Adaptation

SCST iSCSI Storage Server Usermode Adaptation
An adaptation of the iSCSI-SCST storage server software to run entirely in usermode on an unmodified Linux kernel
David A. Butterfield

This project adapts the SCST iSCSI storage server software, which normally resides in the Linux kernel, to run entirely in usermode on an unmodified kernel. The resulting executable can run as a regular (non-super) user, as long as it has permission to access the backing storage. A paper describing the work and performance study is here.

The left side of the diagram below shows the original "in-kernel" configuration alongside the adapted "usermode" configuration.

Additional work done since that report implements an "scst_tcmur" interface module allowing SCST_Usermode to access backing storage using the same interface used by the LIO tcmu-runner facility. Through this backstore handler interface, SCST_Usermode can utilize backing storage implemented by any of Ceph/RBD, QEMU/qcow, Gluster/glfs, or Intel/SPDK.

The right side of the diagram below shows the Linux kernel-resident LIO implementation alongside the SCST_Usermode implemention, both sharing a common set of tcmu-runner backstore handlers.


SCST Usermode Adaptation and tcmu-runner backend driver


Branches:

  • scst_base - unmodified source from SCST repository that the two branches below are based on
  • SCST_fixes - generic changes to SCST source (for both usermode and kernel-resident builds) [included in usermode]
  • usermode - SCST Usermode supports tcmu-runner backstore handlers as well as local files and block devices

Old Branch:

  • master - the original work described by the paper, supporting local files and block devices for backstore

The adaptation uses about 80,000 lines of the SCST source code, a subset supporting the iSCSI transport type (via socket calls), and SCSI Block Commands (vdisk_fileio) backed by either a file or a block device.

The SCST iSCSI Usermode Adaptation depends on

  • Usermode Compatibility (UMC) — a shim for running some Linux kernel code in usermode
  • Multithreaded Engine (MTE) — a high-performance multi-threaded event dispatching engine for usermode
  • SCST files in the master branch of this repo began as a snapshot of https://sourceforge.net/projects/scst /scst and /iscsi-scst svn -r7105.
  • To support usermode, about 300 lines of changes were made to the SCST snapshot files (mostly under #ifdef)
  • Additional changes: AIO, optimizations for usermode (under #ifdef), and some fixes and XXX comments for SCST
  • A little more work would be required to run on architectures other than x86
  • Possibly less work would be needed to run on non-Linux POSIX systems having gcc and the libraries
  • It shouldn't matter much, but I have only tested with these:
    • Linux 3.13.0-101-generic #148-Ubuntu SMP x86_64
    • Linux 4.4.0-70-generic #91-Ubuntu SMP x86_64 GNU/Linux
    • Linux 4.8.0-46-generic #49-Ubuntu SMP x86_64 GNU/Linux

Hints to help get started running iSCSI-SCST in usermode
(This is rather terse; some existing familiarity with SCST will be helpful)

  # apt install libaio-dev              # required
  # apt install libfuse-dev             # required
  # apt install subversion              # or github accessor of your choice
  # apt install cscope                  # (optional with makefile edit)
  # apt install exuberant-ctags         # (optional with makefile edit)
  # apt install valgrind                # (optional)

  $ mkdir Usermode_SCST ; cd Usermode_SCST   # or use whatever name you want for this one
  $ svn co https://github.com/DavidButterfield/MTE.git MTE   # Makefile expects these names
  $ svn co https://github.com/DavidButterfield/usermode_compat.git UMC
  $ svn co https://github.com/DavidButterfield/SCST-Usermode-Adaptation.git SCST

  $ more SCST/trunk/usermode/BUGS.txt   # ** MORE HINTS **

  $ pushd MTE/trunk/src                 # build the Multithreaded Engine library
  $ make
  $ sudo make install                   # needs permission for /lib, /usr/include
  $ popd

  $ cd SCST/trunk
  $ sudo make scstadm_install           # patched to know where /fuse/scst/proc is
  $ make enable_proc                    # configure so it can compile for usermode

  $ cd usermode
  $ make                                # build the SCST iSCSI server binary
  $ ls -l scst.out                      # in SCST/trunk/usermode/

  ### Manually create /etc/{iscsi-scst,scst_usermode}.conf in SCST /proc format (See *.sample)

  # mkdir -p  /var/lib/scst/vdev_mode_pages /var/lib/scst/pr
  # chmod 777 /var/lib/scst/vdev_mode_pages /var/lib/scst/pr   # or writable by SCST's UID

  # mkdir -p /fuse/scst/proc ; chmod 777 /fuse/scst/proc       # mount point for SCST's /proc
  ### Edit /etc/fuse.conf and uncomment the line with "user_allow_other"

  $ [ gdb | valgrind ] ./scst.out -f    # run as normal user, with or without accessories

In another terminal window

  # scstadmin -config /etc/scst_usermode.conf
  # ls -l `find /fuse -type f`

Diagrams showing the relationship between UMC, MTE, and Usermode SCST


SCST usermode service map


SCST usermode header and library inclusions


Diagram showing the datapath of SCST configured with iSCSI and vdisk_fileio (either usermode or kernel-resident)


SCST datapath


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].