4

I'm using LVM thinpool for docker storage (dm.thinpooldev) and I've run out of space on the meta data pool a few times so far. It's easy to combat as I can just recreate the thinpool with large metadata, but I'm just guessing (and probably over guessing) how big to make it.

Does anyone have any suggestions for relative size of meta data for Docker? It looks like the defaults in lvcreate aren't enough:

--poolmetadatasize MetadataVolumeSize[bBsSkKmMgG] Sets the size of pool's metadata logical volume. Supported values are in range between 2MiB and 16GiB for thin pool, and upto 16GiB for cache pool. The minimum value is computed from pool's data size. Default value for thin pool is (Pool_LV_size / Pool_LV_chunk_size * 64b). Default unit is megabytes.

The basic commands I'm using are:

DISK=/dev/xvdf
VG=docker_vg
LV=docker_pool
pvcreate $DISK
vgcreate $VG $DISK
lvcreate -l 100%FREE --thinpool $LV $VG

Or substitute an arbitrary meta data size

lvcreate -l 100%FREE --poolmetadatasize 200M --thinpool $LV $VG

[EDIT] Well, no response, so I'm just going with 1% for now. This is working for us so far, though probably still over-provisioned.

  DISK=/dev/xvdf
  VG=docker_vg
  LV=docker_pool
  DOCKER_POOL_METADATA_PERCENTAGE=1

  DISK_SIZE=$(blockdev --getsize64 ${DISK})
  META_DATA_SIZE=$(echo "scale=0;${DISK_SIZE}*${DOCKER_POOL_METADATA_PERCENTAGE}/100" | bc)
  pvcreate ${DISK}
  vgcreate ${DOCKER_VG} ${DISK}
  # This metadata sizing is in k because bytes doesn't seem to translate properly
  lvcreate -l 100%FREE --poolmetadatasize $((${META_DATA_SIZE}/1024))k --thinpool ${DOCKER_POOL} ${DOCKER_VG}
BeachGuru
  • 61
  • 1
  • 6
  • This is for convoy volume storage, not docker images/containers, but it's the only information I've found on the subject so far: https://github.com/rancher/convoy/blob/master/docs/devicemapper.md#calculate-the-size-you-need-for-metadata-block-device – Blake Mitchell May 04 '16 at 16:49

0 Answers0