Closed ricfeatherstone closed 5 years ago
Thinking this could be centos related I've tried on RHEL
# container-storage-setup
INFO: Volume group backing root filesystem could not be determined
INFO: Writing zeros to first 4MB of device /dev/xvdf
4+0 records in
4+0 records out
4194304 bytes (4.2 MB) copied, 0.0144646 s, 290 MB/s
INFO: Device node /dev/xvdf1 exists.
Physical volume "/dev/xvdf1" successfully created.
Volume group "docker-vg" successfully created
Again Docker is not setup to use the disk.
# df /var/lib/docker/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda2 10473452 2157192 8316260 21% /
What's going on here?
@rhvgoyal PTAL
I've had some success getting this to work
If I remove STORAGE_DRIVER=overlay2
and delete /etc/sysconfig/docker-storage
it runs ok, but this is using device mapper storage.
If I change the configuration as below it runs ok.
$ cat /etc/sysconfig/docker-storage-setup
STORAGE_DRIVER=overlay2
DEVS=/dev/xvdf
VG=docker-vg
CONTAINER_ROOT_LV_NAME=docker-pool
CONTAINER_ROOT_LV_MOUNT_PATH=/var/lib/docker
# container-storage-setup
INFO: Volume group backing root filesystem could not be determined
INFO: Writing zeros to first 4MB of device /dev/xvdf
4+0 records in
4+0 records out
4194304 bytes (4.2 MB) copied, 0.0156313 s, 268 MB/s
INFO: Device node /dev/xvdf1 exists.
Physical volume "/dev/xvdf1" successfully created.
Volume group "docker-vg" successfully created
Logical volume "docker-pool" created.
If you want overlay to use space from /dev/xvdf (and not from root filesystem), then you will have to carve out a logical volume from "docker-vg" volume group, create filesystem on it and mount it on /var/lib/docker and then start docker. container-storage setup can do all this for you if you specify extra options. For example.
CONTAINER_ROOT_LV_NAME="docker-root-lv" CONTAINER_ROOT_LV_SIZE="100%FREE" CONTAINER_ROOT_LV_MOUNT_PATH="/var/lib/docker"
Above will create a logical volume with name "docker-root-lv" from volume group docker-vg and use 100% of free space. Create filesystem on that logical volume and mount it on /var/lib/docker. It will also drop a systemd unit file so that it is mounted on every reboot.
Now if docker is started, it will setup its state in /var/lib/docker, and due to extra mount, all I/O will go to disk /dev/xvdf.
Centos7 Host on AWS trying to configure Docker to use an additional EBS volume for storage.
The physical volume and volume group are created but Docker is not configured to use them.
Is my configuration correct and if so any idea what's going wrong and what to do next to resolve?
Thanks