I have 3 containers (t1, t2 and tC) in the same ovn network. They can ping each other, except tC for some reason. Looks like having uppercase letters in the name causes problems. Following are the commands I used to create this setup:
apt-get update
apt-get -y install thin-provisioning-tools ovn-central ovn-host
snap switch --channel=5.4/stable lxd
snap refresh lxd
cat <<EOF | lxd init --preseed
config: {}
networks: []
storage_pools:
- config:
size: 5GB
description: ""
name: default
driver: zfs
profiles:
- config: {}
description: ""
devices:
root:
path: /
pool: default
type: disk
name: default
projects: []
cluster: null
EOF
systemctl stop ovn-central
while pgrep ovn-ctl; do sleep 1; done
LOCAL=$(hostname -I | cut -f1 -d' ')
echo "OVN_CTL_OPTS=--db-nb-addr=$LOCAL \
--db-sb-addr=$LOCAL \
--db-nb-cluster-local-addr=$LOCAL \
--db-sb-cluster-local-addr=$LOCAL \
--db-nb-create-insecure-remote=yes \
--db-sb-create-insecure-remote=yes \
--ovn-northd-nb-db=tcp:$LOCAL:6641 \
--ovn-northd-sb-db=tcp:$LOCAL:6642" > /etc/default/ovn-central
rm -rvf /var/lib/ovn
systemctl start ovn-central
ovs-vsctl set open_vswitch . \
external_ids:ovn-encap-type=geneve \
external_ids:ovn-remote="unix:/var/run/ovn/ovnsb_db.sock" \
external_ids:ovn-encap-ip="$LOCAL"
lxc config set network.ovn.northbound_connection="tcp:$LOCAL:6641"
lxc network create b-uplink \
ipv4.address=10.0.0.1/8 \
ipv4.nat=true \
ipv4.dhcp.ranges=10.0.0.2-10.0.0.2 \
ipv4.ovn.ranges=10.0.0.3-10.255.255.254 \
ipv6.address=none
lxc network create test --type=ovn network=b-uplink ipv4.address=172.32.0.1/24 ipv4.nat=true ipv6.address=none
lxc launch ubuntu: t1 --network test
lxc launch ubuntu: t2 --network test
lxc launch ubuntu: tC --network test