From a7b43e481a6eef70d07de77c33017bafaa6ba100 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:43:33 +0100 Subject: [PATCH] hotfix: vlan not set (#1173) --- docs/resources/vm_qemu.md | 2 +- proxmox/Internal/resource/guest/qemu/network/sdk.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/resources/vm_qemu.md b/docs/resources/vm_qemu.md index f1e9ffc8..aca71b6a 100644 --- a/docs/resources/vm_qemu.md +++ b/docs/resources/vm_qemu.md @@ -173,7 +173,7 @@ details. | `model` | `str` | | **Required** Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: `e1000`, `e1000-82540em`, `e1000-82544gc`, `e1000-82545em`, `i82551`, `i82557b`, `i82559er`, `ne2k_isa`, `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, `vmxnet3`. | | `macaddr` | `str` | | Override the randomly generated MAC Address for the VM. Requires the MAC Address be Unicast. | | `bridge` | `str` | `"nat"` | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called `vmbr0`. | -| `tag` | `int` | `-1` | The VLAN tag to apply to packets on this device. `-1` disables VLAN tagging. | +| `tag` | `int` | `0` | The VLAN tag to apply to packets on this device. `0` disables VLAN tagging. | | `firewall` | `bool` | `false` | Whether to enable the Proxmox firewall on this network device. | | `mtu` | `int` | | The MTU value for the network device. On ``virtio`` models, set to ``1`` to inherit the MTU value from the underlying bridge. | | `rate` | `int` | `0` | Network device rate limit in mbps (megabytes per second) as floating point number. Set to `0` to disable rate limiting. | diff --git a/proxmox/Internal/resource/guest/qemu/network/sdk.go b/proxmox/Internal/resource/guest/qemu/network/sdk.go index 1e0559e5..91f39c53 100644 --- a/proxmox/Internal/resource/guest/qemu/network/sdk.go +++ b/proxmox/Internal/resource/guest/qemu/network/sdk.go @@ -53,6 +53,7 @@ func SDK(d *schema.ResourceData) (pveAPI.QemuNetworkInterfaces, diag.Diagnostics Firewall: util.Pointer(networkMap[schemaFirewall].(bool)), MAC: &tmpMAC, MTU: &tmpMTU, + NativeVlan: util.Pointer(pveAPI.Vlan(networkMap[schemaNativeVlan].(int))), Model: util.Pointer(model), MultiQueue: util.Pointer(pveAPI.QemuNetworkQueue(networkMap[schemaQueues].(int))), RateLimitKBps: util.Pointer(pveAPI.QemuNetworkRate(rate))}