@@ -29,7 +29,13 @@ func (c *NebiusClient) GetInstanceTypes(ctx context.Context, args v1.GetInstance
2929 // Default behavior: check ALL regions to show all available quota
3030 var locations []v1.Location
3131
32- if len (args .Locations ) > 0 && ! args .Locations .IsAll () {
32+ if args .Locations .IsAll () { //nolint:gocritic // prefer if statement over switch statement
33+ allLocations , err := c .GetLocations (ctx , v1.GetLocationsArgs {})
34+ if err != nil {
35+ return nil , errors .WrapAndTrace (err )
36+ }
37+ locations = allLocations
38+ } else if len (args .Locations ) > 0 {
3339 // User requested specific locations - filter to those
3440 allLocations , err := c .GetLocations (ctx , v1.GetLocationsArgs {})
3541 if err == nil {
@@ -48,15 +54,8 @@ func (c *NebiusClient) GetInstanceTypes(ctx context.Context, args v1.GetInstance
4854 locations = []v1.Location {{Name : c .location }}
4955 }
5056 } else {
51- // Default behavior: enumerate ALL regions for quota-aware discovery
52- // This shows users all instance types they have quota for, regardless of region
53- allLocations , err := c .GetLocations (ctx , v1.GetLocationsArgs {})
54- if err == nil {
55- locations = allLocations
56- } else {
57- // Fallback to client's configured location if we can't get all locations
58- locations = []v1.Location {{Name : c .location }}
59- }
57+ // Fallback to client's configured location if we can't get all locations
58+ locations = []v1.Location {{Name : c .location }}
6059 }
6160
6261 // Get quota information for all regions
@@ -176,10 +175,10 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform
176175
177176 // Convert Nebius platform preset to our InstanceType format
178177 instanceType := v1.InstanceType {
179- ID : v1 .InstanceTypeID (instanceTypeID ), // Dot-separated format (e.g., "gpu-h100-sxm.8gpu-128vcpu-1600gb")
180178 Location : location .Name ,
181179 Type : instanceTypeID , // Same as ID - both use dot-separated format
182180 VCPU : preset .Resources .VcpuCount ,
181+ Memory : units .Base2Bytes (preset .Resources .MemoryGibibytes ) * units .Gibibyte ,
183182 MemoryBytes : v1 .NewBytes (v1 .BytesValue (preset .Resources .MemoryGibibytes ), v1 .Gibibyte ), // Memory in GiB
184183 NetworkPerformance : "standard" , // Default network performance
185184 IsAvailable : isAvailable ,
@@ -191,12 +190,14 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform
191190
192191 // Add GPU information if available
193192 if preset .Resources .GpuCount > 0 && ! isCPUOnly {
193+ memory := getGPUMemory (gpuType )
194194 gpu := v1.GPU {
195195 Count : preset .Resources .GpuCount ,
196196 Type : gpuType ,
197197 Name : gpuName ,
198198 Manufacturer : v1 .ManufacturerNVIDIA , // Nebius currently only supports NVIDIA GPUs
199- Memory : getGPUMemory (gpuType ), // Populate VRAM based on GPU type
199+ Memory : memory , // Populate VRAM based on GPU type
200+ MemoryBytes : v1 .NewBytes (v1 .BytesValue (int64 (memory )/ int64 (units .Gibibyte )), v1 .Gibibyte ),
200201 }
201202 instanceType .SupportedGPUs = []v1.GPU {gpu }
202203 }
@@ -207,6 +208,9 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform
207208 instanceType .BasePrice = pricing
208209 }
209210
211+ // Make the instance type ID
212+ instanceType .ID = v1 .MakeGenericInstanceTypeID (instanceType )
213+
210214 instanceTypes = append (instanceTypes , instanceType )
211215 }
212216 }
@@ -368,7 +372,9 @@ func (c *NebiusClient) buildSupportedStorage() []v1.Storage {
368372 // Nebius supports dynamically allocatable network SSD disks
369373 // Minimum: 50GB, Maximum: 2560GB
370374 minSize := 50 * units .GiB
375+ minSizeBytes := v1 .NewBytes (50 , v1 .Gibibyte )
371376 maxSize := 2560 * units .GiB
377+ maxSizeBytes := v1 .NewBytes (2560 , v1 .Gibibyte )
372378
373379 // Pricing is roughly $0.10 per GB-month, which is ~$0.00014 per GB-hour
374380 pricePerGBHr , _ := currency .NewAmount ("0.00014" , "USD" )
@@ -379,6 +385,8 @@ func (c *NebiusClient) buildSupportedStorage() []v1.Storage {
379385 Count : 1 ,
380386 MinSize : & minSize ,
381387 MaxSize : & maxSize ,
388+ MinSizeBytes : & minSizeBytes ,
389+ MaxSizeBytes : & maxSizeBytes ,
382390 IsElastic : true ,
383391 PricePerGBHr : & pricePerGBHr ,
384392 },
@@ -396,7 +404,7 @@ func (c *NebiusClient) applyInstanceTypeFilters(instanceTypes []v1.InstanceType,
396404 if len (args .InstanceTypes ) > 0 {
397405 found := false
398406 for _ , requestedType := range args .InstanceTypes {
399- if string ( instanceType .ID ) == requestedType {
407+ if instanceType .Type == requestedType {
400408 found = true
401409 break
402410 }
0 commit comments