Skip to content

feat(runners): add volume_initialization_rate to block_device_mappings#5165

Open
slavab89 wants to merge 1 commit into
github-aws-runners:mainfrom
slavab89:feat/volume-initialization-rate
Open

feat(runners): add volume_initialization_rate to block_device_mappings#5165
slavab89 wants to merge 1 commit into
github-aws-runners:mainfrom
slavab89:feat/volume-initialization-rate

Conversation

@slavab89

@slavab89 slavab89 commented Jun 12, 2026

Copy link
Copy Markdown

Description

Add support for the volume_initialization_rate EBS parameter in launch templates. This allows configuring the provisioned rate (MiB/s) for volume initialization from snapshots, replacing the default lazy initialization (~5 MiB/s on first touch).

Changes:

  • modules/runners/variables.tf — add volume_initialization_rate = optional(number) to block_device_mappings object type
  • modules/runners/main.tf — pass through to ebs {} block in aws_launch_template
  • modules/multi-runner/variables.tf — mirror the type addition
  • variables.tf (root) — mirror the type addition

When unset (null), the attribute is omitted and AWS uses default behavior. No breaking changes.

Cost Implications

Provisioned Rate for Volume Initialization is a one-time charge per volume creation, billed as:

rate_for_region × snapshot_data_size_GiB × specified_rate

In us-east-1 at 300 MiB/s: ~$0.0036 per GiB of snapshot data per volume.

Example: a 500 GiB volume from a snapshot with 250 GiB of data at 200 MiB/s ≈ $0.60 per volume creation. This is an opt-in parameter (optional(number), default null) — users who don't set it pay nothing extra.

See EBS Pricing — Example 12.

Test Plan

  • terraform fmt -check passes on all modified files
  • terraform validate passes
  • Deployed with volume_initialization_rate = 200 on a gp3 volume created from a 568 GB snapshot; confirmed via aws ec2 describe-launch-template-versions that VolumeInitializationRate: 200 is present on the default version

Fixes #5163

@Brend-Smits Brend-Smits requested a review from Copilot June 12, 2026 09:16
@Brend-Smits

Brend-Smits commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hey @slavab89,

This sounds like a great addition! If I understand it correctly this will speed up the initial boot of a fresh runner right?

Nice work on the PR! Thank you 👍🏼
Please remember to sign/verify your commits so we can get this reviewed/merged.

@slavab89 slavab89 marked this pull request as ready for review June 12, 2026 09:17
@slavab89 slavab89 requested review from a team as code owners June 12, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the AWS Launch Template EBS volume_initialization_rate attribute by threading a new optional field through the block_device_mappings variable schema into the aws_launch_template ebs {} block, enabling faster snapshot-backed volume initialization for runner instances.

Changes:

  • Extend block_device_mappings object types to include volume_initialization_rate (optional number) at root, runners module, and multi-runner module.
  • Pass volume_initialization_rate through to the aws_launch_template.runner block_device_mappings.ebs configuration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
variables.tf Adds volume_initialization_rate to the root block_device_mappings input schema/description.
modules/runners/variables.tf Mirrors the schema/description change for the runners module input.
modules/runners/main.tf Wires volume_initialization_rate into the launch template EBS block device mapping.
modules/multi-runner/variables.tf Mirrors the schema change inside multi_runner_config.runner_config.block_device_mappings and updates its inline docs string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread variables.tf
Add support for the volume_initialization_rate EBS parameter in launch
templates. This allows configuring provisioned rate for volume
initialization (MiB/s) to accelerate EBS snapshot hydration on new
instances, instead of relying on the default lazy initialization.

See https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html
@slavab89 slavab89 force-pushed the feat/volume-initialization-rate branch from 3e18bbc to 8626fdd Compare June 12, 2026 09:30
@slavab89

Copy link
Copy Markdown
Author

Hey @Brend-Smits
Thank you very much for the swift reply!

That's correct, it can speed up initial boot time but also improve speeds of any scripts or workloads that you may have that interact with the EBS for the first time (i.e we've created an AMI with a lot of files that we need to read during PRs, this definitely speeds up the CI for us)
However, I did update the description in both the Issue and the PR to say that it is not free. The price is not high, generally speaking, but it is something to take into account

@Brend-Smits

Copy link
Copy Markdown
Contributor

Hey @Brend-Smits Thank you very much for the swift reply!

That's correct, it can speed up initial boot time but also improve speeds of any scripts or workloads that you may have that interact with the EBS for the first time (i.e we've created an AMI with a lot of files that we need to read during PRs, this definitely speeds up the CI for us) However, I did update the description in both the Issue and the PR to say that it is not free. The price is not high, generally speaking, but it is something to take into account

No worries!
That's great to hear. Do you you happen to have some ballpark numbers as to how much this has improved the initial boot time based on your testing?

I will try to get this PR reviewed soon.

@slavab89

Copy link
Copy Markdown
Author

Definitely, I've put them in the Issue #5165 assuming people will get there first. Broadly, the regular rate your get in AWS is ~5MiB/s for initial reads, so for 1 GiB, its going to take ~3 mins to read (serially) but with the 200 MiB/s, its going to be 5 seconds and cost you ~$0.002.

@edersonbrilhante

Copy link
Copy Markdown
Contributor

@slavab89 Can you also add support in the dynamic labels?

@slavab89

Copy link
Copy Markdown
Author

Unfortunatelly, this does not seem to be supported as part of FleetEbsBlockDeviceRequest Its only available through the Launch Template or RunInstances EbsBlockDevice

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.

Feature: Support volume_initialization_rate in block_device_mappings

4 participants