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

EasyRider

New Member
Jan 11, 2022
1
0
1
45
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!