Skip to content

Ubuntu 22.04 Helper script not compatible with packer template #12354

Closed
@zaczekvol

Description

@zaczekvol

Description

When building runner image from below helper script
https://github.com/actions/runner-images/blob/main/helpers/CreateAzureVMFromPackerTemplate.ps1

we are getting errors from packer validate about missing parameters for Azure Compute Gallery. But these parameters are not specified in the helper script:

Validating packer template...
Error: 3 error(s) occurred:

  • A resource_group must be specified for shared_image_gallery_destination

  • An image_name must be specified for shared_image_gallery_destination

  • An image_version must be specified for shared_image_gallery_destination and must follow the Major(int).Minor(int).Patch(int) format

    on /home/runner/work/platform-github-runners/platform-github-runners/images/ubuntu/templates/ubuntu-22.04.pkr.hcl line 188:
    (source code not available)

Exception: /home/runner/work/platform-github-runners/platform-github-runners/helpers/GenerateResourcesAndImage.ps1:224
Line |
224 | throw "Packer template validation failed."
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Packer template validation failed.
Error: Error: The process '/usr/bin/pwsh' failed with exit code 1

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Image version and build link

2.325.0

Is it regression?

yes, the last version of the template that works https://github.com/actions/runner-images/blob/0f4b96df94cac45f1cfd89787208a244f2dab6be/images/ubuntu/templates/ubuntu-22.04.pkr.hcl

Expected behavior

Script builds the image

Actual behavior

Scripts throw an error during packer validate step

Repro steps

  1. Run CreateAzureVMFromPackerTemplate.ps1 with the required set of inputs

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions