Hello,
It would be great to see some additional fields for disk devices coming back as Ansible facts.
In particular, disk serial number would be very useful for scripting partitioning and raid setup of
disks based on drive serial (reliable) rather than based on disk letter (such as sda) which is
subject to the random drive letter re-ordering that many sas controllers do.
Other facts that could be useful:
- Firmware Version - to help find drives, esp. SSD’s, that need firmware updates
- Both logical and physical sector sizes (may help in partitioning/raid/file system creation)
- LU WWN Device Id (not sure what it’s used for actually)
For reference, info from smartctl -a :
=== START OF INFORMATION SECTION ===
Device Model: ST240FP0021
Serial Number: Z5800FZA
LU WWN Device Id: 5 000c50 02ff17e7b
Firmware Version: B690
User Capacity: 240,057,409,536 bytes [240 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Sun Nov 16 15:08:13 2014 PST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Hey Ed,
Turns out John Stanton and you think alike. Here is his Pull Request adding serial numbers.
https://github.com/ansible/ansible/pull/9454
I am optimistic that this will get pulled.
Thank you,
Jon
After some more digging the LU WWN Device Id would be good to have also because some drives
apparently do have it printed on the label and therefore it would be useful for id’ing drives as well:
http://arstechnica.com/information-technology/2014/02/ars-walkthrough-using-the-zfs-next-gen-filesystem-on-linux/2/
"We can see each drive listed multiple times because they can be referred to multiple ways: by their wwn ID, by their model and serial number as connected to the ATA bus, or by their model and serial number as connected to the (virtual, in this case) SCSI bus. Which one should you pick? Well, any of them will work, including the super simple devicename (like /dev/sdb) itself, but you want to pick one that you can also see on the label on the physical drive. This is so you can be absolutely certain that you pull and replace the correct drive later, if one fails.
If your drive doesn’t show the wwn ID on the drive label, use the scsi-model-serial listing. If your drive does have the wwn ID printed visibly, I’d use that instead (just because it’s shorter). In this example, my drives do have the wwn printed visibly, so I’m going to use that."
Yeah it’s about time we start making facts stuff a bit more structured, and there’s also a balance to be made between facts returning quickly, or gathering everything.
It may make a good module to have seperately from the core - possibly a “disk_facts” type module (maybe in Galaxy), I don’t know.
But that’s a line we need to walk.