Newer
Older
openstack-caracal-dc-dc / opentofu / modules / node-vm / variables.tf
variable "vm_name" {
  description = "Domain name, e.g. \"dc1-compute-01\"."
  type        = string
}

variable "memory_mib" {
  description = "Memory in MiB. Sizing is a Phase-0 host/disk-budget decision (buildout-design Section 3) -- no default, pass explicitly."
  type        = number
}

variable "vcpu" {
  description = "Virtual CPU count. No default -- pass explicitly, per the measured Phase-0 CPU budget."
  type        = number
}

variable "pool_name" {
  description = "libvirt_pool name this VM's disk lives in (output of modules/dc-storage-pool)."
  type        = string
}

variable "disk_size_bytes" {
  description = "Blank boot-disk size in bytes. No default -- pass explicitly."
  type        = number
}

variable "network_names" {
  description = <<-EOT
    Ordered list of libvirt_network names (outputs of modules/dc-planes) this
    VM attaches to. Order matters for boot priority -- the FIRST entry is
    given PXE boot priority (see main.tf's boot-order note; MAAS-managed
    node VMs PXE-boot per D-103, they are not given a pre-built OS image).
  EOT
  type        = list(string)
}

variable "autostart" {
  description = "Start this domain automatically when the libvirt host boots (D-127 boot matrix). MANUAL (false) for DC containment + node VMs; true for foundational service VMs + edges. Set explicitly per instance in the root -- do not rely on the default."
  type        = bool
  default     = false
}

variable "serial_log_dir" {
  description = <<-EOT
    Directory ON THE LIBVIRT HOST for this node's serial boot log.

    PARAMETERIZED, not hardcoded: modules/opnsense-edge bakes
    "/var/lib/libvirt/vr1/staging" into its serial path, which is a vcloud-only
    literal and silently wrong on any other libvirt host -- under D-123 Model B
    the node VMs live inside vvr1-dc0, a different host entirely. (Backporting
    this parameterization to opnsense-edge is a queued finding.)

    The directory MUST exist and be writable by libvirt on that host, or the
    domain fails to START with "Unable to open file: ... No such file or
    directory" -- measured on the dc0 edge, 2026-07-20.
  EOT
  type        = string
  default     = "/var/lib/libvirt/vr1/staging"
}