Weekly status #152


Weekly status for the week of the 8th of June to the 14th of June.

Introduction

LXD

This past week’s focus has been on our virtual machine PCIe layout, ultimately resulting in adding support for external GPU passthrough and a built in virtualised GPU to aid with our plans to add video output using SPICE.

What was initially a rather adhoc layout has now been formalised. With our built-in low-bandwidth devices being added to the 1st PCIe root port as virtual functions, and the SCSI disks, 9p shares and built-in GPUs being added as 3 more separate root ports. This means that the first NIC device added to a VM always takes the 5th PCIe root port and so will consistently be named enp5s0 on guest OSes that support this naming scheme (which VMs created using our existing LXD VM images expect).

The take away from this is that you can now pass-through an external GPU (and associated devices, such as audio controllers) into a VM using the familiar syntax used for GPU passthrough with containers:

lxc config device add <VM name> mygpu gpu id=0 

This results in a PCI layout inside the VM similar to:

# lspci -tnnnv
-[0000:00]-+-00.0  Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller [8086:29c0]
           +-01.0-[01]--+-00.0  Red Hat, Inc. Virtio memory balloon [1af4:1045]
           |            +-00.1  Red Hat, Inc. Virtio RNG [1af4:1044]
           |            +-00.2  Red Hat, Inc. Virtio input [1af4:1052]
           |            +-00.3  Red Hat, Inc. Virtio input [1af4:1052]
           |            +-00.4  Red Hat, Inc. Device [1af4:1053]
           |            \-00.5  Red Hat, Inc. Virtio console [1af4:1043]
           +-01.1-[02]----00.0  Red Hat, Inc. Virtio SCSI [1af4:1048]
           +-01.2-[03]----00.0  Red Hat, Inc. Virtio filesystem [1af4:1049]
           +-01.3-[04]----00.0  Red Hat, Inc. Virtio GPU [1af4:1050]
           +-01.4-[05]----00.0  Red Hat, Inc. Virtio network device [1af4:1041]
           +-01.5-[06]--+-00.0  NVIDIA Corporation GK208B [GeForce GT 730] [10de:1287]
           |            \-00.1  NVIDIA Corporation GK208 HDMI/DP Audio Controller [10de:0e0f]
           +-1f.0  Intel Corporation 82801IB (ICH9) LPC Interface Controller [8086:2918]
           +-1f.2  Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] [8086:2922]
           \-1f.3  Intel Corporation 82801I (ICH9 Family) SMBus Controller [8086:2930]

Note: Unlike passing GPU devices with containers, with VMs the GPU device is unbound from the host, so it must not be in use when the VM is started (or you may lose access to your display).

In addition to this an issue with deleting and restoring containers that contained pipe files when using ext4 project quotas has been fixed.

An issue that prevented starting all instances when using the --all flag with a remote node has also been fixed.

LXC

Continuing from last week’s addition of support for VLAN filtering on native and OVS bridges in LXD, the feature has now also been added to LXC.

This can be achieved using the following new config keys; veth.vlan.id specifies the primary untagged VLAN and veth.vlan.tagged.id can be specified multiple times to specify any tagged VLAN memberships. The veth.vlan.id value can also be set to none to specify that the port is not a member of any untagged VLANs.

E.g.

lxc.net.0.veth.vlan.id = 2
lxc.net.0.veth.vlan.tagged.id = 4
lxc.net.0.veth.vlan.tagged.id = 4094

LXCFS

LXCFS has seen an issue with invalid SWAP values being emulated that was introduced recently with other performance improvements fixed. In addition to that there has also been continued work to better emulate the cpu view.

Distrobuilder

An issue that prevented xattrs being preserved in generated imaged has now been fixed.

Contribute to LXD

Ever wanted to contribute to LXD but not sure where to start?
We’ve recently gone through some effort to properly tag issues suitable for new contributors on Github: Easy issues for new contributors

Upcoming events

Ongoing projects

The list below is feature or refactoring work which will span several weeks/months and can’t be tied directly to a single Github issue or pull request.

  • Virtual machine support
  • Distrobuilder Windows support
  • Various kernel work
  • Stable release work for LXC, LXCFS and LXD

Upstream changes

The items listed below are highlights of the work which happened upstream over the past week and which will be included in the next release.

LXD

LXC

LXCFS

Distrobuilder

Distribution work

This section is used to track the work done in downstream Linux distributions to ship the latest LXC, LXD and LXCFS as well as work to get various software to work properly inside containers.

Ubuntu

  • One-off riscv64 build of LXD deb

Snap

  • Tweaked lxd-migrate to unset SNAP env variables