diff --git a/control-plane/main.tf b/control-plane/main.tf index f497566..1d38f95 100644 --- a/control-plane/main.tf +++ b/control-plane/main.tf @@ -48,4 +48,50 @@ resource "libvirt_network" "talos_bridge" { xml { xslt = file("control-plane-net.xsl") } +} + +# Download the ISO +resource "libvirt_volume" "talos_iso" { + name = "talos-metal-arm64.iso" + pool = "images" + source = "https://factory.talos.dev/image/4a0d65c669d46663f377e7161e50cfd570c401f26fd9e7bda34a0216b6f1922b/v1.11.1/metal-arm64.iso" + format = "raw" +} + +# Create disk for VM +resource "libvirt_volume" "control_plane_disk" { + name = "control-plane-node-1-disk.qcow2" + pool = "images" + base_volume_id = libvirt_volume.talos_iso.id + size = 42949672960 # 40GB in bytes + format = "qcow2" +} + +# Create the VM +resource "libvirt_domain" "control_plane_node_1" { + name = "control-plane-node-1" + memory = 2048 + vcpu = 2 + + disk { + volume_id = libvirt_volume.control_plane_disk.id + } + + disk { + file = libvirt_volume.talos_iso.id + } + + network_interface { + network_name = "my-talos-net" + } + + graphics { + type = "none" + } + + boot_device { + dev = ["hd", "cdrom"] + } + + autostart = true } \ No newline at end of file