using zfs for guest templates

storage pool

disk=/dev/sdb
disk=/dev/vdb

    zpool create \
    -o listsnapshots=on \
    smith $disk
zfs unmount /smith
zfs set canmount=off smith
zfs set mountpoint=none smith

    zfs create -s -V 5GB smith/debiantpl
ls -lF /dev/zvol/smith/debiantpl

single host VMM

mkfs.ext4 /dev/zvol/smith/debiantpl
mkdir -p /data/guests/debiantpl/lala/
cd /data/guests/debiantpl/
mount /dev/zvol/smith/debiantpl lala/

see guest-debian

(debootstrap...)

freeze the template e.g. as of nov 2025

zfs snapshot smith/debiantpl@nov25

for the purpose of making read-write snapshots (clones) out of it

zfs clone smith/debiantpl@nov25 smith/guest1
ls -lF /dev/zvol/smith/guest1

zfs clone smith/debiantpl@nov25 smith/guest2
ls -lF /dev/zvol/smith/guest2

VMM cluster

same as above but

# all nodes
drbdadm create-md debiantpl

# one node only
drbdadm new-current-uuid --clear-bitmap debiantpl

# all nodes
drbdadm up -v debiantpl

# one node only
mkfs.ext4 /dev/drbd1
    mkdir -p /data/guests/debiantpl/lala/
    cd /data/guests/debiantpl/
    mount /dev/drbd1 lala/

then

    # all nodes (no need to create-md)
    drbdadm up -v guest1

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Licensed under MIT