Image Registry Directory Size is Increasing Continuously
Problem
Platform9 default image registry is increasing its size. As it contains multiple hash values for the images not in use. The default path for the same is "/opt/pf9/images/data/docker/registry/v2/blobs/sha256" directory.
Environment
- Platform9 Managed EdgeCloud - Airctl - 5.3.0
This is observed on the airclt version 5.3.0-2075501 - customer was trying to use this default Platform9 directory to store application images.
Cause
- Monitor the directory /opt/pf9/images/data/docker/registry/v2/blobs/sha256 .
- The default garbage collector doesn't clean up this directory as it is not owned by docker. This directory keeps increasing its size.
Resolution
There are two methods to resolve this issue:
- Remove the entire directory used by the registry and push just Platform9 images back in again.
- Resize the disk on the DU VM from the default 60G disk to further based on space available on the DU host.
Following are the steps for above two methods:
I. Remove the entire directory used by the registry and push just Platform9 images back in again.
- Run below commands inside the DU VM:
# rm -rf /opt/pf9/images/data/
# mkdir -p /opt/pf9/images/data/
# systemctl restart docker-registry
After registry is restarted:
- Run image push command from DU host:
# airctl push-images
Once images are pushed to DU VM, you can verify default images at "/opt/pf9/images/data/"
II. Resize the disk on the DU VM from the default 60G disk to further based on space available on the DU host.
- Set the
duDiskSize
field in airctl to desired value, this is supported in airctl. Update this values in "/opt/pf9/airctl/conf/airctl-config.yaml
" file. In our example we are trying to update it to 70G. It looks like below:
# duDiskSize: sets the disk size of the DU in bytes.
Optional suffixes:
# 'k' or 'K' (kilobyte, 1024), 'M' (megabyte, 1024k), 'G' (gigabyte, 1024M),
# 'T' (terabyte, 1024G), 'P' (petabyte, 1024T) and 'E' (exabyte, 1024P) are supported. 'b' is ignored. Default: 60G
# Set "-1" to skip resize
duDiskSize: 70G
- Once you have updated the values in airctl-config.yaml. Please run below command on DU host.
# qemu-img resize /opt/pf9/airctl/du.qcow2 70G
- Followed by airtctl stop and start
# /opt/pf9/airctl/airctl stop --config /opt/pf9/airctl/conf/airctl-config.yaml
# /opt/pf9/airctl/airctl start --config /opt/pf9/airctl/conf/airctl-config.yaml
Please verify if new size is getting reflected.