falcon-nest/literal/terraform.org
2026-06-21 01:36:08 -05:00

1.9 KiB

Terraform Plan for Crows Nest ISO

Prompt

Please create a Terraform plan that will allow me to provision a new virtual machine on Proxmox using the telmate Proxmox provider. This virtual machine should have 4 CPU cores, 8GB of RAM, and 64 GB of disk space. Please give it an ID of 105, set full_clone to be true, and set the node's name to roxie. Also, turn on automatic reboot of the virtual machine. Leave the following information blank so that I can fill it in later: the URL of the Proxmox instance, the user name, and the token from Proxmox. Call the VM "crows-nest"

Result (from Claude Sonnet 4)

terraform {
  required_providers {
    proxmox = {
      source = "telmate/proxmox"
      version = "3.0.2-rc01"
    }
  }
}

provider "proxmox" {
  pm_api_url = "https://pve.home.onionpatch.cloud:8006/api2/json"
  pm_user = "terraform-prov@pve"
  pm_password = "8pKkz^@C%gOYbegcGQ"
}
# General
resource "proxmox_vm_qemu" "nixos-template" {
  name = "nixos-template"
  desc = "NixOS Template"
  agent = 1
  target_node = "roxie"
  vmid = 0
  vm_state = "stopped"
  onboot = false
  automatic_reboot = false

  # Bios and OS
  bios = "seabios"
  qemu_os = "l26"
  tags = "nixos,server,linux"
  hotplug = 0

  # CPU and Memory
  cpu {
    cores = 1
    sockets = 1
    type = "host"
  }
  memory = 2048
  balloon = 2048

  # Disks
  scsihw = "virtio-scsi-single"

  disks {
    ide {
      ide2 {
        cdrom {
          iso = "local:iso/nixos-minimal-26.05.1947.a0374025a863-x86_64-linux.iso"
        }
      }
    }
    scsi {
      scsi0 {
        disk {
          size = "40G"
          iothread = true
          replicate = false
          storage = "local-lvm"
        }
      }
    }
  }

  # Network
  network {
    id = 0
    model = "virtio"
    bridge = "vmbr0"
  }

}