Question
How can I change the inodes limit for ploop containers?
Answer
Inodes limit is calculated on container disk creation or disk re-size operation, and it depends on container disk space limit and inode_ratio
value. A smaller inode_ratio
value leads to a bigger inodes limit for ploop container filesystem:
- inode_ratio=16384 will lead to a 10GB ploop with 655360 inodes.
- inode_ratio=8384 will lead to a 10GB ploop with 1281280 inodes.
You can change inode_ratio
value in /etc/mke2fs.conf
on the hardware node in order to change inodes limit for any new container. Apply the changes to [defaults]
section:
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
blocksize = 4096
inode_size = 256
inode_ratio = 16384
OS template cache re-creation is required to apply the new inode_ratio
value to be used for creating new containers:
# vzpkg remove cache centos-6-x86_64
# vzpkg create cache centos-6-x86_64
Note: It is impossible to change the inodes limit for existing ploop containers without formatting their file system. The only option is to increase the disk size limit of the corresponding ploop, so that inodes limit will be increased as well.