I’ve been working with Docker this week, for an OpenShift v3 demo, and I’ve been struggling with storage for docker, so here are my notes, just in case anyonw needs the, or I do need them again.
Docker in RHEL7 is recommended to use devicemapper storage drive with thin provisioning. I was setting up some Vagrant boxes for my environment, and I was running into issues with pulling down of images never finishing, or errors while writing into the docker storage. It seems that my VM was created with a very small ammount of disc space for docker, so it could not properly run. This is how I diagnosed the problem and how I fixed it.
In order to use dm.thinpooldev you must have an LVM thinpool available, the docker-storage-setup package will assist you in configuring LVM. However you must provision your host to fit one of these three scenarios :
Root filesystem on LVM with free space remaining on the volume group. Rundocker-storage-setupwith no additional configuration, it will allocate the remaining space for the thinpool.
A dedicated LVM volume group where you’d like to reate your thinpool
As I didn’t have enough free space in my VG and I couldn’t unmountLogVol00to reduce the size what I did was:
Add a second drive to the KVM VM (With VirtManager, although virsh should work the same)
Add the PV
Resize the VG to consume the just added PV
Resize the docker LV (easier)
Delete the docker LV and recreate it.
Delete the docker LV
rerun the docker-storage-setup to reconfigure the docker LV to have all the added space
Add a second drive to the KVM VM
With Virt Manager, Just select the VM to where you want to add the drive, "open the terminal for the VM", press configuration (the light bulb), and click on "+ Add Hardware". Select the size, and VirtIO as the bus.
Add the PV
To see the name of the new disc, you cancat /proc/partitions: