Create VM from script, network with both pci.addr and vlan-tag?! How?

EasyRider

New Member
Jan 11, 2022
1
0
1
44
I am currently working on a script to create a VM that has network-interfaces with both vlan-tag and a pre-defined pci-bus address, and it seems impossible?!

While using the --net# I am able to create a tagged network interface.

qm create <ID> --name <NAME> --bios ovmf --ostype ...... --net0 virtio,bridge=vmbr0,tag=10


But if I want to use a pre-defined pci-bus address I need to create the network interface by using "--args '-device .... -netdev .....' " instead. Unfortunately, what I know, it is not possible to set vlan-id by the --args - command.


I really need to create everything by a script and not manually because it is a large number of machines to create and we need tha be shure that everything is set up correctly between different installations.

Can someone help me solving this problem?

Thanks!
 

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!