close #1543: allow lxc low-level update via api

sinux-l5d

New Member
Jan 22, 2025
2
0
1
Hello,

I'm trying to fully automate my homelab with Proxmox and infra as code with Pulumi.

A missing feature is to allow the modification of low-level lxc settings via the API, as spotted in #1543.
Today, the GET config endpoint returns the current low-level configuration but don't allow to edit it (PUT).

I've read developers are to communicate via the mailing-list and sign the Contributor License Agreement. But before enrolling myself in a complex process (if it is?), I'd like to know if the following patch as a chance to be accepted.

Before patch:
Code:
$ curl -k -H 'Authorization: [RETRACTED]' 'https://192.168.1.199:8006/api2/json/nodes/homelab/lxc/100/config' -X PUT -H "Content-Type: application/json" -d '{"lxc":[["lxc.cgroup2.devices.allow","c 10:200 rwm"],["lxc.mount.entry","/dev/net dev/net none bind,create=dir"]]}'
{
  "errors": {
    "lxc": "property is not defined in schema and the schema does not allow additional properties"
  },
  "data": null
}

After patch:
Code:
$ curl -k -H 'Authorization: [RETRACTED]' 'https://192.168.1.199:8006/api2/json/nodes/homelab/lxc/100/config' -X PUT -H "Content-Type: application/json" -d '{"lxc":[["lxc.cgroup2.devices.allow","c 10:200 rwm"],["lxc.mount.entry","/dev/net dev/net none bind,create=dir"]]}'
{
  "data": null
}

$ curl -k -H 'Authorization: [RETRACTED]' 'https://192.168.1.199:8006/api2/json/nodes/homelab/lxc/100/config' | jq '.data.lxc'
[
  [
    "lxc.cgroup2.devices.allow",
    "c 10:200 rwm"
  ],
  [
    "lxc.mount.entry",
    "/dev/net dev/net none bind,create=dir"
  ]
]
Code:
# tail -2 /etc/pve/lxc/100.conf
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

You can find the git diff attached, for the repo pve-container.
 

Attachments

Hi!

Thanks for contributing to Proxmox VE, we really appreciate it!

I've read developers are to communicate via the mailing-list and sign the Contributor License Agreement. But before enrolling myself in a complex process (if it is?), I'd like to know if the following patch as a chance to be accepted.
Even though it is required to sign the contributor license agreement to get patches accepted, there is no requirement to sign anything for participating on the mailing list and on the Bugzilla.

As the community forum is meant for discussion, tutorials and questions about Proxmox products in general, it is better to move the discussion to
  • Bugzilla for discussing preliminary design decisions and informing interested parties about the current status, and
  • the mailing list (pve-devel in this case) to present a solution to the problem and get it reviewed.
So, I'd ask you kindly to resend this on the mailing list and adding a new entry to the Bugzilla report with the following template to get a proper review :)

Code:
A patch for this was sent in for review [0].
 
[0] https://lore.proxmox.com/pve-devel/...
 
Hello dakralex,

thanks for you reply. Is it mandatory to subscribe to pve-devel in order to send and receive emails ? Or is the subscription just to receive emails when one is sent to pve-devel@lists.proxmox.com ?

Sorry if it's a silly question, I'm not used to mailing lists...
 
No worries, there are no silly questions.

Subscribing to the mailing list is not mandatory to send to it, but as you understood correctly, it is for receiving and following other email threads on it. So it is not required to subscribe to participate, but I highly recommend to either subscribe to it or at least check our public inbox instance [0] if you don't get a direct reply, as sometimes people responding reply only to the mailing list thread itself and you don't get a direct reply back. Just for a notice, if you answer, it is best to press "Reply to all" (the original author and the mailing list thread) instead "Reply to list" (just the mailing list thread).

Hope this helps and gets you on a new exciting journey!

[0] https://lore.proxmox.com/pve-devel/