Deploying Microk8s charm on LXD KVMs fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Undecided
|
Unassigned |
Bug Description
This is happening in juju 3.1.2 deploying KVMs on top of an LXD cluster.
# Steps to reproduce:
1. Add machine
juju add-machine --constraints=
2. When machine is ready deploy Microk8s on it with:
juju add-unit microk8s --to <id-of-the-machine>
# Expected result:
Unit starts installing on the machine
# Actual result:
Machine goes to error state with message:
19 error 172.16.0.16 juju-657122-19 ubuntu@22.04 cannot upgrade machine's lxd profile: update failed: Key "linux.
# Workaround:
Stop the VM and then start with:
lxc stop --force juju-657122-19
lxc start juju-657122-19
and machine will no longer be in error state and once the KVM is running again unit will start installing on it.
description: | updated |
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:/