Add instance storage discovery patterns in config#592
Conversation
WalkthroughThe 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 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
stemcell_builder/stages/bosh_aws_agent_settings/apply.sh
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 isnon-deterministic —
/dev/nvme0n1may 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 devicesInstanceStorageManagedVolumePattern: glob pattern matching EBS volume symlinks in/dev/disk/by-id/, used to identify and exclude EBS volumes from instance storagediscovery
Related
these patterns
This repository uses a "Merge Forward" strategy
Changes should be made in the earliest applicable branch, and
merged forward through subsequent branches.
ubuntu-<short_name>)merge-to-<next_short_name>branchubuntu-<short_name>intomerge-to-<next_short_name>merge-to-<next_short_name>intoubuntu-<next_short_name>