Fs layout for lxd hypervisor

I have to install a new server and I have to use it for LXD container and also some VM,
I think that some VM maybe larger, about 200G.
Which FS layout do you recommended and how may space for each FS?
Usually I use to have a small / and larger /var, but I understand that for now the /tmp folder is used for export and also import purpose, so it is reasonable to have a larger /tmp.

thanks

We’ve pushed a change today which will make LXD use the backups directory for imports so in combination with backups.storage_volume you’ll be able to store that on your normal storage pool.

If your host is only running LXD, I’d recommend a small-ish / (15-25GB) and everything else as a single partition that’s given to LXD for a ZFS storage backend (or btrfs if you prefer though for VMs, ZFS should be a bit nicer).

If you see other cases where the LXD daemon uses /tmp for backups/images, let us know and we’ll track them down as temp files under the respective directory which can be put onto the pool is definitely the way to go.

1 Like

Really thanks!!!
Yes, I only use LXD for windows VM for SQL server and ubuntu container.
How can I use the push that you did? Need to update snap version?
Or compile from source?
sudo snap list
Name Version Rev Tracking Publisher Notes
core 16-2.45 9289 latest/stable canonicalâś“ core
core18 20200427 1754 latest/stable canonicalâś“ base
lxd 4.0.1 15682 4.0/stable canonicalâś“ -
snapd 2.45.1 8140 latest/stable canonicalâś“ snapd

Also the operation of publish image is consuming a lot of space due the 10G dimension of VM and lead to a FS / full .
I have to open a pr?

I have only a question, do you think is earlier for use LXD VM for windows and larger SQL databases? About 1TB of storage or it is safest to use KVM?
I love lxd and want to use it

Yes if you are experiencing another issue where the /tmp directory is being filled up with an image operation please open an issue with the reproducer. Thanks

1 Like

I have to use the lastest snap version of the software to use the new setting?

Yes, you can use the edge snap channel. However be sure to not use this on a production system as we don’t guarantee you can downgrade safely, and you won’t want to remain on the edge channel indefinitely as that is the most risky channel (as it changes frequently).

1 Like

See Managing the LXD snap for more info.

unfortunately I have to use in a production system with VM windows of about 1T of disk space, but I need the /tmp just for publish the image and for some import/export.
I suppose to need a larger filesystem by now.

Please can you log an issue about that.

1 Like

As you can see:

lxc -v --debug publish win2016std --alias windows2016
DBUG[06-23|08:36:36] Connecting to a local LXD over a Unix socket
DBUG[06-23|08:36:36] Sending request to LXD method=GET url=http://unix.socket/1.0 etag=
DBUG[06-23|08:36:36] Got response struct from LXD
DBUG[06-23|08:36:36]

pwd
/tmp/snap.lxd/tmp/lxd_export_716836975
root@charles:/tmp/snap.lxd/tmp/lxd_export_716836975# ls -lrt
total 547740
-rw-r–r-- 1 root root 561512448 Jun 23 08:37 rootfs.img

and after about 5 minutes:
:/tmp/snap.lxd/tmp/lxd_export_716836975# ls -lrt
total 1603012
-rw-r–r-- 1 root root 1642227190 Jun 23 08:41 rootfs.img

So I open a new issue or reopen the last one?

A new issue please then we can discuss with @stgraber whether its appropriate to use the backup volume for these temporary files too. Thanks

1 Like