Trouble setting net0 config via HTTP API (no sdn vnet ID specified error)

digahill

New Member
Apr 9, 2024
2
0
1
Hi All - I am trying to use the HTTP API to change the vlan tag on net0 for a VM. I'm banging my head against the wall trying to get this seemingly simple command to work. I'm hoping someone has seen this issue and can help out.

Example curl command:

Bash:
curl -X PUT -H 'Authorization: PVEAPIToken=user@pve!api=TOKEN' --data "net0=virtio=BC:24:11:57:19:E3,bridge=vmbr1,firewall=1,tag=10" "https://pxmx1.example.com:8006/api2/json/nodes/pxmx1/qemu/133/config"

The output I get is:
Code:
{"message":"no sdn vnet ID specified\n","data":null}

This is a 2 node cluster I'm testing with. SDN is not configured/enabled (although there are 2 entries named "localnetwork" in the Datacenter->SND screen, must have been autogenerated when creating the cluster).

I'm not finding any info on this error. I'm pretty sure the --data param is populated correctly.

PVE is v8.4.1.

Is there a place I can see more detailed logging about the call?

If anyone has ideas, I'd really appreciate the help.
 
I finally figured this out. The error message is a red herring. SDN has nothing to do with the problem, rather it seems to be an encoding issue of the data. Swapping the --data flag to --data-urlencode did the trick.