Skip to content

Ebs: Consider EC2 block device mappings for initiator device names - #509

Open
mateo-moon wants to merge 1 commit into
LINBIT:masterfrom
mateo-moon:fix/ebs-initiator-nitro-device-names
Open

Ebs: Consider EC2 block device mappings for initiator device names#509
mateo-moon wants to merge 1 commit into
LINBIT:masterfrom
mateo-moon:fix/ebs-initiator-nitro-device-names

Conversation

@mateo-moon

Copy link
Copy Markdown

Fixes #508.

Problem

On instances built on the AWS Nitro system, attached EBS volumes are exposed by the NVMe driver as /dev/nvme*n1. EbsInitiatorProvider.findUnusedDevice() prunes candidate device letters only from lsblk kernel names with sd/xvd prefixes, so on Nitro nothing is ever pruned, the descending scan always returns z, and every attach requests /dev/sdz. The first attach per instance succeeds; every further concurrent attach fails permanently with InvalidParameterValue ("Attachment point /dev/sdz is already in use") — limiting EBS_INIT nodes to a single attached volume. Details and live transcript in #508.

Fix

Additionally prune the letters of device names that EC2 itself reports as used in the instance's block device mappings (DescribeInstancesblockDeviceMappings[].deviceName). This is authoritative regardless of guest-side device naming, and also covers device names EC2 returns without the /dev/ prefix. The lsblk-based pruning is kept for the pre-Nitro/Xen case.

Testing

On instances built on the AWS Nitro system, attached EBS volumes are
exposed by the NVMe driver as /dev/nvme*n1, so pruning the candidate
device letters from lsblk kernel names with "sd"/"xvd" prefixes never
removes anything and every attach requests /dev/sdz. The first attach
per instance succeeds; any further attach fails permanently with
InvalidParameterValue ("Attachment point /dev/sdz is already in use"),
limiting EBS_INIT nodes to a single attached volume.

Additionally prune the letters of device names that the EC2 API reports
as used in the instance's block device mappings, which is authoritative
regardless of guest-side device naming.

Fixes LINBIT#508
@mateo-moon

Copy link
Copy Markdown
Author

E2E-validated live on a 3-AZ Kubernetes cluster (arm64/Nitro, v1.34.1 base + all four of our EBS fix PRs): full validation report in #506 (comment) (latest comment). Highlights relevant to this PR are listed there; the four fixes together make native EBS work end-to-end on latest.

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.

EBS initiator always requests /dev/sdz on Nitro instances — only one EBS attach per node possible

1 participant