Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Expose primary disk ID through API and provider #1060

Open
Lillecarl opened this issue Dec 15, 2024 · 0 comments
Open

[Feature]: Expose primary disk ID through API and provider #1060

Lillecarl opened this issue Dec 15, 2024 · 0 comments

Comments

@Lillecarl
Copy link

What whould you like to see?

When infecting hosts with nixos-anywhere the block device order is all fuzzed. I figured out that the naming scheme for volumes is

scsi-0HC_Volume_101788715
scsi-0HC_Volume_$VOLUMEID

and the naming scheme for locally attached disks is

scsi-0QEMU_QEMU_HARDDISK_55932380
scsi-0QEMU_QEMU_HARDDISK_$NOT_SERVERID

When partitioning disks with "disko" (another nix tool) that builds your partition table we can't grep and guess on scsi-0QEMU_QEMU_HARDDISK_.+ sadly, we must provide the full device name.

It would be nice if block device id's are available through the API somehow so we can build an inventory ahead of time! 😄

[lillecarl@hetzner2:~]$ ls -lah /dev/disk/by-id/
total 0
drwxr-xr-x 2 root root 220 Dec 15 18:48 .
drwxr-xr-x 8 root root 160 Dec 15 18:48 ..
lrwxrwxrwx 1 root root   9 Dec 15 18:48 scsi-0HC_Volume_101788715 -> ../../sda
lrwxrwxrwx 1 root root   9 Dec 15 18:48 scsi-0QEMU_QEMU_HARDDISK_55932380 -> ../../sdb

I've compared the ID of my server with the ID of 0QEMU_QEMU_HARDDISK_.+ and it doesn't match.

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

No branches or pull requests

1 participant