8000 Reconcile Maid Café guests and define a new k8s-01 VM by clee231 · Pull Request #197 · acm-uic/IaC · GitHub
[go: up one dir, main page]

Skip to content

Reconcile Maid Café guests and define a new k8s-01 VM - #197

Merged
clee231 merged 5 commits into
mainfrom
fix/reconcile-current-vms-containers
Oct 15, 2026
Merged

clee231 merged 5 commits into
mainfrom
fix/reconcile-current-vms-containers

Conversation

@clee231
@clee231 clee231 commented Oct 15, 2026 •
Copy link
Copy Markdown
Contributor

The production state still identifies VM 107 as k8s_01, while its actual occupant is taskbox-template and 46 guests exist across the cluster. This PR adopts the current 30 QEMU VMs and 16 LXC containers, including templates, plus the existing VM 110 HA policy. It also defines a new k8s-01 VM at unused VMID 168 on Boba, separate from the stale state entry.

Each guest has a Terraform file named after its current name. Existing guests retain type/VMID resource labels and their current CPU/RAM, disks, networks, autostart settings and pools. Historical disabled Kubernetes definitions without an active counterpart remain for reference; active WiCyS files supersede their disabled counterparts.

The active provider is pinned to bpg/proxmox 0.116.1. Telmate remains only to decode and detach its stale proxmox_vm_qemu.k8s_01 state entry with destroy = false. Adoption imports 47 existing objects and initializes only vm_id/timeout_start metadata for the 16 containers. The Azure backend and prod workspace stay unchanged.

The old run attempted to change taskbox-template into k8s-01 and failed with source must be set on creation. The new k8s-01.tf uses proxmox_virtual_environment_vm.k8s_01, allocates a new 100 GiB disk on local-lvm, and explicitly attaches the existing Talos ISO. It retains four CPU cores, 4 GiB RAM, UEFI/TPM, the Kubernetes pool and speed2/VLAN 9 network. VM 168 is created stopped, with deletion protection; Talos installation and cluster bootstrap are separate operational steps.

Every managed object has prevent_destroy. The plan policy blocks deletion, replacement, unapproved creation, unsafe state removal, ID/node changes and UUID mismatches. Its only creation exception is the new k8s-01 address with VMID 168, node Boba, the expected name, and known stopped/protected/non-template state. It does not permit replacement or adoption through that exception.

Both workflows display the human-readable plan while saving it, with values marked sensitive redacted by OpenTofu. Saved binaries and JSON remain private temporary files. Application is manual-only and uses the exact checked saved plan; the apply workflow remains incident-disabled. Existing guest power state, operator notes, unset container CPU weights and peripheral metadata omitted during import are narrowly ignored as documented in the README.

Validation:

  • OpenTofu formatting/validation and all 13 safety regression tests pass.
  • Original adoption tested against a local production-state copy through a GET-only proxy; existing guest definitions were preserved when split into individual files.
  • Updated full-stack offline plan, using the adopted local state with refresh disabled: 47 unchanged objects, one create (VM 168), no updates or deletions. The plan passes the safety policy.
  • Fresh production CI plan and safety tests pass: 47 imports, one new VM, 30 updates, zero destructions, one safe state detachment. The updates are 16 container metadata initializations and 14 pool assignments matching the current hypervisor memberships; the same pool updates were present before adding k8s-01. No existing guest hardware changes are planned.
  • Read-only hypervisor checks confirm VMID 168 and the intended MAC are unused, and Boba has the ISO, bridge, pool and sufficient local storage.
  • Provider checksums validated for Linux amd64 and arm64.

No production state migration, VM creation or infrastructure apply has been performed. Review a fresh production plan before deliberately dispatching application.

@clee231 clee231 changed the title Reconcile Terraform with current Maid Cafe VMs and containers Reconcile Maid Café guests and define a new k8s-01 VM Oct 15, 2026
@clee231
clee231 merged commit a7a329e into main Oct 15, 2026
4 checks passed
@clee231
clee231 deleted the fix/reconcile-current-vms-containers branch October 15, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0