terraform-libvirt/stack/volumes.tf

26 lines
955 B
HCL

# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/volume.html.markdown
# -------- root disk use by compute --------
# ~> Tip: when provisioning multiple domains using the same base image, create a libvirt_volume for the base image and then define
# the domain specific ones as based on it. This way the image will not be modified and no extra disk space is going to be used for the base image.
resource "libvirt_volume" "my_root_centos" {
name = "my-root-centos"
base_volume_name = "centos7.qcow2"
# base_volume_id = libvirt_volume.centos7_qcow2.id
}
resource "libvirt_volume" "my_root_debian" {
name = "my-root-debian"
base_volume_name = "debian-buster.qcow2"
# base_volume_id = libvirt_volume.debian_buster_qcow2.id
}
resource "libvirt_volume" "external_disk_1" {
name = "external-disk-1"
# 10Gb
size = 10737418240
pool = "pool_1"
# pool = libvirt_pool.pool_1.name
}