When creating an ovn network on an incus cluster using CLI (or API), I understand I should create the network on each cluster node using the --target option. However, this does not allow --type=ovn to be specified and by default, the network is created as a bridge.
If I only create the network on the leader node, I get the error that the network in not in pending state (hence above).
The uplink (physical) network for the OVN networks should be created using the --target option, but the ovn networks themselves should not use the --target option. Take a look at this tutorial.
I am actually following this exact tutorial and here is what happens when I try to create the ovn network:
root@incus-node-1:~# incus network create my-ovn -t=ovn Error: Failed creating pending network for member "incus-node-1": Network is not in pending state
Note: I am using the zabbly repo for installing Incus
Edit: it seems incus cannot connect to OVN. I have removed that network from the incus DB and now the error is "Failed to connect to OVN: failed to connect to: ". Nothing after the to: makes me suspicious…
Edit & solution (for whom it may help):
first failed create let the id in the database, so the code was complaining about Network not in pending state (if network_id exists), so I removed it from the DB
second create failed because vswitch was not correctly configured (hence the second error)