Skip to content

Support orphaned resources cleanup for Nebius - #4412

Merged
r4victor merged 2 commits into
masterfrom
issue_3453_nebius_orphan_cleanup
Oct 26, 2026
Merged

r4victor merged 2 commits into
masterfrom
issue_3453_nebius_orphan_cleanup

Conversation

@r4victor

Copy link
Copy Markdown
Collaborator

Follow-up to #4401 for #3453. Nebius provisioning regularly leaks boot disks and pricing policies: the rollback in create_instance() waits 25s for the instance to be deleted while deletion takes ~100s, and a pricing policy that is still being created can't be deleted.

  • Support orphan cleanup for Nebius: the instance, boot disk, and pricing policy of a create_instance() call share a name with provider_ref encoded, and the disk and instance are also labeled with dstack_provider_ref and dstack_provider_name, since Nebius drops labels on pricing policies.
  • List each region's project and group resources by that name into one group per provisioning attempt; an instance being deleted is not listed as the owner, but its id is kept so that its disk and pricing policy are deleted after it's gone.
  • Share the deletion with terminate_instance(): the instance first, then the boot disk and pricing policy, raising NotYetTerminated while a pricing policy is still being created instead of failing.
  • Fix an UnboundLocalError in the provisioning rollback when the instance is already gone.
  • List nebius among the backends supporting orphan cleanup.

@r4victor
r4victor merged commit 15f890b into master Oct 26, 2026
29 checks passed
@r4victor
r4victor deleted the issue_3453_nebius_orphan_cleanup branch October 26, 2026 10:40
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