Date: Wed, 15 May 2019 08:40:21 -0700 From: George Hartzell <hartzell@alerce.com> To: Matthew Seaman <matthew@FreeBSD.org> Cc: freebsd-questions@freebsd.org Subject: Re: Suggestions for working with unstable nvme dev names in AWS Message-ID: <23772.13029.749106.980869@alice.local> In-Reply-To: <86623e16-744e-e366-5049-70ef69ea81df@FreeBSD.org> References: <23770.10599.687213.86492@alice.local> <08660a2a-489f-8172-22ee-47aeba315986@FreeBSD.org> <23770.58821.826610.399467@alice.local> <20190514210203.3d951fb8.freebsd@edvax.de> <23771.5612.105696.170743@alice.local> <eb1d290e48b4ba21ab350044b25592525e61457c.camel@smormegpa.no> <23771.11429.855191.658934@alice.local> <86623e16-744e-e366-5049-70ef69ea81df@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Seaman writes: > On 14/05/2019 22:01, George Hartzell wrote: > > But when I boot, I find that I have two devices (in addition to the > > root device), `/dev/nvme1` and `/dev/nvme2`. There's no way to know > > which is the big-slow one that I wanted to call `/dev/sdh` and which > > is the small-fast `/dev/sdz`. In fact, if I reboot the machine, > > sometimes the big-slow one will be `/dev/nvme1` and sometimes it will > > be `/dev/nvme2`. > > > > Given that situation, how do you write an automated script that will > > label the big-slow one `backups` and the small-fast one `speedy`? > > This is a pretty difficult problem. Unless AWS can supply some sort of > identification of the device [...] *BINGO*. AWS stores the device names that you requested when you created the device somewhere inside it. It's available via an ioctl (I believe) in the Linux kernel and is easily accessed via a python script named `ebsnvme-id` [2]. AWS has documented it all here [1], in the "Identifying the EBS Device" section. So, when the system boots, it uses a udev rule (like our devd) to run the script and make the symlinks that make everything else straight forward. I can't figure out how to get at the info via `nvmcontrol` or `camcontrol` and the linux script doesn't work as is (which is not surprising). I suspect that our nvme/nvd driver would need to have support added for this, but was/am hopeful it's already a solved problem. g. [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html [2]: https://gist.github.com/lbernail/d851e5b06eb32180a4b8ead2ce4f45db
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?23772.13029.749106.980869>