Skip to content

Commit fa0daa2

Browse files
mmoulikkaditsharma55
authored andcommitted
fix(nebius): filter ARM64 images from boot disk selection
1 parent ecfee0e commit fa0daa2

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

v1/providers/nebius/instance.go

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ func (c *NebiusClient) buildDiskCreateRequest(ctx context.Context, diskName stri
12091209
publicImagesParent := c.getPublicImagesParent()
12101210

12111211
// Skip validation for known-good common families to speed up instance start
1212-
knownFamilies := []string{"ubuntu22.04-cuda12", "mk8s-worker-node-v-1-32-ubuntu24.04", "mk8s-worker-node-v-1-32-ubuntu24.04-cuda12.8"}
1212+
knownFamilies := []string{"ubuntu24.04-cuda13.0", "ubuntu24.04-cuda12", "ubuntu22.04-cuda12", "mk8s-worker-node-v-1-32-ubuntu24.04", "mk8s-worker-node-v-1-32-ubuntu24.04-cuda12.8"}
12131213
isKnownFamily := false
12141214
for _, known := range knownFamilies {
12151215
if imageFamily == known {
@@ -1230,21 +1230,24 @@ func (c *NebiusClient) buildDiskCreateRequest(ctx context.Context, diskName stri
12301230
return baseReq, nil
12311231
}
12321232

1233-
// For unknown families, validate first
1234-
_, err := c.sdk.Services().Compute().V1().Image().GetLatestByFamily(ctx, &compute.GetImageLatestByFamilyRequest{
1233+
// For unknown families, validate first and check architecture
1234+
latestImage, err := c.sdk.Services().Compute().V1().Image().GetLatestByFamily(ctx, &compute.GetImageLatestByFamilyRequest{
12351235
ParentId: publicImagesParent,
12361236
ImageFamily: imageFamily,
12371237
})
12381238
if err == nil {
1239-
// Family works, use it
1240-
baseReq.Spec.Source = &compute.DiskSpec_SourceImageFamily{
1241-
SourceImageFamily: &compute.SourceImageFamily{
1242-
ImageFamily: imageFamily,
1243-
ParentId: publicImagesParent,
1244-
},
1239+
isARM64 := latestImage.Spec != nil && latestImage.Spec.GetCpuArchitecture() == compute.ImageSpec_ARM64
1240+
if !isARM64 {
1241+
baseReq.Spec.Source = &compute.DiskSpec_SourceImageFamily{
1242+
SourceImageFamily: &compute.SourceImageFamily{
1243+
ImageFamily: imageFamily,
1244+
ParentId: publicImagesParent,
1245+
},
1246+
}
1247+
baseReq.Metadata.Labels["image-family"] = imageFamily
1248+
return baseReq, nil
12451249
}
1246-
baseReq.Metadata.Labels["image-family"] = imageFamily
1247-
return baseReq, nil
1250+
// ARM64 family — fall through to getWorkingPublicImageID which filters by architecture
12481251
}
12491252
}
12501253

@@ -1290,6 +1293,10 @@ func (c *NebiusClient) getWorkingPublicImageID(ctx context.Context, requestedIma
12901293
continue
12911294
}
12921295

1296+
if image.Spec != nil && image.Spec.GetCpuArchitecture() == compute.ImageSpec_ARM64 {
1297+
continue
1298+
}
1299+
12931300
imageName := strings.ToLower(image.Metadata.Name)
12941301

12951302
// Set fallback to first available image
@@ -1583,6 +1590,9 @@ func (c *NebiusClient) parseInstanceType(ctx context.Context, instanceTypeID str
15831590
func (c *NebiusClient) resolveImageFamily(ctx context.Context, imageID string) (string, error) {
15841591
// Common Nebius image families - if ImageID matches one of these, use it directly
15851592
commonFamilies := []string{
1593+
"ubuntu24.04-cuda13.0",
1594+
"ubuntu24.04-cuda12",
1595+
"ubuntu24.04-driverless",
15861596
"ubuntu22.04-cuda12",
15871597
"mk8s-worker-node-v-1-32-ubuntu24.04",
15881598
"mk8s-worker-node-v-1-32-ubuntu24.04-cuda12.8",

0 commit comments

Comments
 (0)