Skip to content

Conversation

@chucklever
Copy link
Contributor

Add scripts and other infrastructure needed to build the Azure provider's Kconfig menus dynamically, and then hook it into "make cloud-config".

Match the format of the other cloud provider menu entries.

Signed-off-by: Chuck Lever <[email protected]>
Split the VM size menu and the OS image menu into separate Kconfig
files, as these two will each be generated by different scripts.

Signed-off-by: Chuck Lever <[email protected]>
This adds a Python script that queries the Azure API to retrieve
available regions and generates the Kconfig.location file dynamically.
This ensures the region list is always up-to-date and includes only
regions accessible to the user's subscription.

The implementation follows the same pattern as AWS and OCI, providing:
- Dynamic region discovery via Azure CLI/SDK
- Friendly display names for each region
- Automatic filtering of inaccessible regions
- Support for both command-line querying and Kconfig generation

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
Similar to commit 0e572ac ("terraform/oci: Generate
Kconfig.shapes dynamically"), this patch adds a Python script that
queries the Azure API to dynamically generate a Kconfig menu for VM
sizes.

The script generates Kconfig entries with complete hardware
specifications including:

- Number of vCPUs
- Memory capacity
- Maximum data disk count
- Temporary storage size
- CPU architecture (x86_64 or ARM64)

The generated menu can include over 1000 VM size options depending
on region availability, providing a comprehensive selection compared
to the handful of sizes in the static Kconfig.size file.

Usage:
  ./gen_kconfig_size > ../kconfigs/Kconfig.size.generated
  ./gen_kconfig_size --all-regions > ../kconfigs/Kconfig.size.generated

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
Similar to commit dab6b48 for OCI, add a Python script to dynamically
generate Azure VM image Kconfig configuration by querying the Azure API
for available publishers, offers, and SKUs.

The gen_kconfig_image script queries Azure for available VM images and
generates Kconfig menu entries for them. Publisher definitions are
maintained in publisher_definitions.yml to make it easy to add new
distributions or customize display names and priorities.

The script:
- Queries Azure API for available publishers, offers, and SKUs
- Generates separate menus for x86_64 and ARM64 architectures
- Filters out test/preview/experimental offers
- Supports both well-known publishers (Debian, Red Hat, Ubuntu) and
  marketplace publishers (AlmaLinux, Rocky Linux)
- Provides --publishers flag to list available publishers
- Supports querying specific regions or publishers

Usage:
  cd terraform/azure/scripts && ./gen_kconfig_image --quiet

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
Following the pattern established in commit 41d3f69 for OCI,
add Azure region generation support to the cloud configuration script.

This change enables dynamic Azure region discovery and Kconfig
generation via "make cloud-config" or "make cloud-config-azure".

Changes made:
- Add generate_azure_kconfig() function to generate_cloud_configs.py
- Update process_azure() to generate Kconfig files
- Add Azure targets to dynamic-cloud-kconfig.Makefile
- Update terraform/azure/Kconfig to source generated file
- Add Azure generated files to .gitignore

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
…tion, and filter cloud-init-incompatible versions

Simplify Pattern 3c for Oracle Linux SKU classification with a more
flexible regex that handles edge cases missed by the previous
implementation. The new pattern handles single-digit versions (8, ol9),
underscore format (ol8_2-gen2), and all suffix variants without
hardcoding them.

Add intelligent SKU selection when multiple variants exist for the same
OS version. The scoring system prefers Gen2 VMs (UEFI boot, better
performance) and LVM-based images (flexible partitioning) while hiding
implementation details from users. This ensures users get the best
available variant without seeing confusing technical suffixes in the
Kconfig menu.

Filter out distribution versions that lack cloud-init support, which
kdevops terraform provisioning requires. Oracle Linux and RHEL versions
before 7.7 are excluded as they predate Azure's adoption of cloud-init
as the standard provisioning method. This prevents provisioning failures
from incompatible images appearing in the Kconfig menu.

The friendly names now show clean version strings like 'Oracle Linux
8.9 (x86)' instead of 'Oracle Linux 8.9 (x86) Gen2 LVM', while
internally selecting the optimal SKU (ol89-lvm-gen2 instead of
ol89-lvm).

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
Similar to the Oracle Linux improvements, consolidate RHEL SKU
parsing into a single flexible pattern that handles all format
variants. The previous Pattern 3 and Pattern 3b required separate
regex patterns for underscore format (9_6) and condensed Gen2
format (810-gen2), with a complex hardcoded regex that excluded
LVM variants.

The new unified Pattern 3 uses a flexible regex that handles
underscore format (9_6, 10_1), condensed versions (77, 810), LVM
variants (7lvm-gen2, 8-lvm-gen2), and all suffix combinations
(gen2, -gen2, _gen2, sap variants, ci variants). This eliminates
the need for maintaining explicit suffix lists in the regex.

Smart SKU selection via score_sku_quality() now automatically
chooses the best variant when multiple SKUs exist for the same
version. This prefers Gen2 and LVM variants, so RHEL 8.0 now
selects 8-lvm-gen2 and RHEL 9.0 selects 9-lvm-gen2 instead of
basic Gen2 SKUs.

Friendly names are simplified to hide implementation details.
Instead of "RHEL 8.0 (x86) Gen2", users see "RHEL 8.0 (x86)",
while the system internally selects the optimal SKU. This reduces
the number of visible RHEL versions from 49 to 38 by consolidating
duplicate variants.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
Similar to the RHEL and Oracle Linux improvements, remove Gen2
implementation details from SUSE friendly names. The previous
generic version extraction code added Gen2 suffixes to friendly
names inconsistently, causing some SUSE versions to display
Gen2 while others did not.

The generic Pattern 6 code had conditional logic that added Gen2
to friendly names for x86_64 gen2 SKUs, but only when processing
offers that fell through to the generic handler. SUSE-specific
patterns for SLES and openSUSE did not add Gen2, creating
inconsistencies where SUSE 12 and 15 showed Gen2 but SUSE 12 SP5
and 15 SP2 did not.

Removing the Gen2 suffix from the generic code ensures all SUSE
versions have consistent friendly names. Instead of SUSE Linux
Enterprise 12 Gen2 and SUSE Linux Enterprise 15 Gen2, users now
see simplified names without implementation details. The system
continues to select optimal Gen2 SKUs via score_sku_quality, but
hides these details from user-facing names.

This maintains consistency with the RHEL and Oracle Linux
improvements where Gen2, LVM, and other SKU variants are selected
automatically but not exposed in friendly names.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>
@chucklever chucklever merged commit 979cadd into main Dec 1, 2025
22 checks passed
@chucklever chucklever deleted the cel/azure-cloud-config branch December 1, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants