Skip to content

Delete cloud instances if they are created but a subsequent step failed - #652

Merged
rasmunk merged 5 commits into
nextfrom
adjust/save_cloud_instance_upon_failure_if_it_exists
Sep 9, 2026
Merged

Delete cloud instances if they are created but a subsequent step failed#652
rasmunk merged 5 commits into
nextfrom
adjust/save_cloud_instance_upon_failure_if_it_exists

Conversation

@rasmunk

@rasmunk rasmunk commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

As highlighed in #653 . This PR aims to fix this issue by saving the cloud instance if it was created but the overall creation failed such that the user can later manage it

… process failed, but the instance itself was created. This enables the user to later manage the created instance
@rasmunk
rasmunk requested a review from a team September 9, 2026 11:22

@jonasbardino jonasbardino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the proper fix is to delete such broken instances directly as the user cannot use them and we don't want them left behind taking up resources.

…reation failed, which will also potentially remove the associated floating point IP that may be lingering
@rasmunk

rasmunk commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

That can also be the approach, either way as long as we ensure that if create_cloud_instance fails that we don't end up with a detached instance that we don't know about I'm fine with it.

@rasmunk rasmunk changed the title Save cloud instances if they are created but a subsequent step failed Delete cloud instances if they are created but a subsequent step failed Sep 9, 2026
@rasmunk

rasmunk commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Have adjusted the commit such that it now tries to delete the instance after create_cloud_instance has failed.


client_id = ' ME '
cloud_is = 'mist'
cloud_id = 'mist'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the linter who was not happy about that:)

Comment thread mig/shared/functionality/reqcloudservice.py Outdated

@jonasbardino jonasbardino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the right solution. Approved with one minor suggested change.

@jonasbardino jonasbardino added bug Something isn't working enhancement New feature or request labels Sep 9, 2026
@rasmunk
rasmunk merged commit 0286990 into next Sep 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A cloud instance can be left dangling if the create_cloud_instance call fails

2 participants