@@ -165,21 +165,20 @@ func (m *manager) generateInstallConfig(ctx context.Context) (*installconfig.Ins
165165 // from a manifest so it can be specified in the RP's
166166 // OpenShiftClusterVersions?
167167
168- imageSKU := "aro_420" // Gen1 SKU (default)
168+ // 4.20 onwards, we default to Gen2 images
169+ imageSKU := "aro_420-v2" // Gen2 SKU (default)
169170
170- // Check if any SKU requires V2 only ( doesn't support V1)
171- masterRequiresV2 , err := determineSkuSupportsV2Only (masterSKU )
171+ // If any SKU doesn't support V2, use Gen1 images
172+ masterSupportsV2 , err := determineV2SkuSupport (masterSKU )
172173 if err != nil {
173174 return nil , nil , errors .WithStack (err )
174175 }
175- workerRequiresV2 , err := determineSkuSupportsV2Only (workerSKU )
176+ workerSupportsV2 , err := determineV2SkuSupport (workerSKU )
176177 if err != nil {
177178 return nil , nil , errors .WithStack (err )
178179 }
179-
180- // If any SKU only supports V2, use Gen2 images for the entire cluster.
181- if masterRequiresV2 || workerRequiresV2 {
182- imageSKU = "aro_420-v2"
180+ if ! masterSupportsV2 || ! workerSupportsV2 {
181+ imageSKU = "aro_420"
183182 }
184183
185184 rhcosImage := & azuretypes.OSImage {
@@ -475,9 +474,8 @@ func determineAvailabilityZones(controlPlaneSKU, workerSKU *mgmtcompute.Resource
475474 return controlPlaneZones , workerZones , nil
476475}
477476
478- // determineSkuSupportsV2Only checks if the SKU ONLY supports HyperV Generation V2 (not V1).
479- // Returns true if the SKU requires Gen2 images (supports V2 but not V1).
480- func determineSkuSupportsV2Only (sku * mgmtcompute.ResourceSku ) (bool , error ) {
477+ // determineV2SkuSupport returns true if the SKU supports HyperV Generation V2
478+ func determineV2SkuSupport (sku * mgmtcompute.ResourceSku ) (bool , error ) {
481479 skuCapabilities , capabilityExists := computeskus .GetCapabilityMap (sku )
482480 if ! capabilityExists {
483481 return false , fmt .Errorf ("no capabilities found for SKU %s" , * sku .Name )
@@ -486,5 +484,5 @@ func determineSkuSupportsV2Only(sku *mgmtcompute.ResourceSku) (bool, error) {
486484 if err != nil {
487485 return false , fmt .Errorf ("could not fetch HyperV generations for SKU %s: %w" , * sku .Name , err )
488486 }
489- return generations .Has ("V2" ) && ! generations . Has ( "V1" ) , nil
487+ return generations .Has ("V2" ), nil
490488}
0 commit comments