Comment 1 for bug 2024907

Revision history for this message
Giuseppe Petralia (peppepetra) wrote :

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
```

Links:
0. https://github.com/canonical/charm-microk8s/blob/master/lxd-profile.yaml