#nvme #ec2 #aws #aws-ec2 #system

nvme-amz

A library to probe NVMe devices in Amazon EC2

5 releases (3 breaking)

0.4.0 Oct 12, 2025
0.3.0 Sep 21, 2024
0.2.0 Sep 9, 2024
0.1.1 Sep 8, 2024
0.1.0 Sep 8, 2024

#9 in #ec2

Download history 36/week @ 2025-10-15 3/week @ 2025-10-22 303/week @ 2026-01-21 17/week @ 2026-01-28

320 downloads per month

MIT license

20KB
529 lines

nvme-amz

A Rust library to probe NVMe devices in Amazon EC2.

It provides functionality similar to that of the ebsnvme-id command but adds information about instance store devices, not only EBS.

To use this library, you must define one of the features ioctl-nix or ioctl-rustix. Either nix or rustix will be pulled in as dependencies, respectively. The chosen library is used to make ioctl system calls.

The library implements TryFrom<File> for Nvme, so this is how to interact with it. For example:

use nvme_amz::Nvme;

fn main() {
    let file = File::open("/dev/nvme0").expect("unable to open device");
    let nvme: Nvme = file.try_into().expect("unable to probe device");
    println!("{:?}", nvme);
}

Output for an EBS volume:

Nvme { names: Names { device_name: Some("sda"), virtual_name: None }, model: AmazonElasticBlockStore, vendor_id: VendorId(7439) }

Output for an instance store volume:

Nvme { names: Names { device_name: Some("sdb"), virtual_name: Some("ephemeral0") }, model: AmazonInstanceStore, vendor_id: VendorId(7439) }

Dependencies

~0–4.5MB
~109K SLoC