Provision Docker Storage on a Dedicated Block Device: Difference between revisions
No edit summary |
|||
Line 13: | Line 13: | ||
The procedure will create a /dev/sdb1 partition. | The procedure will create a /dev/sdb1 partition. | ||
[[Wipefs#Erase_all_Signatures|Erase all signatures]] from the partition | [[Wipefs#Erase_all_Signatures|Erase all signatures]] from the partition: | ||
<pre> | |||
</pre> | |||
[[Vgcreate#Create_a_Volume_Group|Create the volume group]], conventionally named "docker_vg", using the partition prepared by the previous steps /dev/sdb1 | [[pvcreate#Initialize_Partition_for_use_by_LVM|Initialize the partition for use by LVM]]: | ||
<pre> | |||
</pre> | |||
[[Vgcreate#Create_a_Volume_Group|Create the volume group]], conventionally named "docker_vg", using the partition prepared by the previous steps /dev/sdb1: | |||
<pre> | |||
</pre> | |||
<font color=red> | <font color=red> |
Revision as of 17:53, 23 May 2017
Internal
Overview
Procedure
Provision an unformatted block device. For this example, it will be referred to as /dev/sdb.
Create one partition that spans the entire device. Either fdisk or sfdisk can be used. This is how the partition is created with fdisk.
The procedure will create a /dev/sdb1 partition.
Erase all signatures from the partition:
Initialize the partition for use by LVM:
Create the volume group, conventionally named "docker_vg", using the partition prepared by the previous steps /dev/sdb1:
Assuming STORAGE_DRIVER=devicemapper. Inquire on STORAGE_DRIVER=overlayfs or STORAGE_DRIVER=overlayfs2. Repeat the procedure? What is the difference in behavior?
Write /etc/sysconfig/docker-storage:
DOCKER_STORAGE_OPTIONS="--storage-driver device mapper ${dm_fs} --storage-opt dm.thinpooldev=$POOL_DEVICE_PATH $(get_deferred_removal_string) $(get_deferred_deletion_string) ${EXTRA_DOCKER_STORAGE_OPTIONS}"
Continue with /Users/ovidiu/projects/openshift/docker-storage-setup, function: setup_storage()
Verify your configuration. You should have a dm.thinpooldev value in the /etc/sysconfig/docker-storage file and a docker-pool logical volume:
# cat /etc/sysconfig/docker-storage DOCKER_STORAGE_OPTIONS=--storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=/dev/mapper/docker--vg-docker--pool # lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert docker-pool rhel twi-a-t--- 9.29g 0.00 0.12
Before using Docker or OpenShift Container Platform, verify that the docker-pool logical volume is large enough to meet your needs. The docker-pool volume should be 60% of the available volume group and will grow to fill the volume group via LVM monitoring.