Skip to content

masscollaborationlabs/sltv

 
 

Repository files navigation

SLTV - Shared Logical Thin Volume

SLTV is a storage controller for libvirt/QEMU-KVM hypervisors. It manages LVM logical volumes and exposes them to virtual machines as raw block disks, with support for both thick and thin provisioning.

The headline features are:

  • Single host or multi-host operation. Multiple hypervisors can share one Volume Group on FC/iSCSI LUNs and coordinate metadata operations through an ETCD-backed distributed lock.
  • Thin provisioning with automatic extend driven by QEMU block usage metrics. When a thin LV approaches its physical size the daemon grows it by a configurable percentage and notifies the guest via virDomainBlockResize, all without VM downtime.
  • A clean separation between the daemon (sltvd) and the CLI (sctl) via a strongly-typed gRPC API.

Components

Binary Role
sltvd The daemon. Runs as a systemd service on each hypervisor host.
sctl The CLI. Talks to sltvd over gRPC (Unix socket by default).

Build and install

Requirements: Go 1.25+, lvm2, qemu-utils, libvirt-clients, make for the convenience targets.

make build
sudo install -m 0755 bin/sltvd /usr/local/sbin/sltvd
sudo install -m 0755 bin/sctl  /usr/local/bin/sctl
sudo install -D -m 0644 deploy/examples/sltvd.yaml /etc/sltv/sltvd.yaml
sudo install -D -m 0644 deploy/systemd/sltvd.service /etc/systemd/system/sltvd.service
sudo systemctl daemon-reload
sudo systemctl enable --now sltvd
sctl status

A multi-stage Docker image is also provided at deploy/docker/Dockerfile; see deploy/docker/README.md.

CLI cheat sheet

# Thick provisioned 50 GiB disk in the configured default VG
sctl create-disk web01-data --size 50G

# Thin provisioned, 100 GiB virtual, starts at 10 GiB on the LV
sctl create-disk db01-data --thin-prov --virtual-size 100G

# Attach / detach
sctl attach-disk web01-data web01            # picks vdb, vdc, ...
sctl attach-disk web01-data web01 --target vde
sctl detach-disk web01-data web01

# Manual extend
sctl extend-disk db01-data --delta +10G
sctl extend-disk db01-data --size 20G

# Inspect
sctl list-disks
sctl list-attachments
sctl status --cluster

sctl accepts --addr unix:///run/sltv/sltvd.sock (default) or a TCP address with --tls-cert/--tls-key/--tls-ca for clustered TLS deployments. All commands honour --json.

Documentation

Repository layout

api/proto/v1/        gRPC service definition
cmd/sltvd/           daemon entry point
cmd/sctl/            CLI entry point
internal/
  config/            YAML + env config loader
  cluster/           ETCD client, locks, membership
  disk/              disk lifecycle (thick + thin)
  libvirtx/          libvirt/virsh wrapper + fake
  lvm/               lvm2 wrapper + fake
  server/            gRPC service implementation
  store/             memory / bolt / etcd backends
  thin/              auto-extend control loop
  version/           build metadata
pkg/sltvclient/      reusable Go client
deploy/              systemd unit, sample config, Docker image
docs/                user and developer documentation
test/e2e/vagrant/    Vagrant + iSCSI + ETCD multi-host test bed

Tests

go test ./...           # unit tests
make test-cover         # with coverage
SLTV_TEST_ETCD=http://127.0.0.1:2379 go test ./internal/cluster/...   # integration

License

MIT License

Copyright (c) 2026 SLTV authors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 93.6%
  • Shell 3.9%
  • Makefile 1.5%
  • Dockerfile 1.0%