Every infrastructure plan has failed since neptune was wiped. module.k8s_3 still
declared a Proxmox VM, so the bpg/proxmox provider tried to reach a hypervisor
that no longer exists:
Error: failed to get resources list of type ("vm") for cluster:
dial tcp 10.2.40.201:8006: connect: no route to host
with module.k8s_3.proxmox_virtual_environment_vm.this
Deleting vm_152_k8s_3.tf alone does not fix that. Removing a resource from
configuration makes OpenTofu plan a destroy, and planning a destroy refreshes
the resource through the same unreachable provider.
A `removed` block with `lifecycle { destroy = false }` forgets the state entry
without contacting Proxmox. Nothing is orphaned: the guest, its disks and the
hypervisor underneath were all destroyed during the conversion. This is the
declarative equivalent of a state removal, reviewable in git rather than run by
hand against production state.
talos_image.tf goes with it. Its locals named the nocloud image for VM import
and had no consumer other than the VM module.
Deliberately kept for a follow-up: the proxmox provider block, the
proxmox_vm/proxmox_lxc/bpg_proxmox_container modules and sync_state_from_pve.py.
A provider with no resources is never contacted, so leaving it costs nothing,
and removing it should wait until a clean plan proves state holds no other
Proxmox resources. That check cannot be made from here — the S3 credentials
used for local runs have been revoked.
Verified with `tofu validate` and `tofu fmt -check` offline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
Terraform
28 lines
1.1 KiB
Terraform
# k8s-3 was the last Proxmox VM. neptune now runs Talos on bare metal, and its
|
|
# disks were wiped during the conversion, so the VM this module described does
|
|
# not exist in any form.
|
|
#
|
|
# `removed` rather than simply deleting vm_152_k8s_3.tf: dropping the resource
|
|
# from configuration alone makes OpenTofu plan a DESTROY, and planning a destroy
|
|
# refreshes the resource through the bpg/proxmox provider — which now has no
|
|
# endpoint to reach. That is exactly what has been failing every infrastructure
|
|
# plan since the conversion:
|
|
#
|
|
# Error: failed to get resources list of type ("vm") for cluster:
|
|
# dial tcp 10.2.40.201:8006: connect: no route to host
|
|
# with module.k8s_3.proxmox_virtual_environment_vm.this
|
|
#
|
|
# `lifecycle { destroy = false }` forgets the state entry without attempting to
|
|
# contact Proxmox. Nothing is orphaned by doing so: the guest, its disks and the
|
|
# hypervisor underneath it are all already gone.
|
|
#
|
|
# This block can be deleted once one plan has run cleanly with it — it is a
|
|
# one-shot instruction, not standing configuration.
|
|
removed {
|
|
from = module.k8s_3
|
|
|
|
lifecycle {
|
|
destroy = false
|
|
}
|
|
}
|