Docker Community Forums

Share and learn in the Docker community.

Storage Driver: direct lvm configuration with UUID on Azure VM

azure

(Poitschkka01) #1

Hello,
I have an Azure VM where I configured docker version 17.09.00 CE with direct-lvm.
This is my /etc/docker/daemon.json file:
{
“storage-driver”: “devicemapper”,
“storage-opts”: [
“dm.directlvm_device=/dev/sdc1”,
“dm.thinp_percent=95”,
“dm.thinp_metapercent=1”,
“dm.thinp_autoextend_threshold=80”,
“dm.thinp_autoextend_percent=20”,
“dm.directlvm_device_force=true”
]
}

As you can see, I use the partition /dev/sdc1.
We learned it the hard way that Azure has no stable /dev/xxxx devices. After a reboot the device name can be different.
In /etc/fstab we use the UUID instead, because the UUID is stable.

I tried to replace /dev/sdc1 with the UUID of the partition but docker won’t start after the change.
Tried different formats
"dm.directlvm_device=",
or
"dm.directlvm_device=UUID=",

no luck.

Questions:
Is it possible to use the UUID of the partition instead of /dev/sdc1 and how?

I’m not an expert in LVM thats why I try to go with direct-lvm configuration. devicemapper is the recommended storage driver for RedHat/CentOS according to the documentation.