canonical / microceph

MicroCeph is snap-deployed Ceph with built-in clustering
https://snapcraft.io/microceph
GNU Affero General Public License v3.0
210 stars 33 forks source link

WAL/DB Devices appear as available devices for Disk List output. #296

Closed UtkarshBhatthere closed 7 months ago

UtkarshBhatthere commented 7 months ago

Issue report

As displayed in the output below, we can see that the disks albeit being used as WAL/DB devices appear as available disks in the disk list command output. This could be problematic since this a user may issue disk add --wipe for these disks.

ubuntu@juju-a06f22-mcu-0:~$ sudo microceph disk list
Disks configured in MicroCeph:
+-----+-------------------+---------------------------------------------+
| OSD |     LOCATION      |                    PATH                     |
+-----+-------------------+---------------------------------------------+
| 1   | juju-a06f22-mcu-0 | /dev/disk/by-id/virtio-7ae68416-c5f8-489a-a |
+-----+-------------------+---------------------------------------------+
| 2   | juju-a06f22-mcu-0 | /dev/loop5                                  |
+-----+-------------------+---------------------------------------------+

Available unpartitioned disks on this system:
+-------+----------+--------+---------------------------------------------+
| MODEL | CAPACITY |  TYPE  |                    PATH                     |
+-------+----------+--------+---------------------------------------------+
|       | 2.00GiB  | virtio | /dev/disk/by-id/virtio-748c628b-40e6-4e08-b |
+-------+----------+--------+---------------------------------------------+
|       | 2.00GiB  | virtio | /dev/disk/by-id/virtio-cad31649-91ab-4126-9 |
+-------+----------+--------+---------------------------------------------+
ubuntu@juju-a06f22-mcu-0:~$ sudo su
root@juju-a06f22-mcu-0:/home/ubuntu# ll /var/snap/microceph/common/data/osd/ceph-2/
total 72
...
lrwxrwxrwx 1 root root   10 Feb  9 08:04 block -> /dev/loop5
lrwxrwxrwx 1 root root   43 Feb  9 08:04 block.db -> /dev/disk/by-id/virtio-748c628b-40e6-4e08-b
lrwxrwxrwx 1 root root   43 Feb  9 08:04 block.wal -> /dev/disk/by-id/virtio-cad31649-91ab-4126-9
...

What version of MicroCeph are you using ?

channel=reef/edge

What are the steps to reproduce this issue ?

  1. Deploy and Bootstrap Microceph
  2. Invoke Disk Add command with --wal and --db params
  3. Invoke Disk List

What happens (observed behaviour) ?

WAL/DB Devices are being shown as available devices.

What were you expecting to happen ?

Used WAL/DB devices should not be shown as available devices.

Relevant logs, error output, etc.

NA

Additional comments.

NA

sabaini commented 7 months ago

In a similar vein, disk list will also include mounted disks, likely we want to exclude them as well for the "Available" list