sylve_zfs_volume (Resource)
A ZFS volume (zvol) managed through Sylve, e.g. for a VM’s storage_type = “zvol” disk. Unlike sylve_zfs_filesystem, Sylve’s create API has no parent-field bug here – see the provider’s dev notes for the contrast.
Example Usage
resource "sylve_zfs_volume" "example" {
name = "my-vol" # leaf name -> full path "tank/my-vol"
parent = "tank"
properties = {
size = "10737418240" # 10GiB -- REQUIRED inside properties; no separate structured size field exists
}
# Optional: write the contents of a sylve_download (e.g. a cloud
# image) directly onto this volume once it's created -- the actual
# mechanism for a cloud-image-backed VM disk, see sylve_vm_storage.
# flash_from_download_uuid = sylve_download.example.uuid
}
Schema
Required
name(String) Leaf volume name, e.g. “my-vol” for parent “tank” -> full path “tank/my-vol”. Immutable (no rename endpoint); changing it recreates the resource.parent(String) Full path of the parent dataset/pool, e.g. “tank”. Immutable.properties(Map of String) ZFS properties to set. MUST include “size” as a human-readable string (e.g. {size = “10G”}) – Sylve has no separate structured size field, and rejects a create with no size property in this map at all. Write-only: not read back (same reasoning as sylve_zfs_filesystem’s own properties), and changes are applied via Update (PATCH), not recreation.
Optional
flash_from_download_uuid(String) UUID of a sylve_download (typically a cloud image, automatic_raw_conversion = true) to write onto this volume immediately after it’s created – the actual mechanism for turning a downloaded cloud image into VM-attachable disk contents; see sylve_vm_storage for attaching the result to a VM. Write-only and create-time only: changing it recreates the volume rather than re-flashing a volume that might already be attached to a running VM.
Read-Only
id(String) Terraform resource identity – the volume’s ZFS GUID.pool(String) Pool the volume lives on, as reported by Sylve (derived from parent).