Edit: After reading the docs again, it seems like physical LXD networks are exclusively (?) intended to be used with OVN? I’m a little confused, forgive me.
Summary
I’m receiving an error when I attempt to attach a “physical” network interface to an LXD virtual machine.
I thought that maybe, instead of having to create a virtual bridged adapter on the host, bound to the eth0
interface, I could instead use the physical
LXD network type to attach VMs directly to the host’s network interface. I’m not sure if this is an intended use case for the LXD physical
network type or not. Based on my interpretation of the documentation, however, it does seem to be an intended use case.
Reproduction Steps
On the LXD host, I created a “physical” network, according to the LXD documentation, associated with the parent interface eth0
.
~# lxc network create physicalnetwork --type=physical parent=eth0
Then, I created an LXD profile that uses the LXD physical network for the VM network interface device.
~# lxc profile create physnet
~# lxc profile edit physnet # use the YAML below
devices:
eth0:
name: eth0
network: physicalnetwork
type: nic
Then I launched a VM, using this additional profile.
~# lxc launch --vm --profile default --profile physnet images:ubuntu/23.04 u01
After that, I received the following error:
Creating u01
Starting u01
Error: Failed to start device "eth0": Failed to get PCI device info for "eth0": Device uevent file could not be parsed
I can’t find any references to this error on Google, so it seems like an entirely new issue.
Attempted to use Secondary Host Network Interface
Since I failed to bind an LXD VM to the host network interface eth0
, I thought that maybe I could succeed by adding a second network interface to the host.
- I shutdown the LXD host VM in Hyper-V.
- In the Hyper-V VM settings, I added a second network interface to the host, attached to the “external” virtual switch
- I started the LXD host back up
- I recreated the
physical
LXD network and profile, pointing toeth1
instead ofeth0
- I attempted to create a VM with the new profile
- I received the same error as before
Environment
- The LXD host is a virtual machine running on Windows 11 Hyper-V.
- I have an “external” Hyper-V virtual switch that allows me to attach the LXD host directly to my home network.
- The LXD host VM only has the one network interface.