freebox_virtual_machine (Resource)

Manages a virtual machine instance within a Freebox. See the Freebox blog for additional details

Example

resource "freebox_virtual_machine" "example" {
  name       = "vm"
  vcpus      = 1
  memory     = 300
  disk_path  = "Freebox/VMs/debian.qcow2"
  disk_type  = "qcow2"
  os         = "ubuntu"
  timeouts  = {
    kill       = "15s"
    networking = "30s"
  }
}

output "ipv4" {
  value = one(resource.freebox_virtual_machine.example.networking[*].ipv4)
}

Schema

Required

  • disk_path (String) Path to the hard disk image of this VM
  • disk_type (String) Type of disk image
  • memory (Number) Memory allocated to this VM in megabytes
  • name (String) Name of this VM
  • vcpus (Number) Number of virtual CPUs to allocate to this VM

Optional

  • bind_usb_ports (List of String) List of ports that should be bound to this VM. Only one VM can use USB at given time, whether is uses only one or all USB ports. The list of system USB ports is available in VmSystemInfo. For example: usb-external-type-a, usb-external-type-c
  • cd_path (String) Path to CDROM device ISO image
  • cloudinit_hostname (String) When cloudinit is enabled, hostname desired for this VM.
  • cloudinit_userdata (String) When cloudinit is enabled, raw YAML to be passed in the user-data file.
  • enable_cloudinit (Boolean) Whether or not to enable passing data through cloudinit. This uses the NoCloud iso image method; it will add a virtual CDROM drive (distinct from the one passed by cd_path) with the data in cloudinit_userdata and cloudinit_hostname when enabled
  • enable_screen (Boolean) Whether or not this VM should have a virtual screen, to use with the VNC websocket protocol
  • os (String) Type of OS used for this VM. Only used to set an icon for now
  • status (String) VM status
  • timeouts (Attributes) Timeouts for various operations expressed as strings such as 30s or 2h45m where valid time units are s (seconds), m (minutes) and h (hours) (see below for nested schema)

Read-Only

  • id (Number) Unique identifier of the VM
  • mac (String) VM ethernet interface MAC address
  • networking (Attributes Set) Network binds of the virtual machine (see below for nested schema)

Nested Schema for timeouts

Optional:

  • create (String) Timeout for resource creation (default: "5m")
  • delete (String) Timeout for resource deletion (default: "5m")
  • kill (String) Duration to wait for a graceful shutdown before force killing the virtual machine (default: "30s")
  • networking (String) Duration to wait for the virtual machine to appear on the network (default: "1m")
  • read (String) Timeout for resource refreshing (default: "5m")
  • update (String) Timeout for resource updating (default: "5m")

Nested Schema for networking

Read-Only:

  • interface (String) Name of the network interface the virtual machine is bound to
  • ipv4 (String) Unique IPV4 address on the network interface
  • ipv6 (Set of String) List of IPV6 addresses on the network interface

Import

# ------------------------------------------------ 👇 is the ID of the virtual machine
terraform import "freebox_virtual_machine.example" 42