English
« Back to projectatomic.io
Ask Your Question
0

Docker does not use a separate storage disk

asked 2015-01-11 02:17:09 +0000

alexclear gravatar image

updated 2015-01-11 02:20:06 +0000

I'm on a latest fedora-atomic update:

bash-4.3# ostree admin status
* fedora-atomic c5cf21a6c7445f9bd946987ba745d623620c463183e092cec5153784fe5de94f.0
    origin refspec: fedora-atomic:fedora-atomic/f21/x86_64/docker-host
  fedora-atomic ba7ee9475c462c9265517ab1e5fb548524c01a71709539bbe744e5fdccf6288b.0
    origin refspec: fedora-atomic:fedora-atomic/f21/x86_64/docker-host
bash-4.3#

I added a separate disk for /var/lib/docker:

bash-4.3# mount | grep /var/lib/docker
/dev/vdb1 on /var/lib/docker type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/vdb1 on /var/lib/docker/devicemapper type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
bash-4.3#

But Docker does not use this separate disk for storing images for some reason:

bash-4.3# docker info
Containers: 0
Images: 22
Storage Driver: devicemapper
 Pool Name: docker-252:17-67108992-pool
 Pool Blocksize: 65.54 kB
 Data file: /dev/atomicos/docker-data
 Metadata file: /dev/atomicos/docker-meta
 Data Space Used: 2.308 GB
 Data Space Total: 4.123 GB
 Metadata Space Used: 2.06 MB
 Metadata Space Total: 8.389 MB
 Library Version: 1.02.90 (2014-09-01)
Execution Driver: native-0.2
Kernel Version: 3.17.7-300.fc21.x86_64
Operating System: Fedora 21 (Twenty One)
CPUs: 2
Total Memory: 993.7 MiB
Name: zpa-local01.localdomain
ID: 7Q72:LSI5:UXHI:CXKZ:PYZ4:LNMS:I5FX:PWZG:6LPO:CPMJ:2LYJ:FYOA
bash-4.3#

The disk was set up according to http://www.projectatomic.io/docs/docker-storage-recommendation/ , did I miss something? It looks like newer Docker uses separate data/metadata disk mapper devices so the proper way to add storage is to extend a predefined atomicos LVM volume group, am I right?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2015-04-19 15:21:33 +0000

I don't use LVM in my setup thus atomic LVM allocation scheme is not used. In that case mounting /var/lib/docker, or even symlinking /var/lib/docker to /var/srv/docker works as described in docker documentation. The default is 100G but it could be adjusted with --storage-opt dm.loopdatasize=<new size, eg. 150G>. The downside is that you have to restart docker from scratch when that value changes.

docker info
Containers: 0
Images: 5
Storage Driver: devicemapper
 Pool Name: docker-8:3-7077891-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 706.4 MB
 Data Space Total: 161.1 GB
 Data Space Available: 160.4 GB
 Metadata Space Used: 1.27 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.146 GB
 Udev Sync Supported: true
 Data loop file: /var/srv/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/srv/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.93 (2015-01-30)
Execution Driver: native-0.2
Kernel Version: 4.0.0-0.rc5.git4.1.fc22.x86_64
Operating System: Fedora 22 (Twenty Two)
CPUs: 6
Total Memory: 2.446 GiB
edit flag offensive delete link more
0

answered 2015-04-13 11:28:08 +0000

sorry but:

# docker-storage-setup
-bash: docker-storage-setup: command not found

using centos7 host image here. Is there somewhere an up-to-date documentation we could follow?

edit flag offensive delete link more

Comments

If docker-storage-setup isn't available, you can use the normal method to add a new disk to a LVM volume. The rule of thumb math for meta-data volume size is roughly 1% of data. docker-storage-setup is a wrapper around the procedure and standard LVM commands.

nzwulfin ( 2015-04-16 14:19:54 +0000 )edit
0

answered 2015-01-14 14:58:18 +0000

Atomic is now using direct LVM for Docker devices, so there's a new utility make it easier to add storage. If you take a look a lvs output you should see docker-data and docker-meta as separate LVs.

  LV          VG       Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  docker-data atomicos -wi-ao----  9.83g                                                    
  docker-meta atomicos -wi-ao---- 16.00m                                                    
  root        atomicos -wi-ao----  1.95g

You can create /etc/sysconfig/docker-storage-setup and add a line like:

DEVS=/dev/vdb

and then run

docker-storage-setup

This should add the new device to the pool for Docker.

edit flag offensive delete link more

Comments

I've added a virtualbox vdi for this and edited "/etc/sysconfig/docker-storage-setup", but when I run "sudo docker-storage-setup", it's throwing an error "sfdisk: I don't like these partitions [...] use --force". The option doesn't work with docker-storage-setup (I assume it's for sfdisk?).

dsmithdewarcom ( 2015-04-14 20:04:48 +0000 )edit

Yes, that's sfdisk complaining about cylinder alignment on the partitions. Are you adding a whole disk or a single partition to the LV?

nzwulfin ( 2015-04-16 14:16:52 +0000 )edit

Disk. Interesting thing is "sudo docker info" appears to show the new space IS added to the lvm (or at least the data capacity is expanded by the same amount - 4GB). edit: nope, I checked the disk in gparted: it's still a bare drive with dos partition table.

dsmithdewarcom ( 2015-04-16 14:55:11 +0000 )edit

@nzwulfin by following this http://tinyurl.com/kpatscz I was able to manually add the disk to the atomicos lvg and /docker-data lv. The lv doesn't have a fs, so resize2fs fails. Is that a problem?

dsmithdewarcom ( 2015-04-16 16:16:47 +0000 )edit

The docker-data (and metadata) LV is used directly and won't have a filesystem (or need one).

nzwulfin ( 2015-04-20 14:04:51 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Follow
1 follower

Stats

Asked: 2015-01-11 02:17:09 +0000

Seen: 3,111 times

Last updated: Apr 19 '15