So I tried this out, and I was able to get further. Here is what I have (I’m trying all this on a single node first)
I created a container and assigned the my-ovn network to it. I got no IP address when I run incus list
+---------+---------+------+------+-----------+-----------+--------------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION |
+---------+---------+------+------+-----------+-----------+--------------+
| test-01 | RUNNING | | | CONTAINER | 0 | incus-exp-01 |
+---------+---------+------+------+-----------+-----------+--------------+
| test-02 | RUNNING | | | CONTAINER | 0 | incus-exp-01 |
+---------+---------+------+------+-----------+-----------+--------------+
However when I run incus config show test-01 I got
incus config show test-01
architecture: x86_64
config:
image.architecture: amd64
image.description: Alpine 3.18 amd64 (20231226_13:00)
image.os: Alpine
image.release: "3.18"
image.requirements.secureboot: "false"
image.serial: "20231226_13:00"
image.type: squashfs
image.variant: default
volatile.base_image: 085372ea353dcf972c083d3d0daa46228568abda4752635fbf0052a8dc9dafa2
volatile.cloud-init.instance-id: bec1ae5d-7532-43ff-a22f-e1f82694c89a
volatile.eth0.host_name: vethe7ef5d76
volatile.eth0.hwaddr: 00:16:3e:c4:32:ac
volatile.eth0.last_state.ip_addresses: 10.68.9.2,fd42:8510:cb48:6882:216:3eff:fec4:32ac
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.power: RUNNING
volatile.uuid: bb51f5b3-1f2f-425d-8c52-6d74591748c7
volatile.uuid.generation: bb51f5b3-1f2f-425d-8c52-6d74591748c7
devices:
eth0:
name: eth0
network: my-ovn
type: nic
ephemeral: false
profiles:
- default
stateful: false
description: ""
Another thing is I could run incus network attach-profile my-ovn default eth0 however when creating the container it gave me an error
incus launch images:alpine/3.18 test-01
Creating test-01
Starting test-01
Error: Failed to start device "eth0": Parent device 'my-ovn' doesn't exist
Try `incus info --show-log local:test-01` for more info
Here is the incus profile show default
config: {}
description: Default Incus profile
devices:
eth0:
nictype: macvlan
parent: my-ovn
type: nic
root:
path: /
pool: local
type: disk
name: default
used_by:
- /1.0/instances/test-02
I changed the profile devices to this:
config: {}
description: Default Incus profile
devices:
eth0:
name: eth0
network: my-ovn
type: nic
root:
path: /
pool: local
type: disk
name: default
used_by:
- /1.0/instances/test-01
Basically modified the network device, and it could launch the container but still no IP assigned to the container.
Here is config for the UPLINK network
config:
ipv4.address: 10.1.0.1/24
ipv4.dhcp.ranges: 10.1.0.10-10.1.0.50
ipv4.nat: "true"
ipv4.ovn.ranges: 10.1.0.100-10.1.0.250
ipv6.address: none
description: ""
name: UPLINK
type: bridge
used_by:
- /1.0/networks/my-ovn
managed: true
status: Created
locations:
- incus-exp-01
Here is the config for the my-ovn network
config:
bridge.mtu: "1500"
ipv4.address: 10.68.9.1/24
ipv4.nat: "true"
ipv6.address: fd42:8510:cb48:6882::1/64
ipv6.nat: "true"
network: UPLINK
volatile.network.ipv4.address: 10.1.0.100
description: ""
name: my-ovn
type: ovn
used_by:
- /1.0/instances/test-01
- /1.0/profiles/default
managed: true
status: Created
locations:
- incus-exp-01
sudo ovs-vsctl show
d6cca92a-7270-48d3-b2be-82ce2f09bcb6
Bridge br-int
fail_mode: secure
datapath_type: system
Port br-int
Interface br-int
type: internal
Port veth0e2fd700
Interface veth0e2fd700
Bridge incusovn1
Port incusovn1
Interface incusovn1
type: internal
Port incusovn1b
Interface incusovn1b
ovs_version: "2.17.8"
UPDATE: I just re-did the setup again
I ran incus network list-allocations and saw this
+------------------------+--------------------------------------------+----------+------+-------------------+
| USED BY | ADDRESS | TYPE | NAT | HARDWARE ADDRESS |
+------------------------+--------------------------------------------+----------+------+-------------------+
| /1.0/networks/UPLINK | 172.123.123.1/24 | network | true | |
+------------------------+--------------------------------------------+----------+------+-------------------+
| /1.0/networks/my-ovn | 10.39.18.1/24 | network | true | |
+------------------------+--------------------------------------------+----------+------+-------------------+
| /1.0/networks/my-ovn | fd42:bb1a:1acf:49aa::1/64 | network | true | |
+------------------------+--------------------------------------------+----------+------+-------------------+
| /1.0/instances/test-02 | 10.39.18.2/32 | instance | true | 00:16:3e:80:86:47 |
+------------------------+--------------------------------------------+----------+------+-------------------+
| /1.0/instances/test-02 | fd42:bb1a:1acf:49aa:216:3eff:fe80:8647/128 | instance | true | 00:16:3e:80:86:47 |
+------------------------+--------------------------------------------+----------+------+-------------------+
Which is odd becuase based on this it’s getting the ip 10.39.18.2 but when i’m in the container I can’t access the internet nor does the ip show up in incus list.