sylve_vm_power (Resource)
Manages whether a sylve_vm is running or stopped. This is real, drift-detected state (via the live libvirt domain status), not a one-shot action like sylve_vm_snapshot_rollback – starting/stopping the VM outside Terraform shows up as a plan diff. Separate from sylve_vm itself so that creating a VM doesn’t implicitly start it (or vice versa), and so a VM’s boot state can be toggled without touching its own configuration.
Example Usage
# Real, drift-detected state -- if someone starts/stops the VM outside
# Terraform, the next plan shows it as a diff, same as any other
# attribute. Separate from sylve_vm itself so creating a VM doesn't
# implicitly start it.
resource "sylve_vm_power" "example" {
rid = sylve_vm.example.rid
state = "running" # or "stopped"
}
Schema
Required
rid(Number) RID of the sylve_vm to manage the power state of. Immutable.state(String) “running” or “stopped”. Not validated client-side; an invalid value is rejected server-side. Applying blocks (up to 2 minutes) until the VM actually reaches the requested domain status – catches a VM that’s stuck (e.g. paused waiting for a VNC connection, see sylve_vm’s vnc_wait) as a clear error instead of Terraform silently believing the change succeeded.
Read-Only
id(String) Terraform resource identity – the VM’s RID as a string.