diff --git a/terraform/pve1/main.tf b/terraform/pve1/main.tf index 285e8a8..d2eac1b 100644 --- a/terraform/pve1/main.tf +++ b/terraform/pve1/main.tf @@ -25,27 +25,38 @@ resource "proxmox_vm_qemu" "k3s_server_1" { vmid = 1000 name = "k3s-server-1" target_node = "acemagician" - clone = var.ubuntu_template - full_clone = true + # Création from scratch avec ISO Ubuntu 24.04 + iso = "local:iso/ubuntu-24.04-server-cloudimg-amd64.img" + + # Configuration matérielle cpu { cores = var.k3s_server_1_config.cores sockets = 1 + type = "host" } memory = var.k3s_server_1_config.memory agent = 1 + bios = "seabios" boot = "order=scsi0" scsihw = "virtio-scsi-single" onboot = true + # Standard VGA pour compatibilité + vga { + type = "std" + } + + # Réseau network { id = 0 model = "virtio" bridge = var.k3s_network_bridge } + # Disque sur LINSTOR disk { slot = "scsi0" size = var.k3s_server_1_config.disk_size @@ -54,12 +65,19 @@ resource "proxmox_vm_qemu" "k3s_server_1" { iothread = true } + # Cloud-init configuration ipconfig0 = "ip=${var.k3s_server_1_config.ip},gw=${var.k3s_gateway}" cicustom = "user=${var.snippets_storage}:snippets/cloud-init-k3s-server-1.yaml" nameserver = join(" ", var.k3s_dns) + # Pour cloud-init + os_type = "cloud-init" + lifecycle { - ignore_changes = [network] + ignore_changes = [ + network, + iso + ] } depends_on = [local_file.k3s_server_cloud_init] diff --git a/terraform/pve2/main.tf b/terraform/pve2/main.tf index c0b4afe..c83550a 100644 --- a/terraform/pve2/main.tf +++ b/terraform/pve2/main.tf @@ -25,27 +25,38 @@ resource "proxmox_vm_qemu" "k3s_server_2" { vmid = 1001 name = "k3s-server-2" target_node = "elitedesk" - clone = var.ubuntu_template - full_clone = true + # Création from scratch avec ISO Ubuntu 24.04 + iso = "local:iso/ubuntu-24.04-server-cloudimg-amd64.img" + + # Configuration matérielle cpu { cores = var.k3s_server_2_config.cores sockets = 1 + type = "host" } memory = var.k3s_server_2_config.memory agent = 1 + bios = "seabios" boot = "order=scsi0" scsihw = "virtio-scsi-single" onboot = true + # Standard VGA pour compatibilité + vga { + type = "std" + } + + # Réseau network { id = 0 model = "virtio" bridge = var.k3s_network_bridge } + # Disque sur LINSTOR disk { slot = "scsi0" size = var.k3s_server_2_config.disk_size @@ -54,12 +65,19 @@ resource "proxmox_vm_qemu" "k3s_server_2" { iothread = true } + # Cloud-init configuration ipconfig0 = "ip=${var.k3s_server_2_config.ip},gw=${var.k3s_gateway}" cicustom = "user=${var.snippets_storage}:snippets/cloud-init-k3s-server-2.yaml" nameserver = join(" ", var.k3s_dns) + # Pour cloud-init + os_type = "cloud-init" + lifecycle { - ignore_changes = [network] + ignore_changes = [ + network, + iso + ] } depends_on = [local_file.k3s_server_cloud_init] diff --git a/terraform/pve3/main.tf b/terraform/pve3/main.tf index a1ab8f5..e5a5671 100644 --- a/terraform/pve3/main.tf +++ b/terraform/pve3/main.tf @@ -25,27 +25,38 @@ resource "proxmox_vm_qemu" "etcd_witness" { vmid = 1002 name = "etcd-witness" target_node = "thinkpad" - clone = var.ubuntu_template - full_clone = true + # Création from scratch avec ISO Ubuntu 24.04 + iso = "local:iso/ubuntu-24.04-server-cloudimg-amd64.img" + + # Configuration matérielle cpu { cores = var.etcd_witness_config.cores sockets = 1 + type = "host" } memory = var.etcd_witness_config.memory agent = 1 + bios = "seabios" boot = "order=scsi0" scsihw = "virtio-scsi-single" onboot = true + # Standard VGA pour compatibilité + vga { + type = "std" + } + + # Réseau network { id = 0 model = "virtio" bridge = var.k3s_network_bridge } + # Disque sur local-lvm disk { slot = "scsi0" size = var.etcd_witness_config.disk_size @@ -54,12 +65,19 @@ resource "proxmox_vm_qemu" "etcd_witness" { iothread = true } + # Cloud-init configuration ipconfig0 = "ip=${var.etcd_witness_config.ip},gw=${var.k3s_gateway}" cicustom = "user=${var.snippets_storage}:snippets/cloud-init-etcd-witness.yaml" nameserver = join(" ", var.k3s_dns) + # Pour cloud-init + os_type = "cloud-init" + lifecycle { - ignore_changes = [network] + ignore_changes = [ + network, + iso + ] } depends_on = [local_file.etcd_witness_cloud_init]