Proxmox Open vSwitch API

hanoon

Renowned Member
Jul 1, 2014
40
3
73
For KVM machine creation Proxmox API works however for the creation of the OVS elements such as bridge (ovs-vsctl add-br) - Is there an API way to do that? or any recommendation on how to automate that over an API?

Thanks in advance
 
the api exist to create ovs config in /etc/network/interfaces

(pvesh create /nodes/<node>/network --iface ... )

with last version of ifupdown2, it's also possible to apply/reload the configuration now. (ifupdown2 will use ovs-vsctl)

(pvesh set /nodes/<node>/network)
 
Thanks for the quick response - Is there any way to configure without making changes to /etc/network/interfaces file - I would like to use one bridge for all guests in the interface file then the rest is over OVS.

my manual flow is like that:

ovs-vsctl add-br sw
ip link set sw up
ovs-vsctl add-port ${vm_ID}_sw vxlan${vm_ID}_host2 -- set interface vxlan${mv_ID}_host2 type=vxlan options:remote_ip=x.x.x.x options:key=${vm_ID}

That should be saved in conf.db, not in the interfaces file.

Note: I read in another post that ifupdown2 doesn't understand OVS syntax ...

I'm also exploring the set-manager option but not sure what is the best way!
 
Is there any way to configure without making changes to /etc/network/interfaces file - I would like to use one bridge for all guests in the interface file then the rest is over OVS.
No. proxmox don't manage ovs config, it's using ifupdown or ifupdown2 from /etc/network/interfaces

my manual flow is like that:

ovs-vsctl add-br sw
ip link set sw up
ovs-vsctl add-port ${vm_ID}_sw vxlan${vm_ID}_host2 -- set interface vxlan${mv_ID}_host2 type=vxlan options:remote_ip=x.x.x.x options:key=${vm_ID}
do you want to add port when vm is starting ? (as I'm seeing vmid variable in your example)
if yes, it could be possible to do it in vm hook script
https://pve.proxmox.com/pve-docs/chapter-qm.html#_hookscripts


Note: I read in another post that ifupdown2 doesn't understand OVS syntax ...
I have create a native ovs plugin for ifupdown2 last month, it's available now, and reload is working now :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!