I have an Ubuntu VM with some virtual storage devices mounted and I want to map them to a docker container running there too. So I volumized the whole thing, mount points and also '/dev'. The devices do get recognized in the container, but for some reason lsblk -o SERIAL
inside the container doesn't return anything, when in the VM it does.
Also, running the python pyudev library functionality inside the container, I don't get the MODEL of the device either (in the VM I get the full info).
Anyone can shed light on why it happens? Thanks!
Device Mapper is a kernel-based framework that underpins many advanced volume management technologies on Linux. Docker's devicemapper storage driver leverages the thin provisioning and snapshotting capabilities of this framework for image and container management.
Control Groups (cgroups) are a feature of the Linux kernel that allow you to limit the access processes and containers have to system resources such as CPU, RAM, IOPS and network. In this lab you will use cgroups to limit the resources available to Docker containers.
It specifies the min free space in GB in a thin pool required for a new device creation to succeed. This check applies to both free data space as well as free metadata space. Container creation (during docker pull or docker run ) fails if free space in thin pool is less than the value in Thin Pool Minimum Free Space .
After some investigation, found out that smartctl
from smartmontools
library solves the issue (apt-get install smartmontools
). Returns both the MODEL and SERIAL of the devices, from inside the docker container, as opposed to lsblk
and lshw
.
As I was using python to query the devices for the info, the appropriate wrapper library for smartctl
is pySMART
(pip install pySMART
). Works like a charm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With