`microceph disk list` doesn't show virtio drives available
microceph 19.2.0+snap9ecc402e1e 1280 squid/edge canonical✓ -
Coming from a Sunbeam issue: https://bugs.launchpad.net/snap-openstack/+bug/2095570 and I believe this microceph issue is the root cause of it. The scenario is mainly for the testing purpose though.
How to reproduce.
uvt-simplestreams-libvirt sync release=noble arch=amd64
uvt-kvm create --cpu 4 --memory 4096 --ephemeral 16 foo release=noble
uvt-kvm wait foo
uvt-kvm ssh foo
/dev/vdc is un-partitioned and unused.
$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
vda
├─vda1 ext4 1.0 cloudimg-rootfs 314dc64b-478e-4831-8f35-5640abff7e09 5.1G 24% /
├─vda14
├─vda15 vfat FAT32 UEFI 53CC-ADDA 98.2M 6% /boot/efi
└─vda16 ext4 1.0 BOOT eb7ca90e-1f45-4605-a740-d47fe1f8e5b3 757.8M 7% /boot
vdb iso9660 Joliet Extension cidata 2025-02-09-12-17-59-00
vdc
But no disk is detected by microceph.
sudo snap install microceph --channel squid/edge
sudo microceph cluster bootstrap
$ sudo microceph disk list --json
{"ConfiguredDisks":[],"AvailableDisks":[]}
Thank you for reporting your feedback to us!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CEPH-1169.
This message was autogenerated
Even though virtio drives do not show up as available disks, those virtio drives can be initiated as OSDs since there is no cross-check with available disks in disk add (https://github.com/canonical/microceph/issues/507).
$ sudo microceph disk list
Disks configured in MicroCeph:
+-----+-------------------+-------------------------------------------+
| OSD | LOCATION | PATH |
+-----+-------------------+-------------------------------------------+
| 1 | sunbeam-machine-1 | /dev/disk/by-path/virtio-pci-0000:06:00.0 |
+-----+-------------------+-------------------------------------------+
Available unpartitioned disks on this system:
+---------------+-----------+------+-------------------------------------------------+
| MODEL | CAPACITY | TYPE | PATH |
+---------------+-----------+------+-------------------------------------------------+
| QEMU HARDDISK | 128.00GiB | scsi | /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001 |
+---------------+-----------+------+-------------------------------------------------+
vdc(/dev/disk/by-path/virtio-pci-0000:06:00.0) was unavailable but was initiated successfully as OSD. But vdd(/dev/disk/by-path/virtio-pci-0000:07:00.0) doesn't show up still.
$ lsblk -f /dev/vdc /dev/vdd
NAME
FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
vdc ceph_bluestore
vdd
MicroCeph filtering out the virtio block device is a bug, it still allowing the disk to be enrolled is as per intention (to allow for an operator to enroll a block device as OSD even if microceph does not deem it fit).
The fix should be to make microceph list the virtio disk as it is larger than the threshold for OSD devices (2GB).
I can reproduce this:
$ sudo apt -y install uvtool
$ sudo uvt-simplestreams-libvirt sync release=noble arch=amd64
$ sudo uvt-kvm create --cpu 4 --memory 4096 --ephemeral 16 foo release=noble
$ sudo uvt-kvm wait foo
$ sudo uvt-kvm ssh foo
$ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
vda 253:0 0 8G 0 disk
├─vda1 253:1 0 7G 0 part /
├─vda14 253:14 0 4M 0 part
├─vda15 253:15 0 106M 0 part /boot/efi
└─vda16 259:0 0 913M 0 part /boot
vdb 253:16 0 372K 0 disk
vdc 253:32 0 16G 0 disk
# install microceph and proceed
$ sudo snap install microceph
$ $ sudo microceph disk list --json
{"ConfiguredDisks":[],"AvailableDisks":[]}
$ sudo microceph disk add /dev/vdc
+----------+---------+
| PATH | STATUS |
+----------+---------+
| /dev/vdc | Success |
+----------+---------+