freebox_virtual_machine_power (Resource)
Manages the power state of a Freebox virtual machine independently from its configuration. Use this resource on freebox_virtual_machine to start a VM only after other resources (such as freebox_dhcp_static_lease) have been applied in the same Terraform run.
Example
resource "freebox_virtual_machine" "example" {
name = "example-vm"
vcpus = 1
memory = 2048
disk_path = "/Freebox/VMs/ubuntu.qcow2"
disk_type = "qcow2"
status = "stopped"
}
resource "freebox_dhcp_static_lease" "example" {
mac = freebox_virtual_machine.example.mac
ip = "192.168.1.32"
hostname = "example-vm"
depends_on = [freebox_virtual_machine.example]
}
resource "freebox_virtual_machine_power" "example" {
vm_id = freebox_virtual_machine.example.id
power_state = "running"
timeouts = {
kill = "30s"
}
depends_on = [freebox_dhcp_static_lease.example]
}
Schema
Required
power_state(String) Desired power state of the virtual machinevm_id(Number) Identifier of the virtual machine
Optional
timeouts(Attributes) Timeouts for power operations (see below for nested schema)
Read-Only
id(String) Identifier of the power management resource (same asvm_id)
Nested Schema for timeouts
Optional:
kill(String) Duration to wait for a graceful shutdown before force killing the virtual machine (default:"30s")
Import
terraform import "freebox_virtual_machine_power.example" 42