sites: Inventar und Zielbild an echte Knoten (pve44–pve61) angepasst; ADR-0001/0002/0006 ergänzt
ci / test (push) Successful in 25s
ci / test (push) Successful in 25s
Aufbauplan Task 0.4: - inventory.yaml: pve44/46/48/52/61 und GODE-PC-05/06 (Ada, Windows, cpu_roles: false) - proxmox.yaml: eine GPU-VM pro Knoten mit allen Karten (D2), local-lvm/tank (D1 B), 192.168.100.0/24 ohne VLAN, Gast-IPs .220–.239 (ANNAHME bis Task 0.2) - registry.yaml/prometheus.yml: ops-Labels auf gpu-pve44/46/48, Ada ohne pve_node/vmid - tofu: dynamische hostpci, Speicher je Gast; Ansible: pve_gpu_hosts/pve_kiosk, Replikation auf mehrere Ziele - Placement: cpu_roles=false schließt Arbeitsplätze/Kiosk von CPU-Rollen aus - PLAN §1.3/§1.4/§9 und ADR-Nachträge (D1 entschieden, D2/D3 Bestätigung offen) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,12 +41,12 @@ resource "proxmox_virtual_environment_vm" "gpu" {
|
||||
}
|
||||
|
||||
efi_disk {
|
||||
datastore_id = local.site.cluster.storage_vm
|
||||
datastore_id = try(each.value.storage, local.site.cluster.storage_default)
|
||||
type = "4m"
|
||||
}
|
||||
|
||||
disk {
|
||||
datastore_id = local.site.cluster.storage_vm
|
||||
datastore_id = try(each.value.storage, local.site.cluster.storage_default)
|
||||
interface = "scsi0"
|
||||
size = each.value.disk_gb
|
||||
discard = "on"
|
||||
@@ -55,7 +55,7 @@ resource "proxmox_virtual_environment_vm" "gpu" {
|
||||
|
||||
# Modelle: eigenes Disk-Image, nicht repliziert, nicht gesichert (ADR-0002)
|
||||
disk {
|
||||
datastore_id = local.site.cluster.storage_vm
|
||||
datastore_id = try(each.value.storage, local.site.cluster.storage_default)
|
||||
interface = "scsi1"
|
||||
size = each.value.models_disk_gb
|
||||
discard = "on"
|
||||
@@ -64,20 +64,24 @@ resource "proxmox_virtual_environment_vm" "gpu" {
|
||||
replicate = false
|
||||
}
|
||||
|
||||
hostpci {
|
||||
device = "hostpci0"
|
||||
mapping = proxmox_virtual_environment_hardware_mapping_pci.gpu[each.value.gpu].name
|
||||
pcie = true
|
||||
rombar = true
|
||||
# Alle Karten des Knotens in eine VM (D2); Reihenfolge = Index in der VM
|
||||
dynamic "hostpci" {
|
||||
for_each = each.value.gpus
|
||||
content {
|
||||
device = "hostpci${hostpci.key}"
|
||||
mapping = proxmox_virtual_environment_hardware_mapping_pci.gpu[hostpci.value].name
|
||||
pcie = true
|
||||
rombar = true
|
||||
}
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = local.site.cluster.bridge
|
||||
vlan_id = local.site.cluster.vlan_svc
|
||||
vlan_id = local.site.cluster.vlan_svc # null = flaches Netz
|
||||
}
|
||||
|
||||
initialization {
|
||||
datastore_id = local.site.cluster.storage_vm
|
||||
datastore_id = try(each.value.storage, local.site.cluster.storage_default)
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = each.value.ip
|
||||
@@ -94,16 +98,16 @@ resource "proxmox_virtual_environment_vm" "gpu" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_container" "infra" {
|
||||
resource "proxmox_virtual_environment_container" "lxc" {
|
||||
for_each = local.site.containers
|
||||
node_name = each.value.node
|
||||
vm_id = each.value.vmid
|
||||
tags = ["knaster", "infra"]
|
||||
tags = ["knaster", each.key]
|
||||
unprivileged = true
|
||||
start_on_boot = true
|
||||
|
||||
features {
|
||||
nesting = true # Docker im LXC
|
||||
nesting = try(each.value.nesting, true) # Docker im LXC
|
||||
}
|
||||
|
||||
cpu {
|
||||
@@ -115,12 +119,12 @@ resource "proxmox_virtual_environment_container" "infra" {
|
||||
}
|
||||
|
||||
disk {
|
||||
datastore_id = local.site.cluster.storage_vm
|
||||
datastore_id = try(each.value.storage, local.site.cluster.storage_default)
|
||||
size = each.value.disk_gb
|
||||
}
|
||||
|
||||
operating_system {
|
||||
template_file_id = "${local.site.cluster.storage_iso}:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst"
|
||||
template_file_id = local.site.cluster.lxc_template
|
||||
type = "debian"
|
||||
}
|
||||
|
||||
@@ -132,6 +136,9 @@ resource "proxmox_virtual_environment_container" "infra" {
|
||||
|
||||
initialization {
|
||||
hostname = each.key
|
||||
dns {
|
||||
servers = [local.site.cluster.dns]
|
||||
}
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = each.value.ip
|
||||
@@ -149,5 +156,5 @@ resource "proxmox_virtual_environment_haresource" "infra" {
|
||||
resource_id = "ct:${each.value.vmid}"
|
||||
state = "started"
|
||||
comment = "knaster ${each.key}"
|
||||
depends_on = [proxmox_virtual_environment_container.infra]
|
||||
depends_on = [proxmox_virtual_environment_container.lxc]
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ output "gpu_vms" {
|
||||
value = { for k, v in proxmox_virtual_environment_vm.gpu : k => { node = v.node_name, vmid = v.vm_id } }
|
||||
}
|
||||
|
||||
output "infra_containers" {
|
||||
value = { for k, v in proxmox_virtual_environment_container.infra : k => { node = v.node_name, vmid = v.vm_id } }
|
||||
output "containers" {
|
||||
value = { for k, v in proxmox_virtual_environment_container.lxc : k => { node = v.node_name, vmid = v.vm_id } }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user