Configuring lxc vlans via pvesh (api)

gnomesenpai

Active Member
Jul 7, 2019
3
0
41
31
Hey guys, i'm currently working on a little scrip to make deploying lxc's quicker and i'm having some issues getting pvesh to set vlan tags, according to the api documentation its done via ",trunks=<vlanid>" but in execution of this it seems to get missed.

The networking string i'm using within the python script is
Code:
'pvesh set /nodes/%s/lxc/%d/config -net0 bridge=vmbr0,ip=%s,gw=%s,name=eth0,type=veth,trunks=2' % (nodeid, vmid2, networkingipaddr2, networkinggw2)
Am i being stupid, missing something or what? everything else is working bar the vlan tagging.
upload_2019-7-7_20-49-9.png

Add/solved:

It turns out that tags=<vlanid> works but trunks=<vlanid> stated in the documentation does not.
 
Last edited:
Hi,

what do you mean with the documentation says you must use trunks?
Code:
tag=<integer> (1 - 4094)
               VLAN tag for this interface.

trunks=<vlanid[;vlanid...]>
               VLAN ids to pass through the interface
 
Sorry it was an oversight on my part, due to how clumped together the options are within the API documentation
upload_2019-7-8_17-26-1.png
It would be nice if they were a little spaced out to make reading the options easier