common/blkdev, ceph-volume: improve get_device_id#25425
common/blkdev, ceph-volume: improve get_device_id#25425liewegas merged 5 commits intoceph:masterfrom
Conversation
ac0fd1e to
82ec5b0
Compare
|
That situation will be present on many versions of controllers. Why not having some sample udev output and test them in a TDD fashion so we can add more cases later while checking we don't break the format ? |
|
looks like there is some. oups. |
|
I have a couple of some devices from various hardware to offer : http://pastebin.test.redhat.com/679978 |
|
Looks like we need the output with |
|
Seems like there is some room to still get this incorrectly for some manufacturers. Are we fine by being correct in a bunch of cases and be uncertain about the rest? |
|
I agree. I don't think we really have a choice, though! It's either this, or we give up and use the WWID, which is just some hex gibberish. I think this will work for the vast majority of cases, and we can whittle away at the outliers over time. |
|
jenkins test ceph-volume tox |
a4fb76d to
ebb87be
Compare
jan--f
left a comment
There was a problem hiding this comment.
I guess we should've been surprised if things would just work...
This looks good to me. I suppose its good enough as long as we end up with something in dev_id.
ErwanAliasr1
left a comment
There was a problem hiding this comment.
This samples are about megaraid, perc & hpa controllers.
I added the Shared_PERC8 because its a pretty uncommon setup.
The PERC (raid controller) is part of the chassis of the blade server and configured on the chassis too.
Once the RAID array is setup, the logical volume is attached via the pci-express via an SR-IOV virtual device to the selected compute blade server.
The compute server detects a new megaraid controller that have a single logical volume attached too it.
This is where the shared is coming from. A single real raid controller on the chassis, shared to compute blades via an SR-IOV.
A few interesting cases: 1. autriche (my desktop) $ sudo udevadm info /dev/nvme0n1 | grep ID_ E: ID_PART_TABLE_TYPE=gpt E: ID_PART_TABLE_UUID=c83d5616-676b-4667-bcf3-c82fd4fc7e64 E: ID_SERIAL=Samsung SSD 960 EVO 250GB_S3ESNX0J958081E E: ID_SERIAL_SHORT=S3ESNX0J958081E - no ID_MODEL or ID_VENDOR -> use ID_SERIAL 2. my dev box gnit:~ (master) 09:09 AM $ udevadm info /dev/nvme0n1 | grep ID_ E: ID_FS_TYPE=xfs E: ID_FS_USAGE=filesystem E: ID_FS_UUID=860d4503-9c9d-4c24-af09-4266b7717a5c E: ID_FS_UUID_ENC=860d4503-9c9d-4c24-af09-4266b7717a5c E: ID_MODEL=INTEL SSDPEDMD400G4 E: ID_PATH=pci-0000:82:00.0-nvme-1 E: ID_PATH_TAG=pci-0000_82_00_0-nvme-1 E: ID_SERIAL=INTEL SSDPEDMD400G4_CVFT520200G7400BGN E: ID_SERIAL_SHORT=CVFT520200G7400BGN E: ID_WWN=nvme.8086-43564654353230323030473734303042474e-494e54454c205353445045444d443430304734-00000001 - no ID_VENDOR -> ID_MODEL + ID_SERIAL_SHORT gnit:~ (master) 09:12 AM $ udevadm info /dev/sda | grep ID_ E: ID_ATA=1 E: ID_ATA_DOWNLOAD_MICROCODE=1 E: ID_ATA_FEATURE_SET_HPA=1 E: ID_ATA_FEATURE_SET_HPA_ENABLED=1 E: ID_ATA_FEATURE_SET_PM=1 E: ID_ATA_FEATURE_SET_PM_ENABLED=1 E: ID_ATA_FEATURE_SET_SECURITY=1 E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=2 E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=2 E: ID_ATA_FEATURE_SET_SECURITY_FROZEN=1 E: ID_ATA_FEATURE_SET_SMART=1 E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 E: ID_ATA_ROTATION_RATE_RPM=0 E: ID_ATA_SATA=1 E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1 E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1 E: ID_ATA_WRITE_CACHE=1 E: ID_ATA_WRITE_CACHE_ENABLED=1 E: ID_BUS=ata E: ID_MODEL=INTEL_SSDSC2BB240G4 E: ID_MODEL_ENC=INTEL\x20SSDSC2BB240G4\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20 E: ID_PART_TABLE_TYPE=dos E: ID_PART_TABLE_UUID=bb35118c E: ID_PATH=pci-0000:00:1f.2-ata-1 E: ID_PATH_TAG=pci-0000_00_1f_2-ata-1 E: ID_REVISION=D2010355 E: ID_SERIAL=INTEL_SSDSC2BB240G4_BTWL3414034J240NGN E: ID_SERIAL_SHORT=BTWL3414034J240NGN E: ID_TYPE=disk E: ID_WWN=0x55cd2e404b4e47d8 E: ID_WWN_WITH_EXTENSION=0x55cd2e404b4e47d8 - no ID_VENDOR -> ID_MODEL + ID_SERIAL_SHORT 3. mira lab machine (old areca controller in JBOD mode, I think) root@mira055:~# udevadm info /dev/sdb | grep ID_ E: ID_BUS=scsi E: ID_MODEL=HUS724040ALA640 E: ID_MODEL_ENC=HUS724040ALA640\x20 E: ID_PART_TABLE_TYPE=gpt E: ID_PART_TABLE_UUID=957b2db6-de5c-46cb-a672-243fa12d55b2 E: ID_PATH=pci-0000:01:00.0-scsi-0:0:0:1 E: ID_PATH_TAG=pci-0000_01_00_0-scsi-0_0_0_1 E: ID_REVISION=R001 E: ID_SCSI=1 E: ID_SCSI_SERIAL=PN1334PBH5JMJS E: ID_SERIAL=2001b4d2058da3a00 E: ID_SERIAL_SHORT=001b4d2058da3a00 E: ID_TYPE=disk E: ID_VENDOR=HGST E: ID_VENDOR_ENC=HGST\x20\x20\x20\x20 - ID_VENDOR and ID_MODEL - ID_MODEL doesn't include vendor name + _ - ID_SERIAL and _SHORT are junk - ID_SCSI_SERIAL has the serial number! wth -> ID_VENDOR + ID_MODEL + ID_SCSI_SHORT Added a bunch of udevadm output samples. So, - if ID_VENDOR + ID_MODEL + ID_SCSI_SERIAL are present, use them. - if ID_MODEL + ID_SERIAL_SHORT are present, use them - if ID_SERIAL is present, use it. - fail Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
According to Ryan Meredith <rmeredith@micron.com>, the NVMes begin with MTFD, but their other devices use the standard Micron_$model_$serial. Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
The erwan1 one unfortunately has no model information :(. The other two work with the current implementation, although erwan.v1.sdb has "Shared_PERC8" for the model, and I suspect the Shared_ prefix is not part of the real model? Signed-off-by: Sage Weil <sage@redhat.com>
ebb87be to
eef391d
Compare
* refs/pull/25425/head: test/common/blkdev-udevadm-info-samples: add a few test cases ceph-volume: Micron SSDs don't include vendor name in ID_SERIAL common/blkdev: micron SSDs don't include vendor name in ID_SERIAL ceph-volume: update get_device_id to match in-tree implementation common/blkdev: improve device_id generation Reviewed-by: Jan Fajerski <jfajerski@suse.com>
|
The lack of tests for this is killing us :( These changes just broke everything in master for ceph-volume: The error is eaten up by argparse: |
Looks like @sebastian-philipp has just submitted #25469 to fix this. |
Sigh... the Areca controllers in the mira machines have weird results.
Also, my desktop doesn't have ID_SERIAL_SHORT, just ID_SERIAL. So, let's try a few different things!