Issue when creating a firewall rule

Sam0x

New Member
Mar 1, 2023
4
0
1
Hi,

When I was trying to create a new firewall rule through the api, I used the pos parameter but it didn't have any effect on the position.
pvesh create /nodes/{node}/qemu/{vmid}/firewall/rules --action "DROP" --type "in" --comment "create rule at some position" --pos 2
Even though I had more that 3 rules, it wouldn't set it to position 2.
 
Hello,

Sorry for resurrecting old one.
i'm using pve-manager/8.1.10/4b06efb5db453f29, and I have the very similar issue.

We've created internal Python tool to populate the firewall rules on a VM level by POST on /api2/json/nodes/{node}/qemu/{vmid}/firewall/rules as described on https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/firewall/rules

Experiencing the same - each and every rule I create got created on position 0, regardless on the pos I supply on the json. It is either a bug or I'm really missing something here.

For the moment, I'll solve it with sorting the rules in reverse order before posting it with the API. First we clear all existing rules, and then POST 1 by 1 in reverse order, so we can have it correctly.
 
Last edited: