ionos-cloud/cluster-api-provider-proxmox

Issue deleting machine that added into High Availability

Closed this issue · 2 comments

What steps did you take and what happened:
[A clear and concise description of what the bug is.]

We have discovered that the CAPMOX provider cannot delete machines which are part of high availability.
Steps to reproduce:

Step 1. VM128 which is a worker node for a cluster is added into High Availability in the proxmox GUI (Datacenter > High Availability)

Step 2. Find the machine resource in the management cluster and delete it

kubectl get machines|grep mk1-busi-cl-worker-wrn46
kubectl delete machine mk1-busi-cl-workers-lnlc8-q98l6 

Step 3 - Check the CAPMOX provider logs
E0515 09:29:06.758515 1 controller.go:329] "Reconciler error" err="cannot delete vm with id 128: 500 unable to remove VM 128 - used in HA resources and purge parameter not set." controller="proxmoxmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="ProxmoxMachine" ProxmoxMachine="default/mk1-busi-cl-worker-wrn46" namespace="default" name="mk1-busi-cl-worker-wrn46" reconcileID="6631f758-0c64-4776-9f4a-aadf0435510f"

What did you expect to happen:
I would have expected the machine to be deleted

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
There is a purge parameter for the DELETE API request.
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}

Environment:

  • Cluster-api-provider-proxmox version: v1.6.3/v0.40
  • Kubernetes version: (use kubectl version): 1.28.8
  • OS (e.g. from /etc/os-release): ubuntu 2204

That's actually correct,

Since you added the HA manually, you need to adjust it manually.
Otherwise, we can make a feature request to add support for HA, which means HA can be configured in the Spec.
Hence, when machine deletion triggered and attached to HA, the controller will take care of that.

Thanks @mcbenjemaa
I will close this and create a feature request