Is there a way to change the default Incus VM limits.cpu without having to do that command for each VM created

I know I can change the default limits.cpu for a specific individual Incus VM

But is there any way to configure Incus so that the default for alll VMs created use more than 1 cpu core?

Example configure Incus so that all Incus VMs by default get created with:

limits.cpu 4

With limits.cpu you can either specify how many CPUs should be allocated to a VM, or you can specify which individual CPUs (i.e. cores or threads) should be allocated to the VM.

It appears that you are asking how to specify a dynamic number of CPUs, perhaps based on load? I do not think that this is provided by Qemu.

Note that if you want to specify specific threads, specify those threads that are next to each other.

Have you tried setting limits.cpu in the default profile? (Or create a new profile with limits.cpu=4 and apply that to the VMs of interest)

Simos… no that’s not what I was asking.

I have 12 core in my Desktop. I’d would like to have every Incus VM I create be configured with 4 CPU and 8GB of Memory (ie limits.cpu and limits.memory) without having to specify that individually with each “incus launch” command or after a VM is running by doing “incus config set” on each VM.

Much like creating a setting in the Default Profile that every Container and VM utilizes.

@candlerb

Yes, I did try adding those to the Default Profile.

Then I created an Ubuntu VM.

incus launch images:ubuntu/24.04 vm1 --vm

After VM1 was created I executed:

incus config show vm1

and did not see limits.cpu or limits.memory listed?

So adding those to the Default Profile did not do what I was hoping!

That’s perfectly normal, incus config show will only show you the config keys that are directly applied to the instance, not those that are inherited from its profiles. That’s incus config show --expanded is for.

:blush: Hahaa another command option I had no idea existed.

It might be a good idea in the documentation for “incus profile edit” to add in the fact that you could put these limits limit.cpu, limits.memory etc in the Default Profile then verify using “incus config show – expanded”. Or maybe it is in the documentation and I just glazed over it. No matter, I’m glad the capabilitiy is there

I thought it was weird that despite editing the default Profile, saving the changes w no complaints but the limits were not showing up in “Incus config show vm1”

Thanks Stephane !