kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack
https://cluster-api-openstack.sigs.k8s.io/
Apache License 2.0
289 stars 253 forks source link

Option to Shutdown VM before deleting it #1973

Open shaardie opened 6 months ago

shaardie commented 6 months ago

/kind feature

Describe the solution you'd like

I think the teardown process of VMs would benefit from an option to shutdown the OpenStack Machine before deleting it. This way it would be possible to benefit from teardown process in the VMs itself. Myself encountered this problem with NVIDIA licensees, which are borrowed on VM startup, but never properly released, because the Service on the VM was never stopped properly and therefore had no chance of releasing the license.

I think on way of implementing this, would be to add something like an waitForShutdown to the OpenStackMachine CRD. It could be defaulted to 0s to keep the old behavior and it would be a single configuration to have the possibility to let the VM properly shutdown and have a timeout for the shutdown, so that it does not hang forever in an error case.

If you are interested in such a feature, I would be happy to help implementing it.

mdbooth commented 6 months ago

Sounds useful.

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

EmilienM commented 3 months ago

@shaardie sounds like useful indeed. Would you still be interested to implement it?

/remove-lifecycle stale

vring0 commented 3 months ago

+1

shaardie commented 2 weeks ago

I would like to implement it, but unfortunately there is a big leap between main and the version we are currently using (0.9). Especially, because there seems to be a new controller.

As a quick fix, at least for us, I implemented this on the release-0.9 branch.

As soon as the dust settles and we can switch to a version near the current main, I would try to implement it there again.