Skip to content

Add instance storage discovery patterns in config#592

Open
Ivaylogi98 wants to merge 1 commit into
cloudfoundry:ubuntu-jammyfrom
Ivaylogi98:ubuntu-jammy-add-instance-storage-patterns
Open

Add instance storage discovery patterns in config#592
Ivaylogi98 wants to merge 1 commit into
cloudfoundry:ubuntu-jammyfrom
Ivaylogi98:ubuntu-jammy-add-instance-storage-patterns

Conversation

@Ivaylogi98
Copy link
Copy Markdown

@Ivaylogi98 Ivaylogi98 commented May 4, 2026

Note: Should merge forward these changes to ubuntu-noble.

Summary

Adds two config fields to the AWS agent settings baked into the stemcell, required by
cloudfoundry/bosh-agent#407 (and subsequently by cloudfoundry/bosh-agent#396) to correctly discover NVMe instance storage on AWS Nitro
instances.

Background

On Nitro-based instances (e.g. m6id, i3en), NVMe PCIe enumeration order is
non-deterministic — /dev/nvme0n1 may be the root EBS volume, an attached EBS volume,
or instance storage depending on boot order. The bosh-agent now uses symlinks in
/dev/disk/by-id/ to identify and exclude EBS volumes, leaving only instance storage.

To keep the resolver IaaS-agnostic, the AWS-specific patterns are not hardcoded in the
agent binary — they are injected via agent config at stemcell build time.

Changes

stemcell_builder/stages/bosh_aws_agent_settings/apply.sh:

  • InstanceStorageDevicePattern: glob pattern matching all NVMe namespace devices
  • InstanceStorageManagedVolumePattern: glob pattern matching EBS volume symlinks in
    /dev/disk/by-id/, used to identify and exclude EBS volumes from instance storage
    discovery

Related

This repository uses a "Merge Forward" strategy

Changes should be made in the earliest applicable branch, and
merged forward through subsequent branches.

  1. Create a PR into the oldest branch (ubuntu-<short_name>)
  2. After this PR has been merged create a merge-to-<next_short_name> branch
  3. Merge ubuntu-<short_name> into merge-to-<next_short_name>
  4. Create a PR to merge merge-to-<next_short_name> into ubuntu-<next_short_name>
  5. Repeat as needed for subsequent branches

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Walkthrough

The apply.sh script in the bosh_aws_agent_settings stage has been updated to include additional configuration parameters in the generated agent.json file. Two new settings have been added to the Platform.Linux configuration: InstanceStorageDevicePattern (set to /dev/nvme*n1) and InstanceStorageManagedVolumePattern (set to /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_*). The existing UseMonitIptablesFirewall setting remains in place alongside these additions.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding instance storage discovery patterns to the AWS agent configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description comprehensively covers the purpose, background, technical changes, and includes the required merge-forward strategy guidance from the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@stemcell_builder/stages/bosh_aws_agent_settings/apply.sh`:
- Around line 15-16: The two config keys InstanceStorageDevicePattern and
InstanceStorageManagedVolumePattern are dead fields (not consumed by
bosh-agent); either remove them from the agent config output in apply.sh or
implement support in bosh-agent to consume them. To fix: if removing, delete the
two keys from the config generation in apply.sh and update any docs/tests; if
implementing, add parsing and use of
InstanceStorageDevicePattern/InstanceStorageManagedVolumePattern inside the
DevicePathResolver logic (respecting existing DevicePathResolutionType,
DIDTransformPattern and VolumeID matching semantics), add unit tests to
bosh-agent that verify matching/resolution against /dev/disk/by-id/ symlinks,
and update integration tests to exercise managed vs instance-storage resolution
paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 53804f69-c57a-4da5-8162-a0753a10bc96

📥 Commits

Reviewing files that changed from the base of the PR and between 265a297 and f8f6b3a.

📒 Files selected for processing (1)
  • stemcell_builder/stages/bosh_aws_agent_settings/apply.sh

Comment thread stemcell_builder/stages/bosh_aws_agent_settings/apply.sh
@github-project-automation github-project-automation Bot moved this from Inbox to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group May 4, 2026
@aramprice aramprice requested review from a team, Alphasite and fmoehler and removed request for a team May 7, 2026 14:43
@aramprice aramprice moved this from Waiting for Changes | Open for Contribution to Pending Merge | Prioritized in Foundational Infrastructure Working Group May 7, 2026
@beyhan beyhan moved this from Pending Merge | Prioritized to Pending Review | Discussion in Foundational Infrastructure Working Group May 21, 2026
@beyhan beyhan requested a review from neddp May 21, 2026 15:21
Copy link
Copy Markdown
Contributor

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

Adds AWS-specific BOSH agent configuration needed for NVMe instance storage discovery on Nitro-based EC2 instances.

Changes:

  • Adds a glob for NVMe namespace devices.
  • Adds a glob for AWS EBS /dev/disk/by-id symlinks so managed volumes can be excluded from instance storage discovery.

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

Comment on lines +15 to +16
"InstanceStorageDevicePattern": "/dev/nvme*n1",
"InstanceStorageManagedVolumePattern": "/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_*"
@aramprice
Copy link
Copy Markdown
Member

Double check that new agent config won't break agents that don't yet know how to consume it before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Review | Discussion

Development

Successfully merging this pull request may close these issues.

5 participants