I tried creating a new container, using incus 6.14, using default install (I used the alpine-feature package). I created a new profile called “external” net where I set the # of cpus to a number of 4. New containers still see ALL cpus on the system instead of seeing just the 4. Same for memory. Not sure what to do, cgroups are loaded, and the filesystem is mounted. I made the ‘unified’ change to alpine. Any commands I need to do to print out whats giong on? I can launch things fine, I did create the profile in the gui.
name: externalnet
description: Things that are external via macvlan
devices:
eth0:
network: macvlan
type: nic
root:
path: /
pool: default
size: 20GiB
type: disk
config:
limits.cpu: '4'
limits.memory: 4GiB
project: default
Neither of these work. I still get TONS of cpus (on this system I have 40 which I can see in the system when I create it. Networking is macvlan and seems to work fine.
My mount options to prove cgroups are happy:
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
Where should I put this using the cli? I added to the vm in config section, and still see LOTS of processors. You are right, however, in that ONLY 4 were being able to be used so its not the end of the world. Is the above config option done using incus config set <vmname> security.syscalls.intercept.sysinfo=true ? I did try and powered down the machine, and still all the processors show up. Not a biggie, since its enforcing the 4 processor limit.
I did launch it as per your directions. I used alpine linux 3.22 rather than edge, but it seems that either the system I am using is too old (its a vintage 2012 server) or running incus on alpine as a base os works differently. I can’t wait until your dedicated os comes out.
I also tried am alma linux container with the same results. Is there something unwise about using incus on a musl based system in bare metal? Is there a recommended os that you test on for bare metal given the strangeness I am seeing. Also the disks show the entire size of the volume.
which are the root filesystem. Do I need to do something to alpine HOST rather than GUEST to enable this? since I am HOSTING the guests on an alpine 3.22 bare metal?
Inside a container? Yes, that’s expected. The container is just a subdirectory of the host’s filesystem, so the whole space is available if required (unless you set a quota, which is only supported in certain drivers).
$ incus launch -s zfs images:ubuntu/24.04/cloud test
$ incus exec test -- df -h /
Filesystem Size Used Avail Use% Mounted on
zfs0/lxd/containers/test 133G 323M 132G 1% /
$ incus config device set test root size=10GiB
$ incus exec test -- df -h /
Filesystem Size Used Avail Use% Mounted on
zfs0/lxd/containers/test 11G 323M 10G 4% /
And worth noting that not all storage drivers can do quotas properly.
ZFS, LVM and Ceph will both set the quota and accurately report it.
btrfs will set it but not report it.
dir will only set and report it if projquota is available on the underlying filesystem which is usually a bit of an involved process to do it (tune2fs on the unmounted filesystem usually).
Just as a follow up, Incus and alpine 3.22 on my hardware absolutely hate each other. I switched to base debian 12 and everything is stable. People wanting to use alpine beware!
As another data point, I’ve been running Incus on Alpine for months with no issues (only VMs currently; no app or system containers), but it does seem that a Debian variant is going to be best in most cases.