-
Notifications
You must be signed in to change notification settings - Fork 496
Description
Does anyone successfully use LVM as a storage device for their virtual machines?
`locals {
disk_sizes = {
"30GB" = 32212254720 # 30 * 1024^3
}
provider "libvirt" {
alias = "kvm3"
uri = "qemu+sshcmd://[email protected]/system"
}
resource "libvirt_pool" "st0_pool_kvm3" {
provider = libvirt.kvm3
name = "st0-storage"
type = "logical"
source = {
name = "st0"
}
target = {
path = "/dev/st0"
}
}
resource "libvirt_volume" "alpine_base_empty" {
provider = libvirt.kvm3
name = "alpine-3.22-base"
pool = libvirt_pool.st0_pool_kvm3.name
capacity = local.disk_sizes["30GB"]
}`
# lvs -a st0
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
alpine-3.22-base st0 swi-a-s--- 4.00m [alpine-3.22-base_vorigin] 0.00
[alpine-3.22-base_vorigin] st0 ori-a-s--- 30.00g
Is it possible to avoid using thin provisioning methods with LVM storage - not creating base images, snapshots. Use raw LVM instead, then perform necessary operations through Terraform null_resource?