cockpit-machines
cockpit-machines copied to clipboard
Attach block device as a disk
Discussed in https://github.com/cockpit-project/cockpit-machines/discussions/746
Originally posted by pgmillon June 28, 2022 Hi, this is probably a dumb question since I'm not too familiar with qemu/cockpit: is it possible to attach a SATA device to a VM ? I already successfully attached a USD drive via the Host devices panel but I'm looking to attach /dev/sda & /dev/sdc and I'm not sure how to do that using cockpit-machines.
$ sudo lsscsi
[0:0:0:0] disk ATA ST1000DM010-2EP1 CC46 /dev/sda
[1:0:0:0] disk ATA INTEL SSDSC2BW12 DC32 /dev/sdb
[2:0:0:0] disk ATA ST1000DM010-2EP1 CC46 /dev/sdc
```</div>
Libvirt offers possibility to attach block device directly as a disk (see docs) We can expose this in the UI
Oh, I assumed we had this already. We definitely should support block devices.
Now the questions are:
- Is extending the file picker for a disk image obvious enough so that it'd support block devices as well? (We should definitely support this, as we should be able to tell if something is a block device or a disk image file — even if we have a more "proper" UI too.)
- Do we need to add a mode which shows available block devices?
If we do show just block devices:
- Instead of
lsscsi
(which isn't installed by default in Fedora Silverblue at least, and probably in other places), we probably should use something likelsblk
(or some native systemd API if it exists). - We shouldn't show things like zram / zswap.
- This can get tricky with subvolumes in various filesystems, like btrfs.
Truenas vm also create zfs zvol for vm disk (a block device),currently cockpit recognite the zvol but can't attach disk corretly.