Repository navigation
[lxd] Change lxd endpoint - #4725
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/1.16 #4725 +/- ##
================================================
+ Coverage 89.28% 89.29% +0.01%
================================================
Files 259 259
Lines 15790 15795 +5
================================================
+ Hits 14097 14102 +5
Misses 1693 1693 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| QJsonObject config{{"limits.cpu", QString::number(desc.num_cores)}, | ||
| {"limits.memory", QString::number(desc.mem_size.in_bytes())}, | ||
| {"security.secureboot", "false"}}; | ||
| {"boot.mode", "uefi-nosecureboot"}}; |
There was a problem hiding this comment.
Is this still compatible with older LXD versions?
There was a problem hiding this comment.
Sadly it would only be compatible with >5.21, so no. We could remove this option and rely on the default if it works, but otherwise the APIs are not compatible.
There was a problem hiding this comment.
This is the only line for which it is the case, at least according to their docs
There was a problem hiding this comment.
Hahh, bummer. Do you know what the default is in versions 4, 5, and 6?
Users can probably configure the default too, but that is not super concerning for a backend that is going away anyway. I mean, users can probably revert it if they want to buy a couple more months with the LXD backend in Multipass. If they are attached to their LXD default, better move on to Multipass with QEMU or just stick to LXD directly.
The alternative would be to query LXD for the version and use the appropriate JSON line. But that is new development, which is nagging. I guess we could try if it's a small change? WDYT?
There was a problem hiding this comment.
I will look into it, should be feasible
|
There is still a number of versions that are untested, in which the APIs could be not compatible with this patch. I tested with 5.21/stable, 6/stable, 5.0/stable, and it worked for all of them. |
jimporter
left a comment
There was a problem hiding this comment.
I tested this out locally, and this works fine with latest/stable for LXD, but not 5.21/stable. I get this error when trying multipass launch (even after setting up the firewall rule):
[2026-03-19T12:15:14.074] [error] [lxd request] Empty reply received for GET operation on unix://multipass/var/snap/lxd/common/lxd/unix.socket@1.0?project=multipass
launch failed: Empty reply received for GET operation on unix://multipass/var/snap/lxd/common/lxd/unix.socket@1.0?project=multipass
Am I just doing something wrong? This is with the Snaps for Multipass and LXD.
|
The firewall rule is for instance networking, that log suggests that the lxd backend is not running at all. I would check the health of I just tested in my machine and it works as expected, although I only tested launch this time. |
jimporter
left a comment
There was a problem hiding this comment.
Ok, after a long misadventure in trying to repair my LXD setup locally, I've confirmed that this works on LXD 5.21 and 6.7. Just a couple small comments about the code changes, but otherwise it looks good.
Also removed a commented line
Description
Related Issue(s)
Closes reported issue in Mattermost.
Testing
Unit tests
Manual testing steps:
multipass set local.driver=lxdmultipass launch -n acreates a VMmultipass launch -n acreates a VMChecklist
Additional Notes
Firewall issues: It seems that port 53 has to be allowed for mpbr0 or lxdbr0 manually in your firewall to have DNS resolution. It appears to happen only on authd based installations + standalone multipass, can be fixed with:
sudo ufw allow in on mpbr0 to any port 53Suggested migration: Still untested how to move the VMs from one endpoint to the other one.