Skip to content

Commit 24fbb6f

Browse files
committed
fix instance type id
1 parent 03a0f60 commit 24fbb6f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

v1/providers/nebius/instance.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ func (c *NebiusClient) convertNebiusInstanceToV1(ctx context.Context, instance *
341341
CloudID: instanceID,
342342
Location: location,
343343
CreatedAt: createdAt,
344-
InstanceType: instanceTypeID, // Full instance type ID (e.g., "gpu-h100-sxm.8gpu-128vcpu-1600gb")
345-
InstanceTypeID: v1.InstanceTypeID(instanceTypeID), // Same as InstanceType - required for dev-plane lookup
344+
InstanceType: instanceTypeID, // Full instance type ID (e.g., "gpu-h100-sxm.8gpu-128vcpu-1600gb")
345+
InstanceTypeID: v1.InstanceTypeID(getInstanceTypeID(instanceTypeID, location)),
346346
ImageID: imageFamily,
347347
DiskSize: units.Base2Bytes(diskSize),
348348
DiskSizeBytes: v1.NewBytes(v1.BytesValue(diskSize), v1.Byte), // diskSize is already in bytes from getBootDiskSize
@@ -358,6 +358,10 @@ func (c *NebiusClient) convertNebiusInstanceToV1(ctx context.Context, instance *
358358
}, nil
359359
}
360360

361+
func getInstanceTypeID(instanceType string, region string) string {
362+
return fmt.Sprintf("%v-%v", instanceType, region)
363+
}
364+
361365
// waitForInstanceRunning polls the instance until it reaches RUNNING state or fails
362366
// This prevents orphaned resources when instances fail after the create API call succeeds
363367
func (c *NebiusClient) waitForInstanceRunning(ctx context.Context, instanceID v1.CloudProviderInstanceID, refID string, timeout time.Duration) (*v1.Instance, error) {

0 commit comments

Comments
 (0)