Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- **`Capabilities.VCPUs`** — the instance type's default vCPU count
(`DescribeInstanceTypes`' `VCpuInfo.DefaultVCpus`), so a caller can convert a
per-family vCPU quota (`pkg/quotas.QuotaInfo`) into an instance-count ceiling
without re-parsing the type's size suffix — the same name-based guessing
`pkg/quotas.getVCPUCount` already falls back to, which `obtainability.go`'s
own comment flags as unreliable for non-linear sizes (spawn#492).

### Fixed
- **`quotas.CanLaunch`'s Spot path now tracks current Spot usage** instead of
only confirming a request fits the *full* Spot quota (#132). `QuotaInfo`
Expand All @@ -19,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
instances got a false "fits" for 2 more, since 16 ≤ 64 (the full quota) in
isolation — the actual launch then failed with
`MaxSpotInstanceCountExceeded` with zero prior warning.
>>>>>>> 3117a40 (feat(aws): add Capabilities.VCPUs (default vCPU count per instance type))

## [0.48.1] - 2026-08-07

Expand Down
10 changes: 10 additions & 0 deletions pkg/aws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,13 @@ type Capabilities struct {
NestedVirtualization bool `json:"nested_virtualization"` // can run KVM/Hyper-V in-instance
GPUs int32 `json:"gpus,omitempty"`
BareMetal bool `json:"bare_metal"`
// VCPUs is the instance type's default vCPU count (EC2's VCpuInfo.DefaultVCpus).
// Lets a caller convert a per-family vCPU quota (pkg/quotas.QuotaInfo) into an
// instance count without re-parsing the type's size suffix — the same
// name-based guessing pkg/quotas.getVCPUCount uses as a last-resort fallback,
// which obtainability.go's own comment already flags as unreliable for
// non-linear sizes (p6-b200.48xlarge, metal sizes). spawn#492.
VCPUs int32 `json:"vcpus,omitempty"`
}

// GetCapabilities returns feature support for a single instance type in the
Expand Down Expand Up @@ -643,6 +650,9 @@ func (c *Client) GetCapabilities(ctx context.Context, instanceType, region strin
caps.Architectures = append(caps.Architectures, string(a))
}
}
if it.VCpuInfo != nil && it.VCpuInfo.DefaultVCpus != nil {
caps.VCPUs = *it.VCpuInfo.DefaultVCpus
}
return caps, nil
}

Expand Down
Loading