Configuring lxc vlans via pvesh (api)

gnomesenpai

Member
Jul 7, 2019
3
0
6
30
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
 

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!