Obtain a by-id symlink of a storage device¶
You can start using a storage device only after a corresponding Machine
becomes ready and accessible. Thus, KaaSCephCluster
can be created only
after all machines receive the status.providerStatus.hardware.storage
configuration containing all required device by-id
symlinks.
To obtain a device by-id symlink:
Verify that the
Machine
isReady
:kubectl -n <managedClusterProject> get machine <machineName> -o jsonpath='{.status.phase}{"\n"}'
Substitute
<managedClusterProject>
with the cluster namespace and<machineName>
with the machine name.Obtain storage details for the
Machine
:kubectl -n <managedClusterProject> get machine <machineName> -o yaml
Output example:
status: providerStatus: hardware: storage: - byID: /dev/disk/by-id/wwn-0x05ad99618d66a21f byIDs: - /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_05ad99618d66a21f - /dev/disk/by-id/scsi-305ad99618d66a21f - /dev/disk/by-id/scsi-SQEMU_QEMU_HARDDISK_05ad99618d66a21f - /dev/disk/by-id/wwn-0x05ad99618d66a21f byPath: /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0 byPaths: - /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0 name: /dev/sda serialNumber: 05ad99618d66a21f size: 61 type: hdd - byID: /dev/disk/by-id/wwn-0x26d546263bd312b8 byIDs: - /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_26d546263bd312b8 - /dev/disk/by-id/scsi-326d546263bd312b8 - /dev/disk/by-id/scsi-SQEMU_QEMU_HARDDISK_26d546263bd312b8 - /dev/disk/by-id/wwn-0x26d546263bd312b8 byPath: /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:2 byPaths: - /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:2 name: /dev/sdb serialNumber: 26d546263bd312b8 size: 32 type: hdd - byID: /dev/disk/by-id/wwn-0x2e52abb48862dbdc byIDs: - /dev/disk/by-id/lvm-pv-uuid-MncrcO-6cel-0QsB-IKaY-e8UK-6gDy-k2hOtf - /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_2e52abb48862dbdc - /dev/disk/by-id/scsi-32e52abb48862dbdc - /dev/disk/by-id/scsi-SQEMU_QEMU_HARDDISK_2e52abb48862dbdc - /dev/disk/by-id/wwn-0x2e52abb48862dbdc byPath: /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:1 byPaths: - /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:1 name: /dev/sdc serialNumber: 2e52abb48862dbdc size: 61 type: hdd
Obtain the item from the
byIDs
list from thestatus.providerStatus.hardware.storage
section that containsserialNumber
and does not containwwn
as a bus ID.In the example above, for the disk with the
/dev/sdc
name, you can use the/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_2e52abb48862dbdc
symlink as a persistent identifier of the storage device because it contains the2e52abb48862dbdc
serial number and does not containwwn
.Note
Do not rely on the
byID
field only. This field may contain a/dev/disk/by-id/wwn
symlink that cannot be considered a persistent identifier of a storage device.