[lxc-users] lxd-agent and Snap package

1 view
Skip to first unread message

David Lakatos

unread,
Nov 28, 2020, 4:45:17 PM11/28/20
to lxc-...@lists.linuxcontainers.org
Hi LXC community,

I read about the situation on multiple forums that CentOS 7 and CentOS 8 LXD VM images currently cannot start the lxd-agent.service due to a possible CentOS kernel bug. It seems that I hit the same issue, but found something really strange in the meantime, which I could not explain. Please help me out if you have any idea why there is a difference between the two scenarios' results:

# id
uid=0(root) gid=0(root) groups=0(root)
# uname -a
Linux dlakatos847-laptop 5.9.10-1-default #1 SMP Mon Nov 23 09:08:45 UTC 2020 (b7c3768) x86_64 x86_64 x86_64 GNU/Linux


Scenario A: I use OpenSuSE Tumbleweed OSS repo's LXD package:
  1. # zypper in -y lxd
    ...
    Checking for file conflicts: ...................................................................................................................[done]
    (1/2) Installing: lxd-4.8-1.1.x86_64 ...........................................................................................................[done]
    (2/2) Installing: lxd-bash-completion-4.8-1.1.noarch ...........................................................................................[done]
  2. # systemctl start lxd.service
  3. # /usr/bin/lxc version
    Client version: 4.8
    Server version: 4.8
  4. # /usr/bin/lxd init
    ...
  5. # /usr/bin/lxc launch images:centos/7/amd64 centos --vm
    Creating centos
    Starting centos
  6. # /usr/bin/lxc ls
    +--------+---------+-----------------------+-----------------------------------------------+-----------------+-----------+
    | NAME   |  STATE  |         IPV4          |                     IPV6                      |      TYPE       | SNAPSHOTS |
    +--------+---------+-----------------------+-----------------------------------------------+-----------------+-----------+
    | centos | RUNNING | 10.137.136.143 (eth0) | fd42:3542:bbfa:726c:216:3eff:fe5f:670b (eth0) | VIRTUAL-MACHINE | 0         |
    +--------+---------+-----------------------+-----------------------------------------------+-----------------+-----------+
  7. # /usr/bin/lxc exec centos bash
    Error: Failed to connect to lxd-agent
I checked, the lxd-agent.service could not start, looks like the same issue as explained by Stéphane:

Scenario B: I use the Snap package:
  1. # snap install lxd
    lxd 4.8 from Canonical* installed
  2. # /snap/bin/lxc version
    Client version: 4.8
    Server version: 4.8
  3. # /snap/bin/lxd init
    ... (use the same bridge lxdbr0) ...
  4. # /snap/bin/lxc launch images:centos/7/amd64 centos --vm
    Creating centos
    Starting centos
  5. # /snap/bin/lxc ls
    +--------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
    |  NAME  |  STATE  |         IPV4         |                     IPV6                      |      TYPE       | SNAPSHOTS |
    +--------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
    | centos | RUNNING | 10.137.136.89 (eth0) | fd42:3542:bbfa:726c:216:3eff:fe78:dc48 (eth0) | VIRTUAL-MACHINE | 0         |
    +--------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
  6. # /snap/bin/lxc exec centos bash
    [root@localhost ~]#

If the lxd-agent.service issue really is a CentOS bug, why does it matter if I use my distro's LXD or the Snap package? Why is it working, when I use the Snap package?

Thank you,
David Lakatos

Stéphane Graber

unread,
Dec 7, 2020, 8:11:13 PM12/7/20
to LXC users mailing-list
That's because we've since added support for virtiofs as an
alternative to 9p, fixing the CentOS issue so long as your qemu
supports virtiofsd.
We obviously ship virtiofsd in the snap package but have no control as
to what individual distributions support.

In this case you're seeing the agent work when run with the snap as
virtiofsd is started but when running it with your distro's native
package, you only get 9p which then prevents the VM from starting the
agent.

> _______________________________________________
> lxc-users mailing list
> lxc-...@lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

--
Stéphane

Reply all
Reply to author
Forward
0 new messages