Skip to content

novytel/lio-csp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIO CSP — Container Storage Provider for HPE CSI Driver

A lightweight HPE CSI Driver Container Storage Provider (CSP) backed by Linux LIO target with LVM thin provisioning. Turns any Linux machine with QLogic FC HBAs into a Kubernetes-managed block storage array.

Features

  • FC target export via tcm_qla2xxx and rtslib-fb
  • LVM thin provisioning — instant snapshots, space-efficient
  • HPE CSI Driver compatible — implements the full CSP REST API
  • Volume lifecycle — create, expand, delete, publish/unpublish, snapshot
  • Automatic LUN mapping — discovers online FC target ports, creates ACLs per initiator WWPN
  • Persistent configtargetcli saveconfig after every state change

Architecture

┌─────────────────────────────────────┐
│  HPE CSI Driver (K8s)               │
│  controller + node plugin           │
└──────────────┬──────────────────────┘
               │ REST API (:8080)
┌──────────────▼──────────────────────┐
│  LIO CSP (this project)             │
│  Falcon + gunicorn                  │
│  ┌─────────┐  ┌──────────────────┐  │
│  │ handlers │  │ backend          │  │
│  │ (REST)   │→ │ (LVM + rtslib)  │  │
│  └─────────┘  └──────────────────┘  │
└──────────────┬──────────────────────┘
               │
    ┌──────────┴──────────┐
    │ LIO kernel target   │
    │ tcm_qla2xxx (FC)    │
    │ LVM thin pool       │
    └─────────────────────┘

Quick Start

Prerequisites

  • Linux with QLogic ISP2432+ FC HBAs
  • qla2xxx in dual or target mode
  • targetcli-fb, python3-rtslib-fb
  • LVM volume group with thin pool

Install

# System packages
zypper in -y targetcli-fb python3-rtslib-fb

# LVM thin pool (example: 2x NVMe)
pvcreate /dev/nvme0n1 /dev/nvme1n1
vgcreate lio-vg /dev/nvme0n1 /dev/nvme1n1
lvcreate -T lio-vg/tp0 -l 95%VG

# Application
mkdir -p /opt/lio-csp /var/lib/lio-csp
python3 -m venv --system-site-packages /opt/lio-csp/venv
/opt/lio-csp/venv/bin/pip install -r requirements.txt
cp -r liocsp/ /opt/lio-csp/

# Systemd
cp lio-csp.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now lio-csp

Kubernetes (HPE CSI Driver)

See deploy/ for example manifests:

  • lio-csp.yaml — in-cluster deployment (privileged pod on storage node)
  • lio-csp-external.yaml — external service pointing to bare-metal host
  • test-pvc.yaml — test PVC and pod

API Endpoints

Method Path Description
POST /containers/v1/tokens Authenticate
DELETE /containers/v1/tokens/{id} Logout
POST /containers/v1/hosts Register initiator
DELETE /containers/v1/hosts/{id} Remove initiator
POST /containers/v1/volumes Create volume
GET /containers/v1/volumes List volumes
GET /containers/v1/volumes/{id} Get volume
PUT /containers/v1/volumes/{id} Update volume
DELETE /containers/v1/volumes/{id} Delete volume
PUT /containers/v1/volumes/{id}/actions/publish Export to initiator
PUT /containers/v1/volumes/{id}/actions/unpublish Remove export
POST /containers/v1/snapshots Create snapshot
GET /containers/v1/snapshots List snapshots
DELETE /containers/v1/snapshots/{id} Delete snapshot

Configuration

Environment Variable Default Description
LIO_VG_NAME lio-vg LVM volume group
LIO_TP_NAME tp0 LVM thin pool
LIO_STATE_FILE /var/lib/lio-csp/state.json Metadata state file
LOG_DEBUG (unset) Enable debug logging

License

Apache-2.0

About

LIO Container Storage Provider for HPE CSI Driver — FC/iSCSI block storage with LVM thin provisioning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors