Profile with two network interfaces issue

I’ve followed this and the article written by @simos to create a profile with two networking interfaces one macvlan and one bridged, so my container can be accessed directly from network and from the other containers that are in the bridged network.

> lxc profile show macbridge
config: {}
description: ""
devices:
  eth0:
    nictype: macvlan
    parent: enp7s0
    type: nic
  eth1:
    nictype: bridged
    parent: lxdbr0
    type: nic
name: macbridge
used_by: []

but when trying to create a container

lxc launch images:opensuse/tumbleweed t0 --profile macbridge

I always get

Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Invalid devices: Failed detecting root disk device: No root device could be found

Why? How to fix it?

When you specify profiles with --profile only these profiles are applied. It mean that deafult profile that propably contains info about your root device (storage/disk) is not applied. You either have to add something like that to your to your “macbridge” profile:

devices:
 root:
   path: /
   pool: local
   type: disk

or you can specify multiple profiles, make a note that your default profile probably also have device “eth0”, so copy your default profile:
lxc profile copy default default-no-net
remove network device form it:
lxc profile edit default-no-net
then you can launch your instance with:
lxc launch images:opensuse/tumbleweed t0 --profile macbridge --profile default-no-net

2 Likes

Thank you, it works.

Now I need to set the container to get an IP in the second interface, fix both IPs and all will be working (I guess).