Error modifying LXD VM devices for stateful snapshoting


I am trying to improve the performance of my LXD VM machines by using stateful snapshoting. I want to reset the VM after each task to handle a new request.

I tried to create a new LXD VM with stateful snapshoting using the following command:

lxc init vm-image worker-x --vm  -c limits.memory=3GiB -c migration.stateful=true

// now set size.state:
lxc config device set worker-x root size.state 3GiB

However, when I try to set the size.state configuration key for the root device, I get the error Device from profile(s) cannot be modified for individual instance. Override device or modify profile instead. The default LXD profile has a root device defined. How can I modify the device to make stateful snapshoting work?

Here is the default profile generated during LXD installation:

config: {}
description: Default LXD profile
    name: eth0
    network: lxdbr0
    type: nic
    path: /
    pool: default
    type: disk
name: default

Any help or guidance on this issue would be appreciated. Thank you.


need size.state=3GiB not size.state 3GiB

Use override rather than set.

1 Like
lxc config device override worker-x root size.state 3GiB


Error: No value found in "size.state"

Worked. thanks!

lxc config device override worker-x root size.state=3GiB

size.state=3GiB not size.state 3GiB

1 Like