Skip to the content.

Capacity

Module: services/capacity · Image: nebius-mocker-capacity · NEBIUS_MOCKER_SERVICES=capacity M1 tier: T1 · M2: T2 with capacity simulation · Endpoints: capacity-blocks.billing-cpl, capacity-advisor.billing-cpl

Implementation status

Piece Status
nebius.capacity.v1.CapacityAllowanceService: Create, Get, GetByParentAndCapacityBlockGroup (default allowance when none exists), List (one entry per block group of the tenant, paged), ListByCapacityBlockGroup (paged), Update (reset mask, resource_version), Delete ✅ T2
nebius.capacity.v1.CapacityBlockGroupService: Get, GetByResourceAffinity, List (paged), ListResources ✅ T2
nebius.capacity.v1.CapacityIntervalService: Get, List (paged) ✅ T2
nebius.capacity.v1.ResourceAdviceService: List (paged): reserved availability from the block groups ✅ T1 (on-demand and preemptible: UNKNOWN, see below)
Seeded catalog of block groups and intervals (NEBIUS_MOCKER_CAPACITY_BLOCK_GROUPS_FILE), with limits, states and continuous intervals computed from the mock clock ✅
Reservations capability peer.CapacityReservations (pkg/peer/capacity.go): draws GPUs within the block group’s limit and the project’s allowance, and feeds status.usage and ListResources ✅ consumed by compute instances (spec.reservation_policy, see compute)
Authorization: rules for every RPC (capacity.allowances.*, capacity.blockGroups.*, capacity.intervals.*, capacity.resourceAdvice.list); allowances checked on the project, block groups and advice on the tenant ✅
nebius_capacity_v1_capacity_allowance resource and data source, nebius_capacity_v1_capacity_block_group data source with the official provider ✅ e2e: test/terraform/capacity
nebius capacity capacity-block-group / capacity-interval / capacity-allowance / resource-advice CLI flows from the docs ✅ e2e: test/cli/capacity

Verified against: nebius/api@4522189, terraform-provider-nebius v0.6.91, gosdk v0.2.100, nebius CLI 0.12.312.

Covered by unit tests (services/capacity/{domain,dal,api}), gosdk contract tests (test/contract/capacity_*), the Terraform e2e suite and the CLI e2e suite (make e2e).

Behavior notes

These follow project limits, managing project limits, capacity block groups, VM reservations and the capacity advisor. Where they say nothing, the mock’s choice is marked (mock).

Not yet

Overview

Reserved GPU capacity: capacity block groups (a reservation of a resource type in a region; read-only to users, with status.current_limit, usage, next_change_at, intervals), capacity intervals (time windows of a block group), capacity allowances (a user’s share of a block group for a project, with spec.limit), and the resource advice service (suggestions for where capacity exists).

Resource kind Message NID prefix Parent
Capacity block group CapacityBlockGroup capacityblockgroup tenant (seeded)
Capacity interval CapacityInterval capacityinterval block group (seeded)
Capacity allowance CapacityAllowance capacityallowance project

Emulation design

Configuration

Variable Default Meaning
NEBIUS_MOCKER_CAPACITY_BLOCK_GROUPS_FILE built-in catalog YAML or JSON file that replaces the catalog of block groups, intervals and GPU presets (same shape as services/capacity/domain/catalog.yaml)

Terraform

Kind Terraform type Service RPCs called Tier
Resource nebius_capacity_v1_capacity_allowance nebius.capacity.v1.CapacityAllowanceService Get, GetByParentAndCapacityBlockGroup, Create, Update, Delete + OperationService.Get T1
Data source nebius_capacity_v1_capacity_allowance nebius.capacity.v1.CapacityAllowanceService Get, GetByParentAndCapacityBlockGroup T1
Data source nebius_capacity_v1_capacity_block_group nebius.capacity.v1.CapacityBlockGroupService Get, GetByResourceAffinity T1

API surface

nebius.capacity.v1.CapacityAllowanceService

Endpoint: capacity-blocks.billing-cpl.api.nebius.cloud:443 · Proto: nebius/capacity/v1/capacity_allowance_service.proto · used by Terraform

RPC Request Response TF
List ListCapacityAllowancesRequest ListCapacityAllowancesResponse  
ListByCapacityBlockGroup ListCapacityAllowancesByCapacityBlockGroupRequest ListCapacityAllowancesResponse  
Get GetCapacityAllowanceRequest CapacityAllowance ✅
GetByParentAndCapacityBlockGroup GetCapacityAllowanceByParentAndCapacityBlockGroupRequest CapacityAllowance ✅
Create CreateCapacityAllowanceRequest common.v1.Operation ✅
Update UpdateCapacityAllowanceRequest common.v1.Operation ✅
Delete DeleteCapacityAllowanceRequest common.v1.Operation ✅

nebius.capacity.v1.CapacityBlockGroupService

Endpoint: capacity-blocks.billing-cpl.api.nebius.cloud:443 · Proto: nebius/capacity/v1/capacity_block_group_service.proto · used by Terraform

RPC Request Response TF
Get GetCapacityBlockGroupRequest CapacityBlockGroup ✅
GetByResourceAffinity GetCapacityBlockGroupByResourceAffinityRequest CapacityBlockGroup ✅
List ListCapacityBlockGroupsRequest ListCapacityBlockGroupsResponse  
ListResources ListCapacityBlockGroupResourcesRequest ListCapacityBlockGroupResourcesResponse  

nebius.capacity.v1.CapacityIntervalService

Endpoint: capacity-blocks.billing-cpl.api.nebius.cloud:443 · Proto: nebius/capacity/v1/capacity_interval_service.proto

RPC Request Response TF
Get GetCapacityIntervalRequest CapacityInterval  
List ListCapacityIntervalsRequest ListCapacityIntervalsResponse  

nebius.capacity.v1.ResourceAdviceService

Endpoint: capacity-advisor.billing-cpl.api.nebius.cloud:443 · Proto: nebius/capacity/v1/resource_advice_service.proto

RPC Request Response TF
List ListResourceAdviceRequest ListResourceAdviceResponse