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
MachineisReady:kubectl -n <moskClusterProject> get machine <machineName> -o jsonpath='{.status.phase}{"\n"}'
Substitute
<moskClusterProject>with the cluster namespace and<machineName>with the machine name.Obtain storage details for the
Machine:kubectl -n <moskClusterProject> 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
byIDslist from thestatus.providerStatus.hardware.storagesection that containsserialNumberand does not containwwnas a bus ID.In the example above, for the disk with the
/dev/sdcname, you can use the/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_2e52abb48862dbdcsymlink as a persistent identifier of the storage device because it contains the2e52abb48862dbdcserial number and does not containwwn.Note
Do not rely on the
byIDfield only. This field may contain a/dev/disk/by-id/wwnsymlink that cannot be considered a persistent identifier of a storage device.