Skip to content

Conversation

seokho-son
Copy link
Member

@seokho-son seokho-son requested a review from yunkon-kim as a code owner October 2, 2025 07:09
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 07:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the Azure Gen2 specification checking logic by implementing a pattern-based rule that determines Gen2 support based on the presence of a digit followed by 's' in the spec name (e.g., "2s", "4s"). This replaces the previous complex version-based checking logic.

  • Replaces complex D-series version checking with a simple digit+s pattern detection
  • Consolidates Gen1-only detection into a single rule for all D-family specs without the storage optimization indicator

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +2513 to +2526
// D-family: Simple rule based on storage optimization indicator
// Pattern: Standard_D{number}s_{version} → Gen2 supported
// Pattern: Standard_D{number}_{version} → Gen1 only

// Check for digit+s pattern (e.g., "2s", "4s", "8s", "16s")
// This covers: Standard_D2s_v3, Standard_D4s_v3, Standard_D8s_v3, etc.
for i := 0; i < len(lowerSpecName)-1; i++ {
if lowerSpecName[i] >= '0' && lowerSpecName[i] <= '9' && lowerSpecName[i+1] == 's' {
return false // Found digit+s pattern = Gen2 supported
}
}
return false

// All other D-family specs without digit+s pattern are Gen1-only
// (includes all Dv2, Dv3, Dv4, Dv5, etc.)
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states that Dv2, Dv3, Dv4, Dv5 are Gen1-only, but this contradicts Azure documentation where most D-series v2 and later versions support Gen2. The simplified rule may incorrectly classify Gen2-capable instances as Gen1-only.

Copilot uses AI. Check for mistakes.

Comment on lines +2519 to 2523
for i := 0; i < len(lowerSpecName)-1; i++ {
if lowerSpecName[i] >= '0' && lowerSpecName[i] <= '9' && lowerSpecName[i+1] == 's' {
return false // Found digit+s pattern = Gen2 supported
}
}
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern matching could produce false positives. For example, a spec name containing 'test1spec' would match the digit+s pattern incorrectly. The logic should be more specific to Azure naming conventions.

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that 'test1spec' type pattern would not be added according to Azure spec/family naming rule.
So, the chance for false positives would be limited.

@seokho-son
Copy link
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Oct 2, 2025
@cb-github-robot cb-github-robot merged commit 87770b1 into cloud-barista:main Oct 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Azure] The selected VM size 'Standard_D4_v3' cannot boot Hypervisor Generation '2'

2 participants