fix(terraform): align VM config with real Proxmox state
This commit is contained in:
@@ -56,11 +56,27 @@ terraform output -json kubeconfig | jq -r '.homelab' > ~/.kube/config
|
|||||||
terraform output -json talosconfig | jq -r '.homelab' > ~/.talos/config
|
terraform output -json talosconfig | jq -r '.homelab' > ~/.talos/config
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Talos Factory Image
|
||||||
|
|
||||||
|
The ISO is built via [Talos Image Factory](https://factory.talos.dev) with a custom schematic that includes:
|
||||||
|
- **QEMU guest agent** (`qemu-guest-agent` system extension)
|
||||||
|
- **i915** Intel iGPU firmware extension
|
||||||
|
|
||||||
|
**Schematic ID:** `aa948be975ffec096205160edd988ee6d949d72c20a39ca5844fc0a2a3fc8415`
|
||||||
|
|
||||||
|
**Installer reference:** `factory.talos.dev/metal-installer/aa948be975ffec096205160edd988ee6d949d72c20a39ca5844fc0a2a3fc8415:v1.12.5`
|
||||||
|
|
||||||
|
Download URL pattern:
|
||||||
|
```
|
||||||
|
https://factory.talos.dev/image/<schematic-id>/<version>/metal-amd64.iso
|
||||||
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- The Talos ISO resource has `prevent_destroy = true` to avoid accidental re-download
|
- The Talos ISO resource has `prevent_destroy = true` to avoid accidental re-download
|
||||||
- Control plane node has `allowSchedulingOnControlPlanes = true` (single-node cluster)
|
- Control plane node has `allowSchedulingOnControlPlanes = true` (single-node cluster)
|
||||||
- State files (`terraform.tfstate`, `terraform.tfstate.backup`, `terraform.tfvars`, `talosconfig`) are gitignored
|
- State files (`terraform.tfstate`, `terraform.tfstate.backup`, `terraform.tfvars`, `talosconfig`) are gitignored
|
||||||
|
- `gpu_mapping` is optional per cluster; omit it to skip PCI passthrough
|
||||||
|
|
||||||
## Next Steps
|
## Next Steps
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ resource "proxmox_virtual_environment_download_file" "talos_iso" {
|
|||||||
content_type = "iso"
|
content_type = "iso"
|
||||||
datastore_id = "local"
|
datastore_id = "local"
|
||||||
node_name = "pve"
|
node_name = "pve"
|
||||||
url = "https://github.com/siderolabs/talos/releases/download/v1.12.3/metal-amd64.iso"
|
# Factory image with QEMU guest agent + i915 (Intel iGPU) extensions
|
||||||
file_name = "talos-v1.12.3-metal-amd64.iso"
|
# Schematic: aa948be975ffec096205160edd988ee6d949d72c20a39ca5844fc0a2a3fc8415
|
||||||
|
url = "https://factory.talos.dev/image/aa948be975ffec096205160edd988ee6d949d72c20a39ca5844fc0a2a3fc8415/v1.12.5/metal-amd64.iso"
|
||||||
|
file_name = "talos-v1.12.5-factory-metal-amd64.iso"
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
prevent_destroy = true
|
prevent_destroy = true
|
||||||
@@ -16,8 +18,10 @@ resource "proxmox_virtual_environment_vm" "talos-vm" {
|
|||||||
name = "talos-${each.key}-node0"
|
name = "talos-${each.key}-node0"
|
||||||
tags = ["terraform", "talos", each.key]
|
tags = ["terraform", "talos", each.key]
|
||||||
node_name = "pve"
|
node_name = "pve"
|
||||||
|
on_boot = true
|
||||||
|
|
||||||
bios = "ovmf"
|
bios = "ovmf"
|
||||||
|
machine = "i440fx"
|
||||||
boot_order = ["scsi0", "ide3"]
|
boot_order = ["scsi0", "ide3"]
|
||||||
|
|
||||||
cpu {
|
cpu {
|
||||||
@@ -28,8 +32,14 @@ resource "proxmox_virtual_environment_vm" "talos-vm" {
|
|||||||
dedicated = each.value.memory
|
dedicated = each.value.memory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
agent {
|
||||||
|
enabled = true
|
||||||
|
type = "virtio"
|
||||||
|
}
|
||||||
|
|
||||||
network_device {
|
network_device {
|
||||||
mac_address = each.value.mac_address
|
mac_address = each.value.mac_address
|
||||||
|
firewall = false
|
||||||
}
|
}
|
||||||
|
|
||||||
cdrom {
|
cdrom {
|
||||||
@@ -41,10 +51,27 @@ resource "proxmox_virtual_environment_vm" "talos-vm" {
|
|||||||
interface = "scsi0"
|
interface = "scsi0"
|
||||||
size = each.value.disk_size_gb
|
size = each.value.disk_size_gb
|
||||||
datastore_id = each.value.datastore_id
|
datastore_id = each.value.datastore_id
|
||||||
|
aio = "io_uring"
|
||||||
|
cache = "none"
|
||||||
|
discard = "on"
|
||||||
|
ssd = true
|
||||||
}
|
}
|
||||||
|
|
||||||
efi_disk {
|
efi_disk {
|
||||||
datastore_id = each.value.datastore_id
|
datastore_id = each.value.datastore_id
|
||||||
|
pre_enrolled_keys = false
|
||||||
|
}
|
||||||
|
|
||||||
|
dynamic "hostpci" {
|
||||||
|
for_each = each.value.gpu_mapping != null ? [each.value.gpu_mapping] : []
|
||||||
|
content {
|
||||||
|
device = "hostpci0"
|
||||||
|
mapping = hostpci.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
serial_device {
|
||||||
|
device = "socket"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,6 @@ variable "clusters" {
|
|||||||
mac_address = string
|
mac_address = string
|
||||||
ip_address = string
|
ip_address = string
|
||||||
datastore_id = string
|
datastore_id = string
|
||||||
|
gpu_mapping = optional(string)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user