Skip to content

Fix Verda spot offers marked unavailable due to on-demand-only availability check#3928

Merged
jvstme merged 2 commits into
dstackai:masterfrom
IA386:fix-verda-spot-offers-availability
Jun 2, 2026
Merged

Fix Verda spot offers marked unavailable due to on-demand-only availability check#3928
jvstme merged 2 commits into
dstackai:masterfrom
IA386:fix-verda-spot-offers-availability

Conversation

@IA386
Copy link
Copy Markdown
Contributor

@IA386 IA386 commented Jun 2, 2026

What this does

Fixes spot offers on the verda backend being marked NOT_AVAILABLE and never provisioned.

VerdaCompute._get_offers_with_availability queried instance availability without the is_spot parameter (so the Verda API returned on-demand inventory only) and keyed the availability map by (instance_name, region), ignoring the spot dimension. As a result, spot offers (e.g. B200 spot) inherited on-demand availability and were marked NOT_AVAILABLE whenever the on-demand variant was unavailable. Provisioning requests offers with exclude_not_available=True, so these offers were dropped and never provisioned.

The fix queries both spot and on-demand availability and keys the map by (instance_name, region, is_spot), so each offer is matched against the correct inventory.

Reproduction

See linked issue. With B200 available as spot but not on-demand, dstack offer --backend verda --gpu B200 --spot showed B200 spot as "not available", and provisioning found no offers.

Tests

Added TestGetOffersWithAvailability in tests/.../verda/test_compute.py covering:

  • spot and on-demand availability are resolved independently;
  • both is_spot=True and is_spot=False availability are queried.

These tests fail against the previous code and pass with the fix. ruff check / ruff format clean.

Closes #3927


This PR was written primarily by Claude Code (with maintainer review of the diagnosis and fix).

…bility check

VerdaCompute._get_offers_with_availability queried instance availability
without the is_spot parameter (returning on-demand inventory only) and keyed
the availability map by (instance_name, region), ignoring the spot dimension.

As a result, spot offers (e.g. B200 spot) inherited on-demand availability and
were marked NOT_AVAILABLE whenever the on-demand variant was unavailable. Such
offers are then dropped during provisioning, which requests offers with
exclude_not_available=True, so they were never provisioned.

Query both spot and on-demand availability and key the map by
(instance_name, region, is_spot) so each offer is matched against the correct
inventory.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@peterschmidt85 peterschmidt85 requested a review from jvstme June 2, 2026 07:49
Copy link
Copy Markdown
Collaborator

@jvstme jvstme left a comment

Choose a reason for hiding this comment

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

@IA386, thanks for contributing, the fix looks good to me

@jvstme
Copy link
Copy Markdown
Collaborator

jvstme commented Jun 2, 2026

It will be released with 0.20.23, likely later this week

@jvstme jvstme merged commit 2b6434b into dstackai:master Jun 2, 2026
25 checks passed
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.

[Bug]: Verda spot offers marked NOT_AVAILABLE and not provisioned (e.g. B200 spot)

2 participants