Skip to content

Fix nvme instance storage discovery#407

Draft
Ivaylogi98 wants to merge 11 commits intocloudfoundry:fix-nvme-instance-storage-discoveryfrom
Ivaylogi98:fix-nvme-instance-storage-discovery
Draft

Fix nvme instance storage discovery#407
Ivaylogi98 wants to merge 11 commits intocloudfoundry:fix-nvme-instance-storage-discoveryfrom
Ivaylogi98:fix-nvme-instance-storage-discovery

Conversation

@Ivaylogi98
Copy link
Copy Markdown

@Ivaylogi98 Ivaylogi98 commented Feb 23, 2026

Refactor NVMe instance storage discovery to be IaaS-agnostic

Refactors #396 to address review feedback from @rkoster.

What changed from #396

IaaS-agnostic design — the AWS-specific awsNVMeInstanceStorageResolver and its hardcoded EBS pattern are replaced by a generic SymlinkDeviceResolver in infrastructure/devicepathresolver. The managed volume
pattern (/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_) and device pattern (/dev/nvmen1) are passed in entirely via agent config (InstanceStorageManagedVolumePattern, InstanceStorageDevicePattern), set by
the stemcell builder's bosh_aws_agent_settings stage — not hardcoded in the resolver.

udev race condition fixed — the original PR globbed /dev/disk/by-id/ symlinks without waiting for udev to finish creating them. On fast boots, this returned 0 EBS symlinks, causing all NVMe devices (including
the root EBS volume) to be misidentified as instance storage. udevadm trigger + udevadm settle are now called before globbing.

Unit tests fixed — all compilation errors and test failures from #396 are resolved.

Algorithm

  1. Glob all NVMe devices: /dev/nvme*n1
  2. Run udevadm trigger + udevadm settle
  3. Glob EBS symlinks via InstanceStorageManagedVolumePattern
  4. Resolve each symlink to its target device
  5. Subtract EBS devices from all NVMe → remainder is instance storage
  6. Partition only the discovered instance storage devices

Verified using m6id.large

Enabled raw_instance_storage: true

3 NVMe devices present:

  • /dev/nvme0n1 — root EBS (5G) → correctly excluded
  • /dev/nvme1n1 — ephemeral EBS (50G) → correctly excluded
  • /dev/nvme2n1 — instance storage (118G) → correctly discovered and set up as raw ephemeral

Used Claude Code

@Ivaylogi98 Ivaylogi98 force-pushed the fix-nvme-instance-storage-discovery branch from b79e5c1 to 6ab6cd7 Compare February 25, 2026 12:41
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 832607d3-addc-41e2-8139-bd35b0cbc0d5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant