The problem is juju blindly applying lxd-profile.yaml [0] shipped by the charm even if this does not make sense for a KVM (even if on top of LXD)
The solution can be either:
a) ignore lxd-profile.yaml if machine constraints have `virt-type=virtual-machine`
b) use a separate lxd profile like lxd-vm-profile.yaml to be used for LXDs with constraint `virt-type=virtual-machine`
A way to reproduce without juju is
```
lxc launch ubuntu:jammy v1 --vm
lxc profile set default linux.kernel_modules=foo
Error: The following instances failed to update (profile change still saved):
- Project: default, Instance: v1: Key "linux.kernel_modules" cannot be updated when VM is running
echo $?
1
```
The problem is juju blindly applying lxd-profile.yaml [0] shipped by the charm even if this does not make sense for a KVM (even if on top of LXD)
The solution can be either:
a) ignore lxd-profile.yaml if machine constraints have `virt-type= virtual- machine`
b) use a separate lxd profile like lxd-vm-profile.yaml to be used for LXDs with constraint `virt-type= virtual- machine`
A way to reproduce without juju is
``` modules= foo kernel_ modules" cannot be updated when VM is running
lxc launch ubuntu:jammy v1 --vm
lxc profile set default linux.kernel_
Error: The following instances failed to update (profile change still saved):
- Project: default, Instance: v1: Key "linux.
echo $?
1
```
Links: /github. com/canonical/ charm-microk8s/ blob/master/ lxd-profile. yaml
0. https:/