Creating a SDN fabric node with the API

Jun 14, 2022
6
0
6
Hi.

I'm working on automating my homelab setup with Ansible and the PVE API. I'm using the new SDN fabrics in PVE 9, and I've been able to set up my OSPF fabric manually. However, when I try to do the same with the API I get a bit stuck. I'm able to create a fabric node if I don't specify interfaces or specify a single interface but I'm not sure how to specify multiple interfaces.

According to the API viewer on my nodes (not on the public https://pve.proxmox.com/pve-docs/api-viewer/ site, since that doesn't seem to have been updated with the 9.0 API), the endpoint POST /api2/json/cluster/sdn/fabrics/node/{fabric_id} creates fabric nodes.

According to the API viewer documentation, there is an optional 'interfaces' parameter which should have the format

[name=<string> [,ip=<string>], ...]

But I'm not able to format that parameter in a way that PVE accepts.

Here are some examples of 'interfaces' parameters that I've tried:

'name=enp1s0,name=enp1s0.2000'
'name=enp1s0;name=enp1s0.2000'
'name=enp1s0 name=enp1s0.2000'

'name=enp1s0,ip=172.31.254.249/31,name=enp1s0.2000,ip=172.31.24.247/31'
'name=enp1s0,ip=172.31.254.249/31;name=enp1s0.2000,ip=172.31.24.247/31'
'name=enp1s0,ip=172.31.254.249/31 name=enp1s0.2000,ip=172.31.24.247/31'

None of them work.

Can somebody explain to me how this parameter is supposed to look?
 
You need to provide those as an array, rather than a single string. You can make the setup manually in the browser and look at the resulting request in the Network Tab of the Developer Tools of your browser. That's probably the easiest way to see how a proper request should look like.
 
You can make the setup manually in the browser and look at the resulting request in the Network Tab of the Developer Tools of your browser. That's probably the easiest way to see how a proper request should look like.
Thank you, that's a great suggestion! I tried looking at logs on the proxmox nodes, but that didn't help. Didn't think of doing it client side.

Thanks so much for the help. Also, thanks for the new fabric feature (thanking you since you are a Proxmox Staff Member). They were exactly what I needed to make the setup I was trying to do on Proxmox 8 easier, and exactly what I would have needed at my last job.
 
Last edited:
Thanks so much for the help. Also, thanks for the new fabric feature (thanking you since you are a Proxmox Staff Member). They were exactly what I needed to make the setup I was trying to do on Proxmox 8 easier, and exactly what I would have needed at my last job.
Thanks! I'm one of the two devs of that feature, so always happy to hear feedback!