Set root.size via lxd-p2c

When migrating we can set container configurations via -c, but the devices section is out of scope it seems? My hack around this is to create a profile with the desired root.size and assign that via -p, but that creates a bunch of redundant profiles only differing by root.size:

./lxd-p2c https://host:443 test / -c “limits.memory=4GB” -p default-100GB

Is this the best way to go about this currently? Thoughts on allowing root.size to be arbitrarily set via another flag?


Yeah, for now that’s your only real option as normal device modification happen after container creation. lxd-p2c won’t know the container’s configuration until after it’s created so it doesn’t know what the root device may be called, making it impractical to override.

We could add a --storage-size option but this would be dependent on you also passing --storage as otherwise we wouldn’t be able to generate the LXD configuration.

Hi Stéphane,

Thanks for your response.

–storage-size would compliment --storage quite nicely.

1 Like

Tested this out today, works like a charm.

Thank you.

An example for others:

root@VM:~# ./lxd-p2c <container-name> / -c "limits.memory=4GB" --storage default --storage-size 65GB