Increase the disk space of a container

Hi,
While initializing lxd init I had set my disk-space for zfs filesystem as 100GB. Now whenever I create my a new conainer…they all take the sapace of 100GB. I want to increase the size of a individual container.
Is it possible to do?
How do I do it?

Thanks

Hi,
By default the new container has no limit and if you do df -h inside the container you’'ll see all free space in the storage backend. I think you want to limit the resources and you can do it, for example, using profiles:

$ lxc profile create limites
$ lxc profile edit limites
config:
limits.cpu: "1"
limits.cpu.allowance: 30%
limits.memory: 300MB
description: Perfil con limites
devices:
   root:
   path: /
   pool: default
   type: disk
   size: 12GB
name: limites
used_by: []
$ lxc launch ubuntu:x container00 -p default -p limites

In this example, the container can use 1 cpu (máx 30%), RAM max 300 MB and 12GB for the hard disk.
Look at lxc profile add and lxc profile assign in order to add/assign profiles to the conainers.
More info: https://blog.ubuntu.com/2016/03/30/lxd-2-0-resource-control-412?_ga=2.19947768.1105037509.1540738312-912044088.1539901341

Salutes

2 Likes