kcore SAN (Ceph)
kcore SAN ships with kcore. A CephCluster builds the cluster, RBD images hold VM disks, and VMs move between hosts, live or cold, without copying disks.
kcore supports local storage backends (filesystem, LVM, ZFS) where VM disks live on the host running the VM. kcore SAN adds shared block storage on Ceph. VM disks are replicated across hosts, a host failure does not lose a disk, and a VM can move or restart on another host.
What you get
- Shared block storage across cluster nodes.
- Ceph OSDs on dedicated data disks, managed by a declarative
CephClusterresource. - RBD (RADOS Block Device) images are the VM disks.
- Data is replicated across hosts. The default pool keeps three copies and accepts writes with two.
How it integrates
- Phase 1 (shipped): day-2
CephClusterYAML applied withkctl apply— controller reconciler configures NixOSservices.ceph, bootstraps MON/MGR/OSD (includingceph-volumeon the OSD disk), and tracks cluster health. OSDs are not created via node install--storage-backend. - Phase 2 (shipped): RBD pool and
--storage-backend cephfor VMs; volumes are cluster-scoped and map on any member node; cold drain moves VMs without copying disks. - Shipped: dedicated Ceph cluster/replication network (e.g. 10Gb fabric) separate from the public/client path.
- Live migration (shipped): Cloud Hypervisor live migration on shared RBD (
kctl migrate vm). See VM migration.
Safe by default
- Fence before failover. When a host dies, the controller blocklists its clients on the image through a healthy Ceph member before any other host starts the VM. A host that comes back cannot write to an image that moved. See High availability for VMs.
- Encrypted OSDs.
encryptOsdsdefaults to true and cannot change after create. It protects a pulled disk. It does not protect against a compromised monitor or host. Per-volume encryption (--encrypt) formats LUKS2 on the host over the mapped image. - Members leave one at a time. Removing a node from
spec.nodesis refused unless the survivors number at least the replica count, the cluster isHEALTH_OK, and no earlier removal is running. The controller drains the host’s OSDs and waits for every placement group to beactive+cleanbefore it purges anything. - No stranded VMs. Deleting a
CephClusteris refused while a Ceph VM still lives on one of its members, and the error names them. - Snapshots and policies.
kctl snapshot volume, clones, restore, resize (grow only), andkctl create snapshot-policy. For a backup that survives the cluster, use kcore Vault.
Live migration needs TCP 18000–18127 open between members. Keep Ceph replication off a congested management NIC and give it a fabric of its own.
Moving VMs (cold and live)
Because the disk is an RBD image in pool kcore-vms, changing hosts does not copy guest blocks. Choose the mode that matches your downtime budget:
There is no migrate or drain YAML kind. Declaring a VM (or CephCluster) does not move a running guest. Live migrate and cold drain are operations: use kctl below, the dashboard, or MCP kcore_operation. Full runbook: VM migration.
Provider 0.8.3 has no migrate or drain resource. Those stay kctl commands (or the dashboard / MCP). See VM migration.
- Live:
kctl migrate vm <id> --target-node <node>— memory streams over TCP; both nodes map the same image during cutover. - Cold:
kctl drain node <node>— control plane reassigns VMs; Nix stop on source / start on destination. - Fallback:
kctl migrate vm … --allow-cold-fallbacktries live, then cold for that VM.
kctl migrate vm app-1 --target-node node-b
kctl migrate vm app-1 --target-node node-b --allow-cold-fallback
kctl drain node node-a
kctl drain node node-a --target-node node-b
Operator runbook: VM migration. Architecture and RPC flow: docs/vm-migration.md · Ceph integration: docs/ceph.md.
Target use cases
- HA VM storage — survive single-node failure without data loss.
- Live migration — VMs can move between nodes without copying disks (
kctl migrate vm). - Multi-node data redundancy — configurable replication factor (e.g. 2 or 3 copies).
- Shared image cache — VM base images stored once in Ceph, cloned instantly.
How it complements local backends
Local backends (filesystem, LVM, ZFS) remain the right choice for single-node, performance-sensitive workloads where raw I/O throughput matters most. kcore SAN is designed for workloads that prioritise availability over raw I/O performance.
Operators choose per-VM: a database that needs low-latency local NVMe stays on LVM, while an application server uses Ceph-backed storage for easy failover.
Relationship to existing storage classes
kcore SAN appears as a new storage class (ceph) alongside the existing filesystem, lvm, and zfs classes:
$ kctl get storage-class
NAME NODES
filesystem 3
lvm 2
zfs 1
ceph 3
Nodes that are members of a healthy CephCluster are listed under the ceph storage class. Creating a VM on Ceph storage:
kctl create vm app-1 \
--storage-backend ceph \
--storage-size-bytes 107374182400 \
--image <https-url> \
--image-sha256 <sha256>
Example CephCluster manifest (Phase 1)
kind: CephCluster
metadata:
name: lab-san
spec:
publicNetwork: "10.10.0.0/24"
clusterNetwork: "10.20.0.0/24"
replication:
size: 3
minSize: 2
nodes:
- nodeId: dell-1
monAddr: "10.10.0.11:6789"
clusterAddr: "10.20.0.11"
publicIface: eth1
clusterIface: eth2
osdDevice: /dev/nvme0n1
Showing Terraform examples. Provider source is kcorehypervisor/kcore, version 0.8.3.
kcore_vm storage_backend is filesystem, lvm, or zfs. Put a VM on Ceph with kctl create vm --storage-backend ceph or a VM manifest. A Ceph data disk is kcore_volume with storage_class ceph, and kcore_ceph_cluster creates the cluster.
resource "kcore_ceph_cluster" "lab_san" {
name = "lab-san"
public_network = "10.10.0.0/24"
cluster_network = "10.20.0.0/24"
size = 3
min_size = 2
node {
node_id = "dell-1"
mon_addr = "10.10.0.11:6789"
cluster_addr = "10.20.0.11"
public_iface = "eth1"
cluster_iface = "eth2"
osd_device = "/dev/nvme0n1"
}
}
resource "kcore_volume" "app" {
name = "app-data"
size_bytes = 107374182400
storage_class = "ceph"
}
resource "kcore_shared_filesystem" "home" {
name = "home"
ceph_cluster = kcore_ceph_cluster.lab_san.name
fs_name = "home"
client {
name = "web"
paths = ["/"]
}
}
resource "kcore_object_store" "s3" {
name = "s3"
ceph_cluster = kcore_ceph_cluster.lab_san.name
port = 7480
}
resource "kcore_object_user" "app" {
name = "app"
store = kcore_object_store.s3.name
}
Day-2 lifecycle
After the CephCluster is healthy, drain members one at a time, put a host in maintenance, rotate keys, and finish OSD release upgrades through kctl.
- Member removal. Dropping a node from
spec.nodesneedsHEALTH_OK, survivors at least the replica count, and no other drain in flight. The controller drains OSDs and waits foractive+cleanbefore purge. - Maintenance. Set
nooutwhile a host is down for planned work so placement groups do not rebalance away. - Keys. Rotate client keys and mon/dmcrypt material through the lifecycle commands. Typed health reports what is wrong.
- Cluster updates. A host ClusterUpdate gates on Ceph (
ok-to-stop,noout, mons first). After the OSD release bump, runkctl ceph finalize-osd-release --yes.
CSI for Kubernetes
A KubernetesCluster on the same CephCluster can mount RBD and CephFS through Ceph CSI. The controller pins quay.io/cephcsi/cephcsi:v3.13.1. VolumeSnapshot CRDs ship with the Kubernetes cluster; use them once the CSI snapshotter is up.
Some CSI and lifecycle paths are implemented and documented here; exercise them in a lab before production.